nlohmann::basic_json::sax_parse

generate SAX events

Synopsis

Declared in <nlohmann/json.hpp>

template<
    typename InputType,
    typename SAX>
static
bool
sax_parse(
    InputType&& i,
    SAX* sax,
    input_format_t format = input_format_t::json,
    bool const strict = true,
    bool const ignore_comments = false,
    bool const ignore_trailing_commas = false);

Return Value

whether the generation of SAX events completed successfully

Parameters

NameDescription
iinput to read the JSON value from
saxSAX event consumer
formatthe format to parse the input as
strictwhether to expect the input to be consumed until EOF
ignore_commentswhether comments should be ignored and treated like whitespace (true) or yield a parse error (false); only applies to the json format
ignore_trailing_commaswhether trailing commas in arrays and objects should be ignored (true) or yield a parse error (false); only applies to the json format