21 out << std::string((
indent + 1) * 2,
' ');
39 object[
"array_element"].output_rec(
out,
indent + 1);
52 out <<
'\n' << std::string(
indent * 2,
' ');
135 for(
const auto &obj :
object)
153 out <<
'\n' << std::string(
indent * 2,
' ');
Provides methods for streaming JSON arrays.
json_stream_objectt & push_back_stream_object()
Add a JSON object child stream.
json_stream_arrayt & push_back_stream_array()
Add a JSON array child stream.
void output_finalizer() override
Output the finalizing character for a JSON array.
void output_child_stream() override
Output the non-streaming JSON objects and closes the current child stream.
json_stream_arrayt(std::ostream &out, unsigned indent=0)
Construct a new JSON array stream.
Provides methods for streaming JSON objects.
void output_finalizer() override
Output the finalizing character for a JSON object.
json_stream_objectt & push_back_stream_object(const std::string &key)
Add a JSON object stream for a specific key.
void output_child_stream() override
Output non-streaming JSON properties and flushes and closes the child stream.
json_stream_arrayt & push_back_stream_array(const std::string &key)
Add a JSON array stream for a specific key.
json_stream_objectt(std::ostream &out, unsigned indent=0)
Constructor for json_stream_objectt.
json_stream_arrayt & create_child_stream_array()
Create a new JSON array child stream.
json_stream_objectt & create_child_stream_object()
Create a new JSON object child stream.
bool first
Is the current element the first element in the object or array?
bool open
Denotes whether the current stream is open or has been invalidated.
void output_delimiter()
Outputs the delimiter between JSON elements.
json_streamt(std::ostream &_out, unsigned _indent)
Constructor to be used by derived classes.
std::unique_ptr< json_streamt > child_stream
The current child stream.
static void output_key(std::ostream &out, const std::string &key)
static void output_object(std::ostream &out, const objectt &object, unsigned indent)
Basic handling of the printing of a JSON object.
#define PRECONDITION(CONDITION)