From 7508f6f84f44a28151def5da5f6ea434d670df60 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Sun, 28 Aug 2016 11:05:00 +0200 Subject: Add path::traits::absolute() --- butl/path | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'butl/path') diff --git a/butl/path b/butl/path index aafc2aa..f679330 100644 --- a/butl/path +++ b/butl/path @@ -105,6 +105,16 @@ namespace butl #endif } + static bool + absolute (const string_type& s) + { +#ifdef _WIN32 + return s.size () > 1 && s[1] == ':'; +#else + return s.size () != 0 && is_separator (s[0]); +#endif + } + static size_type find_separator (string_type const& s, size_type pos = 0, -- cgit v1.1