fs/Path: rename GetSuffix() to GetExtension()

The "extension" is the name after the dot, but the "suffix" is the
string including the dot.
This commit is contained in:
Max Kellermann 2022-07-14 15:56:18 +02:00
parent 594b97feb1
commit 254ee00c37
7 changed files with 9 additions and 9 deletions

View File

@ -77,7 +77,7 @@ ScanFileTagsNoGeneric(Path path_fs, TagHandler &handler)
/* check if there's a suffix and a plugin */ /* check if there's a suffix and a plugin */
const auto *suffix = path_fs.GetSuffix(); const auto *suffix = path_fs.GetExtension();
if (suffix == nullptr) if (suffix == nullptr)
return false; return false;

View File

@ -113,7 +113,7 @@ static AllocatedPath
ReplaceSuffix(Path src, ReplaceSuffix(Path src,
const PathTraitsFS::const_pointer new_suffix) noexcept const PathTraitsFS::const_pointer new_suffix) noexcept
{ {
const auto *old_suffix = src.GetSuffix(); const auto *old_suffix = src.GetExtension();
if (old_suffix == nullptr) if (old_suffix == nullptr)
return nullptr; return nullptr;
@ -322,7 +322,7 @@ gme_container_scan(Path path_fs)
if (num_songs < 2) if (num_songs < 2)
return list; return list;
const auto *subtune_suffix = path_fs.GetSuffix(); const auto *subtune_suffix = path_fs.GetExtension();
TagBuilder tag_builder; TagBuilder tag_builder;

View File

@ -296,8 +296,8 @@ public:
} }
[[gnu::pure]] [[gnu::pure]]
const_pointer GetSuffix() const noexcept { const_pointer GetExtension() const noexcept {
return Path{*this}.GetSuffix(); return Path{*this}.GetExtension();
} }
/** /**

View File

@ -37,7 +37,7 @@ Path::ToUTF8Throw() const
} }
Path::const_pointer Path::const_pointer
Path::GetSuffix() const noexcept Path::GetExtension() const noexcept
{ {
const auto base = GetBase().c_str(); const auto base = GetBase().c_str();
const auto *dot = StringFindLast(base, '.'); const auto *dot = StringFindLast(base, '.');

View File

@ -167,7 +167,7 @@ public:
} }
[[gnu::pure]] [[gnu::pure]]
const_pointer GetSuffix() const noexcept; const_pointer GetExtension() const noexcept;
}; };
/** /**

View File

@ -49,7 +49,7 @@ OpenArchiveInputStream(Path path, Mutex &mutex)
return nullptr; return nullptr;
} }
const char *suffix = l.archive.GetSuffix(); const char *suffix = l.archive.GetExtension();
if (suffix == nullptr) if (suffix == nullptr)
return nullptr; return nullptr;

View File

@ -34,7 +34,7 @@ playlist_open_path_suffix(Path path, Mutex &mutex)
try { try {
assert(!path.IsNull()); assert(!path.IsNull());
const auto *suffix = path.GetSuffix(); const auto *suffix = path.GetExtension();
if (suffix == nullptr) if (suffix == nullptr)
return nullptr; return nullptr;