db/update/SpecialDirectory: more std::string_view migration
This commit is contained in:
@@ -9,11 +9,11 @@
|
|||||||
|
|
||||||
[[gnu::pure]]
|
[[gnu::pure]]
|
||||||
static bool
|
static bool
|
||||||
HaveArchivePluginForFilename(const char *filename) noexcept
|
HaveArchivePluginForFilename(std::string_view filename) noexcept
|
||||||
{
|
{
|
||||||
#ifdef ENABLE_ARCHIVE
|
#ifdef ENABLE_ARCHIVE
|
||||||
const char *suffix = PathTraitsUTF8::GetFilenameSuffix(filename);
|
const auto suffix = PathTraitsUTF8::GetFilenameSuffix(filename);
|
||||||
return suffix != nullptr &&
|
return !suffix.empty() &&
|
||||||
archive_plugin_from_suffix(suffix) != nullptr;
|
archive_plugin_from_suffix(suffix) != nullptr;
|
||||||
#else
|
#else
|
||||||
(void)filename;
|
(void)filename;
|
||||||
@@ -23,20 +23,20 @@ HaveArchivePluginForFilename(const char *filename) noexcept
|
|||||||
|
|
||||||
[[gnu::pure]]
|
[[gnu::pure]]
|
||||||
static bool
|
static bool
|
||||||
HaveContainerPluginForFilename(const char *filename) noexcept
|
HaveContainerPluginForFilename(std::string_view filename) noexcept
|
||||||
{
|
{
|
||||||
const char *suffix = PathTraitsUTF8::GetFilenameSuffix(filename);
|
const auto suffix = PathTraitsUTF8::GetFilenameSuffix(filename);
|
||||||
return suffix != nullptr &&
|
return !suffix.empty() &&
|
||||||
// TODO: check if this plugin really supports containers
|
// TODO: check if this plugin really supports containers
|
||||||
decoder_plugins_supports_suffix(suffix);
|
decoder_plugins_supports_suffix(suffix);
|
||||||
}
|
}
|
||||||
|
|
||||||
[[gnu::pure]]
|
[[gnu::pure]]
|
||||||
static bool
|
static bool
|
||||||
HavePlaylistPluginForFilename(const char *filename) noexcept
|
HavePlaylistPluginForFilename(std::string_view filename) noexcept
|
||||||
{
|
{
|
||||||
const char *suffix = PathTraitsUTF8::GetFilenameSuffix(filename);
|
const auto suffix = PathTraitsUTF8::GetFilenameSuffix(filename);
|
||||||
if (suffix == nullptr)
|
if (suffix.empty())
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
const auto plugin = FindPlaylistPluginBySuffix(suffix);
|
const auto plugin = FindPlaylistPluginBySuffix(suffix);
|
||||||
|
Reference in New Issue
Block a user