aboutsummaryrefslogtreecommitdiff
path: root/build/path.ixx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2015-02-20 09:29:56 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2015-02-20 09:29:56 +0200
commitc23346c4cda9e0c2318c302dc6014d3fef53a6d3 (patch)
tree2a24d82d2445a8adbdf6e88ef22a5ce4d1957a19 /build/path.ixx
parent8bd89cfca333e58f6990d7d168649dfc79878f31 (diff)
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'}.
Diffstat (limited to 'build/path.ixx')
-rw-r--r--build/path.ixx16
1 files changed, 16 insertions, 0 deletions
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 <typename C>
+ inline basic_path<C> basic_path<C>::
+ base () const
+ {
+ size_type p (traits::find_extension (path_));
+ return p != string_type::npos ? basic_path (path_.c_str (), p) : *this;
+ }
+
+ template <typename C>
+ inline const C* basic_path<C>::
+ extension () const
+ {
+ size_type p (traits::find_extension (path_));
+ return p != string_type::npos ? path_.c_str () + p + 1 : nullptr;
+ }
+
#ifndef _WIN32
template <typename C>
inline typename basic_path<C>::string_type basic_path<C>::