File tree 1 file changed +16
-0
lines changed
1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -169,6 +169,22 @@ class json_stream_objectt : public json_streamt
169
169
return it->second ;
170
170
}
171
171
172
+ // / Push back a JSON element into the current object stream.
173
+ // / Note the pushed key won't be available via operator[], as it has been
174
+ // / output already.
175
+ // / Provided for compatibility with `jsont`.
176
+ // / \param json: a non-streaming JSON element
177
+ void push_back (const std::string &key, const jsont &json)
178
+ {
179
+ PRECONDITION (open );
180
+ // To ensure consistency of the output, we flush and
181
+ // close the current child stream before printing the given element.
182
+ output_child_stream ();
183
+ output_delimiter ();
184
+ jsont::output_key (out, key);
185
+ json.output_rec (out, indent + 1 );
186
+ }
187
+
172
188
json_stream_objectt &push_back_stream_object (const std::string &key);
173
189
json_stream_arrayt &push_back_stream_array (const std::string &key);
174
190
You can’t perform that action at this time.
0 commit comments