|
pjson 1.0.0
A small, owning JSON value for C++11
|
Event sink for non-owning SAX parsing. Return false from any callback to cancel parsing; public parseSax* APIs return false for cancellation or thrown exceptions and populate ParseError when one is supplied. More...
#include <pjson.h>
Public Member Functions | |
| virtual | ~SaxHandler () |
Public API member ~SaxHandler; see the API overview for its contract. / Receives a JSON null value; return false to cancel parsing. | |
| virtual bool | onNull () |
Public API member onNull; see the API overview for its contract. / Receives a JSON boolean value; return false to cancel parsing. | |
| virtual bool | onBool (bool aValue) |
Public API member onBool; see the API overview for its contract. / Receives an integer-valued JSON number; return false to cancel parsing. | |
| virtual bool | onInt (int64_t aValue) |
Public API member onInt; see the API overview for its contract. / Receives a floating-point JSON number; return false to cancel parsing. | |
| virtual bool | onDouble (double aValue) |
Public API member onDouble; see the API overview for its contract. / Receives borrowed decoded string bytes; return false to cancel parsing. | |
| virtual bool | onString (const std::string &aValue) |
Public API member onString; see the API overview for its contract. / Marks the beginning of an array; return false to cancel parsing. | |
| virtual bool | onStartArray () |
Public API member onStartArray; see the API overview for its contract. / Marks the end of an array; return false to cancel parsing. | |
| virtual bool | onEndArray () |
Public API member onEndArray; see the API overview for its contract. / Marks the beginning of an object; return false to cancel parsing. | |
| virtual bool | onStartObject () |
Public API member onStartObject; see the API overview for its contract. / Receives a borrowed decoded object key; return false to cancel parsing. | |
| virtual bool | onKey (const std::string &aKey) |
Public API member onKey; see the API overview for its contract. / Marks the end of an object; return false to cancel parsing. | |
| virtual bool | onEndObject () |
Public API member onEndObject; see the API overview for its contract. | |
Event sink for non-owning SAX parsing. Return false from any callback to cancel parsing; public parseSax* APIs return false for cancellation or thrown exceptions and populate ParseError when one is supplied.
Callbacks are delivered in source order. Duplicate-key policy still applies: RejectDuplicateKeys fails on the duplicate key, KeepFirstDuplicate suppresses later duplicate-value subtrees, and KeepLastDuplicate accepts duplicates while still reporting both occurrences because a streaming SAX walk cannot retract prior events. String and key references are borrowed and remain valid only for the duration of their callback. The handler itself need only outlive the parseSax* call. Default callbacks accept the event and do nothing.
|
virtual |
Public API member ~SaxHandler; see the API overview for its contract. / Receives a JSON null value; return false to cancel parsing.
Public API member onBool; see the API overview for its contract. / Receives an integer-valued JSON number; return false to cancel parsing.
Public API member onDouble; see the API overview for its contract. / Receives borrowed decoded string bytes; return false to cancel parsing.
Public API member onEndArray; see the API overview for its contract. / Marks the beginning of an object; return false to cancel parsing.
Public API member onEndObject; see the API overview for its contract.
Public API member onInt; see the API overview for its contract. / Receives a floating-point JSON number; return false to cancel parsing.
Public API member onKey; see the API overview for its contract. / Marks the end of an object; return false to cancel parsing.
Public API member onNull; see the API overview for its contract. / Receives a JSON boolean value; return false to cancel parsing.
Public API member onStartArray; see the API overview for its contract. / Marks the end of an array; return false to cancel parsing.
Public API member onStartObject; see the API overview for its contract. / Receives a borrowed decoded object key; return false to cancel parsing.
Public API member onString; see the API overview for its contract. / Marks the beginning of an array; return false to cancel parsing.