From 254ee00c3793d98c2bf57ef72fb0e84f44b7fbf9 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Thu, 14 Jul 2022 15:56:18 +0200 Subject: [PATCH] fs/Path: rename GetSuffix() to GetExtension() The "extension" is the name after the dot, but the "suffix" is the string including the dot. --- src/TagFile.cxx | 2 +- src/decoder/plugins/GmeDecoderPlugin.cxx | 4 ++-- src/fs/AllocatedPath.hxx | 4 ++-- src/fs/Path.cxx | 2 +- src/fs/Path.hxx | 2 +- src/input/plugins/ArchiveInputPlugin.cxx | 2 +- src/playlist/PlaylistStream.cxx | 2 +- 7 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/TagFile.cxx b/src/TagFile.cxx index a7d677a7c..2ec2355c4 100644 --- a/src/TagFile.cxx +++ b/src/TagFile.cxx @@ -77,7 +77,7 @@ ScanFileTagsNoGeneric(Path path_fs, TagHandler &handler) /* check if there's a suffix and a plugin */ - const auto *suffix = path_fs.GetSuffix(); + const auto *suffix = path_fs.GetExtension(); if (suffix == nullptr) return false; diff --git a/src/decoder/plugins/GmeDecoderPlugin.cxx b/src/decoder/plugins/GmeDecoderPlugin.cxx index 090edc8e3..e8f53cb20 100644 --- a/src/decoder/plugins/GmeDecoderPlugin.cxx +++ b/src/decoder/plugins/GmeDecoderPlugin.cxx @@ -113,7 +113,7 @@ static AllocatedPath ReplaceSuffix(Path src, const PathTraitsFS::const_pointer new_suffix) noexcept { - const auto *old_suffix = src.GetSuffix(); + const auto *old_suffix = src.GetExtension(); if (old_suffix == nullptr) return nullptr; @@ -322,7 +322,7 @@ gme_container_scan(Path path_fs) if (num_songs < 2) return list; - const auto *subtune_suffix = path_fs.GetSuffix(); + const auto *subtune_suffix = path_fs.GetExtension(); TagBuilder tag_builder; diff --git a/src/fs/AllocatedPath.hxx b/src/fs/AllocatedPath.hxx index c63f4fc03..577dfa073 100644 --- a/src/fs/AllocatedPath.hxx +++ b/src/fs/AllocatedPath.hxx @@ -296,8 +296,8 @@ public: } [[gnu::pure]] - const_pointer GetSuffix() const noexcept { - return Path{*this}.GetSuffix(); + const_pointer GetExtension() const noexcept { + return Path{*this}.GetExtension(); } /** diff --git a/src/fs/Path.cxx b/src/fs/Path.cxx index 7dd432a41..86a6fe7f8 100644 --- a/src/fs/Path.cxx +++ b/src/fs/Path.cxx @@ -37,7 +37,7 @@ Path::ToUTF8Throw() const } Path::const_pointer -Path::GetSuffix() const noexcept +Path::GetExtension() const noexcept { const auto base = GetBase().c_str(); const auto *dot = StringFindLast(base, '.'); diff --git a/src/fs/Path.hxx b/src/fs/Path.hxx index 08b26764f..a8a0ac9b2 100644 --- a/src/fs/Path.hxx +++ b/src/fs/Path.hxx @@ -167,7 +167,7 @@ public: } [[gnu::pure]] - const_pointer GetSuffix() const noexcept; + const_pointer GetExtension() const noexcept; }; /** diff --git a/src/input/plugins/ArchiveInputPlugin.cxx b/src/input/plugins/ArchiveInputPlugin.cxx index 156aafe82..b23f89c49 100644 --- a/src/input/plugins/ArchiveInputPlugin.cxx +++ b/src/input/plugins/ArchiveInputPlugin.cxx @@ -49,7 +49,7 @@ OpenArchiveInputStream(Path path, Mutex &mutex) return nullptr; } - const char *suffix = l.archive.GetSuffix(); + const char *suffix = l.archive.GetExtension(); if (suffix == nullptr) return nullptr; diff --git a/src/playlist/PlaylistStream.cxx b/src/playlist/PlaylistStream.cxx index cffbd7a67..ace139861 100644 --- a/src/playlist/PlaylistStream.cxx +++ b/src/playlist/PlaylistStream.cxx @@ -34,7 +34,7 @@ playlist_open_path_suffix(Path path, Mutex &mutex) try { assert(!path.IsNull()); - const auto *suffix = path.GetSuffix(); + const auto *suffix = path.GetExtension(); if (suffix == nullptr) return nullptr;