fs/Traits: add GetFilenameSuffix()
This commit is contained in:
parent
945ed2610a
commit
6f1a4a73b7
@ -88,6 +88,14 @@ struct PathTraitsFS {
|
||||
#endif
|
||||
}
|
||||
|
||||
gcc_pure
|
||||
static const_pointer GetFilenameSuffix(const_pointer filename) noexcept {
|
||||
const_pointer dot = StringFindLast(filename, '.');
|
||||
return dot != nullptr && dot > filename && dot[1] != 0
|
||||
? dot + 1
|
||||
: nullptr;
|
||||
}
|
||||
|
||||
#ifdef _WIN32
|
||||
gcc_pure gcc_nonnull_all
|
||||
static constexpr bool IsDrive(const_pointer p) noexcept {
|
||||
@ -199,6 +207,14 @@ struct PathTraitsUTF8 {
|
||||
return std::strrchr(p, SEPARATOR);
|
||||
}
|
||||
|
||||
gcc_pure
|
||||
static const_pointer GetFilenameSuffix(const_pointer filename) noexcept {
|
||||
const_pointer dot = StringFindLast(filename, '.');
|
||||
return dot != nullptr && dot > filename && dot[1] != 0
|
||||
? dot + 1
|
||||
: nullptr;
|
||||
}
|
||||
|
||||
#ifdef _WIN32
|
||||
gcc_pure gcc_nonnull_all
|
||||
static constexpr bool IsDrive(const_pointer p) noexcept {
|
||||
|
Loading…
Reference in New Issue
Block a user