aboutsummaryrefslogtreecommitdiff
path: root/libbuild2/variable.ixx
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.ixx
parentbcde39204f0f15f207a10da59347db514936c617 (diff)
Initial take
Diffstat (limited to 'libbuild2/variable.ixx')
-rw-r--r--libbuild2/variable.ixx22
1 files changed, 22 insertions, 0 deletions
diff --git a/libbuild2/variable.ixx b/libbuild2/variable.ixx
index 51c35fd..4a0176f 100644
--- a/libbuild2/variable.ixx
+++ b/libbuild2/variable.ixx
@@ -906,6 +906,28 @@ namespace build2
new (&v.data_) map<K, V> (move (x));
}
+ // json
+ //
+ inline bool value_traits<json_value>::
+ empty (const json_value& v)
+ {
+ if (!v.name)
+ {
+ switch (v.type)
+ {
+ case json_type::null: return true;
+ case json_type::boolean:
+ case json_type::signed_number:
+ case json_type::unsigned_number: break;
+ case json_type::string: return v.string.empty ();
+ case json_type::array:
+ case json_type::object: return v.container.empty ();
+ }
+ }
+
+ return false;
+ }
+
// variable_pool
//
inline const variable* variable_pool::