Parses a json string providing callbacks for json syntax. More...
#include <generic_json_parser.hpp>
Protected Member Functions | |
generic_json_parser ()=default | |
void | on_parse_object (bool check_for_eos) |
void | on_parse_array (bool check_for_eos) |
void | on_begin_object () |
void | on_object_key (const std::string &) |
void | on_end_object () |
void | on_begin_array () |
void | on_end_array () |
void | on_string (const std::string &) |
void | on_integer (long long) |
void | on_real (double) |
void | on_bool (bool) |
void | on_null () |
void | sync_cursor (const char *cursor) |
Parses a json string providing callbacks for json syntax.
The generic_json_parser parses a json string and provides an interface to get notified with current parsed json structure part (e.g. begin array, read boolean or end object)
T | Type of the class implementing the callbacks |
|
protecteddefault |
Creates a new generic_json_parser for concrete parser h.
h | The concrete parser. |
|
inlineprotected |
Called when begin of json array is detected
|
inlineprotected |
Called when begin of json object is detected
|
inlineprotected |
Called when a json boolean value is detected
val | The boolean json value |
|
inlineprotected |
Called when end of json array is detected
|
inlineprotected |
Called when end of json object is detected
|
inlineprotected |
Called when a integral json value (number) is detected
val | The detected json integral value (number) |
|
inlineprotected |
Called when json null value is detected
|
inlineprotected |
Called when a key string of a key value relation of o json object is detected
key | The detected key |
|
protected |
Start to parse a json array. The check_for_eos flag indicates if at the end of the object an end of string check is done
check_for_eos | True if end of string at end of array |
|
protected |
Start to parse a json object. The check_for_eos flag indicates if at the end of the object an end of string check is done
check_for_eos | True if end of string at end of object |
|
inlineprotected |
Called when a floating point json value (number) is detected
val | The floating point json integral value (number) |
|
inlineprotected |
Called when a json string value is detected
str | The detected json string value |
|
protected |
Syncs the current cursor of the internal json string to the new cursor
cursor | The new cursor position |