...one of the most highly
regarded and expertly designed C++ library projects in the
world.
— Herb Sutter and Andrei
Alexandrescu, C++
Coding Standards
Parse some of an input string as JSON, incrementally.
std::size_t write_some( bool more, char const* data, std::size_t size, std::error_code& ec);
This function parses the JSON in the specified buffer, calling the handler to emit each SAX parsing event. The parse proceeds from the current state, which is at the beginning of a new JSON or in the middle of the current JSON if any characters were already parsed.
The characters in the buffer are processed starting from the beginning, until one of the following conditions is met:
The supplied buffer does not need to contain the entire JSON. Subsequent
calls can provide more serialized data, allowing JSON to be processed
incrementally. The end of the serialized JSON can be indicated by passing
more =
false
.
Linear in size
.
Basic guarantee. Calls to the handler may throw. Upon error or exception,
subsequent calls will fail until reset
is called to parse a new
JSON.
The number of characters successfully parsed, which may be smaller than
size
.
Name |
Description |
---|---|
|
|
|
A pointer to a buffer of |
|
The number of characters pointed to by |
|
Set to the error, if any occurred. |