aboutsummaryrefslogtreecommitdiff
path: root/libbuild2/functions-name.cxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2021-11-02 15:18:05 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2021-11-02 15:24:35 +0200
commitf500b3274b4c937d315a652aad3bfcdd808b49ec (patch)
tree551ced41e7912f7a4b71e77c6dc0bdef23f90b76 /libbuild2/functions-name.cxx
parentc56aa2d2e407bfffc2b62d4bad3a65051f31b80b (diff)
Add $sort() function
Available overloads: $sort(<names> [, <flags>]) $sort(<ints> [, <flags>]) $sort(<strings> [, <flags>]) $sort(<paths> [, <flags>]) $sort(<dir_paths> [, <flags>]) The following flag is supported by the all overloads: dedup - in addition to sorting also remove duplicates Additionally, the strings overload also support the following flag: icase - sort ignoring case Note that on case-insensitive filesystem the paths and dir_paths overload's order is case-insensitive.
Diffstat (limited to 'libbuild2/functions-name.cxx')
-rw-r--r--libbuild2/functions-name.cxx2
1 files changed, 2 insertions, 0 deletions
diff --git a/libbuild2/functions-name.cxx b/libbuild2/functions-name.cxx
index 43bd8cb..9ba20a8 100644
--- a/libbuild2/functions-name.cxx
+++ b/libbuild2/functions-name.cxx
@@ -63,6 +63,8 @@ namespace build2
//
function_family fn (m, "name");
+ fn["string"] += [](name n) {return to_string (n);};
+
fn["name"] += [](const scope* s, name n)
{
return to_target_name (s, move (n)).first.value;