aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/fs/Traits.hxx19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/fs/Traits.hxx b/src/fs/Traits.hxx
index 6ec5ebd2b..5ba82549e 100644
--- a/src/fs/Traits.hxx
+++ b/src/fs/Traits.hxx
@@ -56,6 +56,19 @@ struct PathTraitsFS {
}
gcc_pure gcc_nonnull_all
+ static const_pointer FindLastSeparator(const_pointer p) {
+ assert(p != nullptr);
+#ifdef WIN32
+ const_pointer pos = p + GetLength(p);
+ while (p != pos && !IsSeparator(*pos))
+ --pos;
+ return IsSeparator(*pos) ? pos : nullptr;
+#else
+ return strrchr(p, SEPARATOR);
+#endif
+ }
+
+ gcc_pure gcc_nonnull_all
static bool IsAbsolute(const_pointer p) {
assert(p != nullptr);
#ifdef WIN32
@@ -97,6 +110,12 @@ struct PathTraitsUTF8 {
}
gcc_pure gcc_nonnull_all
+ static const_pointer FindLastSeparator(const_pointer p) {
+ assert(p != nullptr);
+ return strrchr(p, SEPARATOR);
+ }
+
+ gcc_pure gcc_nonnull_all
static bool IsAbsolute(const_pointer p) {
assert(p != nullptr);
#ifdef WIN32