aboutsummaryrefslogtreecommitdiff
path: root/libbuild2
diff options
context:
space:
mode:
Diffstat (limited to 'libbuild2')
-rw-r--r--libbuild2/functions-path.cxx10
-rw-r--r--libbuild2/functions-string.cxx6
2 files changed, 16 insertions, 0 deletions
diff --git a/libbuild2/functions-path.cxx b/libbuild2/functions-path.cxx
index 72597ff..c23a8a8 100644
--- a/libbuild2/functions-path.cxx
+++ b/libbuild2/functions-path.cxx
@@ -422,6 +422,16 @@ namespace build2
f["size"] += [] (paths v) {return v.size ();};
f["size"] += [] (dir_paths v) {return v.size ();};
+ // $size(<path>)
+ // $size(<dir_path>)
+ //
+ // Return the number of characters (bytes) in the path. Note that for
+ // dir_path the result does not include the trailing directory separator
+ // (except for the POSIX root directory).
+ //
+ f["size"] += [] (path v) {return v.size ();};
+ f["size"] += [] (dir_path v) {return v.size ();};
+
// $sort(<paths> [, <flags>])
// $sort(<dir_paths> [, <flags>])
//
diff --git a/libbuild2/functions-string.cxx b/libbuild2/functions-string.cxx
index 18a4ed6..4a03a5e 100644
--- a/libbuild2/functions-string.cxx
+++ b/libbuild2/functions-string.cxx
@@ -83,6 +83,12 @@ namespace build2
//
f["size"] += [] (strings v) {return v.size ();};
+ // $size(<string>)
+ //
+ // Return the number of characters (bytes) in the string.
+ //
+ f["size"] += [] (string v) {return v.size ();};
+
// $sort(<strings> [, <flags>])
//
// Sort strings in ascending order.