From a8a54893c09c86e560e6fee9d7972419716dd56d Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Fri, 26 Nov 2021 11:04:15 +0200 Subject: Add $size(string), $size(path), and $size(dir_path) functions --- libbuild2/functions-path.cxx | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'libbuild2/functions-path.cxx') 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() + // $size() + // + // 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( [, ]) // $sort( [, ]) // -- cgit v1.1