diff options
author | Max Kellermann <max@musicpd.org> | 2020-03-12 08:11:08 +0100 |
---|---|---|
committer | Max Kellermann <max@musicpd.org> | 2020-03-12 08:11:08 +0100 |
commit | 01632d37effe788a70cc320530d5e0d35b98370b (patch) | |
tree | 778bb0151a8e10b4bdf8b24f21f4a9d1ed97fae4 /src/fs/Traits.hxx | |
parent | c977d646c7d408ccc291e5f458d7d82b84859f11 (diff) | |
parent | c45f1138560b526649bf6e6433fa7d9ba8a6564b (diff) |
Merge branch 'v0.21.x'
Diffstat (limited to 'src/fs/Traits.hxx')
-rw-r--r-- | src/fs/Traits.hxx | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/fs/Traits.hxx b/src/fs/Traits.hxx index 755c0e6ea..d2a2934a0 100644 --- a/src/fs/Traits.hxx +++ b/src/fs/Traits.hxx @@ -109,6 +109,12 @@ struct PathTraitsFS { } gcc_pure gcc_nonnull_all + static bool IsSpecialFilename(const_pointer name) noexcept { + return (name[0] == '.' && name[1] == 0) || + (name[0] == '.' && name[1] == '.' && name[2] == 0); + } + + gcc_pure gcc_nonnull_all static size_t GetLength(const_pointer p) noexcept { return StringLength(p); } @@ -217,6 +223,12 @@ struct PathTraitsUTF8 { } gcc_pure gcc_nonnull_all + static bool IsSpecialFilename(const_pointer name) noexcept { + return (name[0] == '.' && name[1] == 0) || + (name[0] == '.' && name[1] == '.' && name[2] == 0); + } + + gcc_pure gcc_nonnull_all static size_t GetLength(const_pointer p) noexcept { return StringLength(p); } |