aboutsummaryrefslogtreecommitdiff
path: root/libbuild2/functions-bool.cxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2022-09-30 05:15:58 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2022-09-30 05:15:58 +0200
commitdbf37dc16ad9549ce5a1021c74fe369ab2e0d917 (patch)
tree3f382aed7d12f162272b503208ea05c58b8e6d1c /libbuild2/functions-bool.cxx
parent04bf0b7cbe98c70d7e434e24a3eb4b03889c0c56 (diff)
Move integer and bool function to separate source/testscript files
Diffstat (limited to 'libbuild2/functions-bool.cxx')
-rw-r--r--libbuild2/functions-bool.cxx20
1 files changed, 20 insertions, 0 deletions
diff --git a/libbuild2/functions-bool.cxx b/libbuild2/functions-bool.cxx
new file mode 100644
index 0000000..1ae89d2
--- /dev/null
+++ b/libbuild2/functions-bool.cxx
@@ -0,0 +1,20 @@
+// file : libbuild2/functions-bool.cxx -*- C++ -*-
+// license : MIT; see accompanying LICENSE file
+
+#include <libbuild2/function.hxx>
+#include <libbuild2/variable.hxx>
+
+using namespace std;
+
+namespace build2
+{
+ void
+ bool_functions (function_map& m)
+ {
+ function_family f (m, "bool");
+
+ // $string(<bool>)
+ //
+ f["string"] += [](bool b) {return b ? "true" : "false";};
+ }
+}