From 31e91691e815074ebdb49d258967e2b2a0bfc965 Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Fri, 10 Feb 2017 16:10:33 +0300 Subject: Add path_entry(), fixes for path --- butl/path | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'butl/path') 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, -- cgit v1.1