diff options
Diffstat (limited to 'src/fs')
-rw-r--r-- | src/fs/Path.hxx | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/src/fs/Path.hxx b/src/fs/Path.hxx index bd3f3a94e..a5215c2d6 100644 --- a/src/fs/Path.hxx +++ b/src/fs/Path.hxx @@ -23,6 +23,10 @@ #include "check.h" #include "gcc.h" +#ifdef WIN32 +#include <glib.h> +#endif + #include <algorithm> #include <string> @@ -261,6 +265,33 @@ public: #endif ch == SEPARATOR_UTF8; } + + gcc_pure + static bool IsAbsoluteFS(const_pointer p) { + assert(p != nullptr); + +#ifdef WIN32 + return g_path_is_absolute(p); +#else + return IsSeparatorFS(*p); +#endif + } + + gcc_pure + static bool IsAbsoluteUTF8(const char *p) { + assert(p != nullptr); + +#ifdef WIN32 + return g_path_is_absolute(p); +#else + return IsSeparatorUTF8(*p); +#endif + } + + gcc_pure + bool IsAbsolute() { + return IsAbsoluteFS(c_str()); + } }; #endif |