aboutsummaryrefslogtreecommitdiff
path: root/build2/functions-path.cxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2017-04-18 10:41:19 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2017-04-18 10:41:19 +0200
commit6d076270ccf7ee147c48353e758b4629d165007f (patch)
treeca198d72c9fba63d61f3b8828bd34f971561430b /build2/functions-path.cxx
parenta8a5e80d6c698f6f0e07ec58067466230b4bf447 (diff)
Add path representation() buildfile function
Diffstat (limited to 'build2/functions-path.cxx')
-rw-r--r--build2/functions-path.cxx21
1 files changed, 21 insertions, 0 deletions
diff --git a/build2/functions-path.cxx b/build2/functions-path.cxx
index 3ee6361..8b88ba0 100644
--- a/build2/functions-path.cxx
+++ b/build2/functions-path.cxx
@@ -93,6 +93,27 @@ namespace build2
return r;
};
+ // representation
+ //
+ f["representation"] = [](path p) {return move (p).representation ();};
+ f["representation"] = [](dir_path p) {return move (p).representation ();};
+
+ f["representation"] = [](paths v)
+ {
+ strings r;
+ for (auto& p: v)
+ r.push_back (move (p).representation ());
+ return r;
+ };
+
+ f["representation"] = [](dir_paths v)
+ {
+ strings r;
+ for (auto& p: v)
+ r.push_back (move (p).representation ());
+ return r;
+ };
+
// canonicalize
//
f["canonicalize"] = [](path p) {p.canonicalize (); return p;};