{decoder,archive,playlist}/plugin: pass std::string_view to SupportsMimeType()

This commit is contained in:
Max Kellermann
2020-11-04 20:29:25 +01:00
parent 53396c0e50
commit 19dd1a25d7
13 changed files with 28 additions and 36 deletions

View File

@@ -25,6 +25,7 @@
#include <forward_list> // IWYU pragma: export
#include <set>
#include <string>
#include <string_view>
struct ConfigBlock;
class InputStream;
@@ -252,15 +253,15 @@ struct DecoderPlugin {
* Does the plugin announce the specified file name suffix?
*/
gcc_pure gcc_nonnull_all
bool SupportsSuffix(const char *suffix) const noexcept;
bool SupportsSuffix(std::string_view suffix) const noexcept;
/**
* Does the plugin announce the specified MIME type?
*/
gcc_pure gcc_nonnull_all
bool SupportsMimeType(const char *mime_type) const noexcept;
bool SupportsMimeType(std::string_view mime_type) const noexcept;
bool SupportsContainerSuffix(const char *suffix) const noexcept {
bool SupportsContainerSuffix(std::string_view suffix) const noexcept {
return container_scan != nullptr && SupportsSuffix(suffix);
}
};