aboutsummaryrefslogtreecommitdiff
path: root/libbuild2/variable.hxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2024-01-22 12:02:41 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2024-01-22 12:02:41 +0200
commit677eb1e1017630a1d1abbb528d28b90110990ef4 (patch)
tree2926def456a6008f54b6d8d2936fd12ce135db95 /libbuild2/variable.hxx
parentbcde39204f0f15f207a10da59347db514936c617 (diff)
Initial take
Diffstat (limited to 'libbuild2/variable.hxx')
-rw-r--r--libbuild2/variable.hxx20
1 files changed, 20 insertions, 0 deletions
diff --git a/libbuild2/variable.hxx b/libbuild2/variable.hxx
index a91a7e0..eddf1ac 100644
--- a/libbuild2/variable.hxx
+++ b/libbuild2/variable.hxx
@@ -15,6 +15,8 @@
#include <libbuild2/forward.hxx>
#include <libbuild2/utility.hxx>
+#include <libbuild2/json.hxx>
+
#include <libbuild2/context.hxx>
#include <libbuild2/target-type.hxx>
#include <libbuild2/diagnostics.hxx>
@@ -1179,6 +1181,24 @@ namespace build2
static const map_value_type<K, V> value_type;
};
+ // json
+ //
+ template <>
+ struct LIBBUILD2_SYMEXPORT value_traits<json_value>
+ {
+ static_assert (sizeof (json_value) <= value::size_, "insufficient space");
+
+ static json_value convert (names&&);
+ static void assign (value&, json_value&&);
+ static void append (value&, json_value&&);
+ static void prepend (value&, json_value&&);
+ static bool empty (const json_value&); // null or empty string|array|object
+
+ static const json_value empty_instance; // null
+ static const char* const type_name;
+ static const build2::value_type value_type;
+ };
+
// Canned command line to be re-lexed (used in {Build,Test}scripts).
//
// Note that because the executable can be specific as a target or as