db/update/SpecialDirectory: more std::string_view migration

This commit is contained in:
Max Kellermann 2023-09-06 14:51:35 +02:00
parent 20bbe1b57b
commit 2c4ef4460f
1 changed files with 9 additions and 9 deletions

View File

@ -9,11 +9,11 @@
[[gnu::pure]]
static bool
HaveArchivePluginForFilename(const char *filename) noexcept
HaveArchivePluginForFilename(std::string_view filename) noexcept
{
#ifdef ENABLE_ARCHIVE
const char *suffix = PathTraitsUTF8::GetFilenameSuffix(filename);
return suffix != nullptr &&
const auto suffix = PathTraitsUTF8::GetFilenameSuffix(filename);
return !suffix.empty() &&
archive_plugin_from_suffix(suffix) != nullptr;
#else
(void)filename;
@ -23,20 +23,20 @@ HaveArchivePluginForFilename(const char *filename) noexcept
[[gnu::pure]]
static bool
HaveContainerPluginForFilename(const char *filename) noexcept
HaveContainerPluginForFilename(std::string_view filename) noexcept
{
const char *suffix = PathTraitsUTF8::GetFilenameSuffix(filename);
return suffix != nullptr &&
const auto suffix = PathTraitsUTF8::GetFilenameSuffix(filename);
return !suffix.empty() &&
// TODO: check if this plugin really supports containers
decoder_plugins_supports_suffix(suffix);
}
[[gnu::pure]]
static bool
HavePlaylistPluginForFilename(const char *filename) noexcept
HavePlaylistPluginForFilename(std::string_view filename) noexcept
{
const char *suffix = PathTraitsUTF8::GetFilenameSuffix(filename);
if (suffix == nullptr)
const auto suffix = PathTraitsUTF8::GetFilenameSuffix(filename);
if (suffix.empty())
return false;
const auto plugin = FindPlaylistPluginBySuffix(suffix);