diff options
author | Karen Arutyunov <karen@codesynthesis.com> | 2017-02-10 16:10:33 +0300 |
---|---|---|
committer | Karen Arutyunov <karen@codesynthesis.com> | 2017-02-13 12:55:34 +0300 |
commit | 31e91691e815074ebdb49d258967e2b2a0bfc965 (patch) | |
tree | 1739e815c312b40fa9a8c64b7b144cf60d4c28bb /butl/path | |
parent | 66ca47f856cc04774cbe07dc67e2e099e5d527f3 (diff) |
Add path_entry(), fixes for path
Diffstat (limited to 'butl/path')
-rw-r--r-- | butl/path | 16 |
1 files changed, 16 insertions, 0 deletions
@@ -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, |