From c23346c4cda9e0c2318c302dc6014d3fef53a6d3 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Fri, 20 Feb 2015 09:29:56 +0200 Subject: Rework extension handling logic We no longer support hxx{vector.}. Rather, the target type can decide, e.g., based on a config variable, whether to append an extension. Also, in the future we may support a syntax to specify that this is a complete name, e.g., hxx{'vector'}. --- build/path.ixx | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'build/path.ixx') diff --git a/build/path.ixx b/build/path.ixx index f742060..60d3bc3 100644 --- a/build/path.ixx +++ b/build/path.ixx @@ -57,6 +57,22 @@ namespace build return *this; } + template + inline basic_path basic_path:: + base () const + { + size_type p (traits::find_extension (path_)); + return p != string_type::npos ? basic_path (path_.c_str (), p) : *this; + } + + template + inline const C* basic_path:: + extension () const + { + size_type p (traits::find_extension (path_)); + return p != string_type::npos ? path_.c_str () + p + 1 : nullptr; + } + #ifndef _WIN32 template inline typename basic_path::string_type basic_path:: -- cgit v1.1