From 6d076270ccf7ee147c48353e758b4629d165007f Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Tue, 18 Apr 2017 10:41:19 +0200 Subject: Add path representation() buildfile function --- build2/functions-path.cxx | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'build2/functions-path.cxx') 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;}; -- cgit v1.1