Commit 1e9da09f authored by Max Kellermann's avatar Max Kellermann

TagFile: add "noexcept"

parent 5caf351c
...@@ -46,16 +46,16 @@ class TagFileScan { ...@@ -46,16 +46,16 @@ class TagFileScan {
public: public:
TagFileScan(Path _path_fs, const char *_suffix, TagFileScan(Path _path_fs, const char *_suffix,
const TagHandler &_handler, void *_handler_ctx) const TagHandler &_handler, void *_handler_ctx) noexcept
:path_fs(_path_fs), suffix(_suffix), :path_fs(_path_fs), suffix(_suffix),
handler(_handler), handler_ctx(_handler_ctx) , handler(_handler), handler_ctx(_handler_ctx) ,
is(nullptr) {} is(nullptr) {}
bool ScanFile(const DecoderPlugin &plugin) { bool ScanFile(const DecoderPlugin &plugin) noexcept {
return plugin.ScanFile(path_fs, handler, handler_ctx); return plugin.ScanFile(path_fs, handler, handler_ctx);
} }
bool ScanStream(const DecoderPlugin &plugin) { bool ScanStream(const DecoderPlugin &plugin) noexcept {
if (plugin.scan_stream == nullptr) if (plugin.scan_stream == nullptr)
return false; return false;
...@@ -78,14 +78,15 @@ public: ...@@ -78,14 +78,15 @@ public:
return plugin.ScanStream(*is, handler, handler_ctx); return plugin.ScanStream(*is, handler, handler_ctx);
} }
bool Scan(const DecoderPlugin &plugin) { bool Scan(const DecoderPlugin &plugin) noexcept {
return plugin.SupportsSuffix(suffix) && return plugin.SupportsSuffix(suffix) &&
(ScanFile(plugin) || ScanStream(plugin)); (ScanFile(plugin) || ScanStream(plugin));
} }
}; };
bool bool
tag_file_scan(Path path_fs, const TagHandler &handler, void *handler_ctx) tag_file_scan(Path path_fs,
const TagHandler &handler, void *handler_ctx) noexcept
{ {
assert(!path_fs.IsNull()); assert(!path_fs.IsNull());
...@@ -104,7 +105,7 @@ tag_file_scan(Path path_fs, const TagHandler &handler, void *handler_ctx) ...@@ -104,7 +105,7 @@ tag_file_scan(Path path_fs, const TagHandler &handler, void *handler_ctx)
} }
bool bool
tag_file_scan(Path path, TagBuilder &builder) tag_file_scan(Path path, TagBuilder &builder) noexcept
{ {
if (!tag_file_scan(path, full_tag_handler, &builder)) if (!tag_file_scan(path, full_tag_handler, &builder))
return false; return false;
......
...@@ -34,7 +34,8 @@ class TagBuilder; ...@@ -34,7 +34,8 @@ class TagBuilder;
* found) * found)
*/ */
bool bool
tag_file_scan(Path path, const TagHandler &handler, void *handler_ctx); tag_file_scan(Path path,
const TagHandler &handler, void *handler_ctx) noexcept;
/** /**
* Scan the tags of a song file. Invokes matching decoder plugins, * Scan the tags of a song file. Invokes matching decoder plugins,
...@@ -45,6 +46,6 @@ tag_file_scan(Path path, const TagHandler &handler, void *handler_ctx); ...@@ -45,6 +46,6 @@ tag_file_scan(Path path, const TagHandler &handler, void *handler_ctx);
* found) * found)
*/ */
bool bool
tag_file_scan(Path path, TagBuilder &builder); tag_file_scan(Path path, TagBuilder &builder) noexcept;
#endif #endif
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment