diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2024-01-23 09:22:36 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2024-01-23 09:22:36 +0200 |
commit | 19b1f25a1209c7af9e73c0e68ba33574a3b4cbb7 (patch) | |
tree | 37705ff14d47e08d21f8d16fa8b572e312b19bda /libbuild2/json.hxx | |
parent | 7d5c863e01b4a70d5ef3614b91694cf080a420c9 (diff) |
Add reversejson-type
Diffstat (limited to 'libbuild2/json.hxx')
-rw-r--r-- | libbuild2/json.hxx | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/libbuild2/json.hxx b/libbuild2/json.hxx index 6fc633c..9a57b8f 100644 --- a/libbuild2/json.hxx +++ b/libbuild2/json.hxx @@ -241,13 +241,31 @@ namespace build2 // names are ignored. // int - compare (const json_value&, bool ignore_name = false) const; + compare (const json_value&, bool ignore_name = false) const; }; // Throws invalid_json_output. // LIBBUILD2_SYMEXPORT void serialize (butl::json::buffer_serializer&, const json_value&); + + inline bool + operator== (const json_value& x, const json_value& y) {return x.compare (y) == 0;} + + inline bool + operator!= (const json_value& x, const json_value& y) {return !(x == y);} + + inline bool + operator< (const json_value& x, const json_value& y) {return x.compare (y) < 0;} + + inline bool + operator<= (const json_value& x, const json_value& y) {return x.compare (y) <= 0;} + + inline bool + operator> (const json_value& x, const json_value& y) {return !(x <= y);} + + inline bool + operator>= (const json_value& x, const json_value& y) {return !(x < y);} } #endif // LIBBUILD2_JSON_HXX |