Renderd7-nightly
v0.7.0
|
SAX implementation to create a JSON value from SAX events. More...
#include <json.hpp>
Public Member Functions | |
json_sax_dom_parser (BasicJsonType &r, const bool allow_exceptions_=true) | |
Private Member Functions | |
template<typename Value > | |
JSON_HEDLEY_RETURNS_NON_NULL BasicJsonType * | handle_value (Value &&v) |
Private Attributes | |
BasicJsonType & | root |
the parsed JSON value | |
std::vector< BasicJsonType * > | ref_stack {} |
stack to model hierarchy of values | |
BasicJsonType * | object_element = nullptr |
helper to hold the reference for the next object element | |
bool | errored = false |
whether a syntax error occurred | |
const bool | allow_exceptions = true |
whether to throw exceptions in case of errors | |
SAX implementation to create a JSON value from SAX events.
This class implements the json_sax interface and processes the SAX events to create a JSON value which makes it basically a DOM parser. The structure or hierarchy of the JSON value is managed by the stack ref_stack
which contains a pointer to the respective array or object for each recursion depth.
After successful parsing, the value that is passed by reference to the constructor contains the parsed value.
BasicJsonType | the JSON type |
|
inlineexplicit |
[in,out] | r | reference to a JSON value that is manipulated while parsing |
[in] | allow_exceptions_ | whether parse errors yield exceptions |
|
inlineprivate |