aboutsummaryrefslogtreecommitdiff
path: root/butl/path
diff options
context:
space:
mode:
authorKaren Arutyunov <karen@codesynthesis.com>2017-02-10 16:10:33 +0300
committerKaren Arutyunov <karen@codesynthesis.com>2017-02-13 12:55:34 +0300
commit31e91691e815074ebdb49d258967e2b2a0bfc965 (patch)
tree1739e815c312b40fa9a8c64b7b144cf60d4c28bb /butl/path
parent66ca47f856cc04774cbe07dc67e2e099e5d527f3 (diff)
Add path_entry(), fixes for path
Diffstat (limited to 'butl/path')
-rw-r--r--butl/path16
1 files changed, 16 insertions, 0 deletions
diff --git a/butl/path b/butl/path
index da36770..a81848b 100644
--- a/butl/path
+++ b/butl/path
@@ -145,6 +145,22 @@ namespace butl
return n == 2 && s[0] == '.' && s[1] == '.';
}
+ static bool
+ root (const string_type& s)
+ {
+ return root (s.c_str (), s.size ());
+ }
+
+ static bool
+ root (const C* s, size_type n)
+ {
+#ifdef _WIN32
+ return n == 2 && s[1] == ':';
+#else
+ return n == 1 && is_separator (s[0]);
+#endif
+ }
+
static size_type
find_separator (string_type const& s,
size_type pos = 0,