From 49cd0e47d3783bcc31521a2425061ca7fae07363 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Fri, 10 Jul 2015 15:33:18 +0200 Subject: Implement path_cast(), path::simple() --- butl/path.ixx | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) (limited to 'butl/path.ixx') diff --git a/butl/path.ixx b/butl/path.ixx index 0cbbeaf..3e8a9cc 100644 --- a/butl/path.ixx +++ b/butl/path.ixx @@ -25,6 +25,33 @@ namespace butl } #endif + // @@ Should only enable_if P is basic_path. + // + template + inline P + path_cast (const basic_path& p) + { + return P (p.path_, false); + } + + template + inline P + path_cast (basic_path&& p) + { + return P (std::move (p.path_), false); + } + + template + inline bool basic_path:: + simple () const + { + return +#ifndef _WIN32 + root () || +#endif + traits::find_separator (this->path_) == string_type::npos; + } + template inline bool basic_path:: absolute () const -- cgit v1.1