JSON Voorhees
Killer JSON for C++
Loading...
Searching...
No Matches
parse(string_view)

Construct a JSON value from the given input.

jsonv::value out = jsonv::parse(R"( { "a": 1, "b": [ 2, 3, 4 ] } )");
Represents a single JSON value, which can be any one of a potential kind, each behaving slightly diff...
Definition value.hpp:107
Parameters
parse_optionsOptions specific to parsing the input – the indexing of source text into an AST. If unspecified, this is parse_options::create_default().
extract_optionsOptions specific to extraction – transforming the AST into a jsonv::value. If unspecified, this is extract_options::create_default().
Exceptions
parse_errorif the source text is invalid JSON. This is thrown for errors like unterminated strings, arrays, or stray literals. Errors of this category are described as an offset into input.
extract_errorif the AST can not be transformed into a jsonv::value. This is thrown for errors like an object with duplicate keys (note that the default jsonv::formats does not throw for this case).

(string_view)