aboutsummaryrefslogtreecommitdiff
path: root/libbutl/json/serializer.hxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2023-03-28 10:02:45 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2023-03-28 10:02:45 +0200
commit96dfc87c05110c3d857fe6d1c6eaeb139e91826c (patch)
tree1ab30f6a88f428b89f3e19a94c7755bf63a4d1b7 /libbutl/json/serializer.hxx
parentd37263139e511b3dbfea2bd355f5edd779a71324 (diff)
Add member_begin_{object,array}() shortcuts to JSON serializer
Diffstat (limited to 'libbutl/json/serializer.hxx')
-rw-r--r--libbutl/json/serializer.hxx22
1 files changed, 22 insertions, 0 deletions
diff --git a/libbutl/json/serializer.hxx b/libbutl/json/serializer.hxx
index b52bf65..c143dab 100644
--- a/libbutl/json/serializer.hxx
+++ b/libbutl/json/serializer.hxx
@@ -167,10 +167,21 @@ namespace butl
// Begin/end an object.
//
+ // The member_begin_object() version is a shortcut for:
+ //
+ // member_name (name, check);
+ // begin_object ();
+ //
void
begin_object ();
void
+ member_begin_object (const char*, bool check = true);
+
+ void
+ member_begin_object (const std::string&, bool check = true);
+
+ void
end_object ();
// Serialize an object member (name and value).
@@ -199,10 +210,21 @@ namespace butl
// Begin/end an array.
//
+ // The member_begin_array() version is a shortcut for:
+ //
+ // member_name (name, check);
+ // begin_array ();
+ //
void
begin_array ();
void
+ member_begin_array (const char*, bool check = true);
+
+ void
+ member_begin_array (const std::string&, bool check = true);
+
+ void
end_array ();
// Serialize a string.