|
JSON Voorhees
Killer JSON for C++
|
Configuration for various parsing options. More...
#include <jsonv/parse.hpp>
Classes | |
| struct | k |
Public Types | |
| enum class | encoding { utf8 , utf8_strict } |
| The encoding format for strings. More... | |
| using | size_type = value::size_type |
Public Member Functions | |
| parse_options () | |
| Create an instance with the default options. | |
| encoding | string_encoding () const |
| parse_options & | string_encoding (encoding) |
| std::optional< size_type > | max_structure_depth () const |
| parse_options & | max_structure_depth (std::optional< size_type > depth) |
| bool | require_document () const |
| parse_options & | require_document (bool) |
| bool | complete_parse () const |
| parse_options & | complete_parse (bool) |
| bool | comments () const |
| parse_options & | comments (bool) |
Static Public Member Functions | |
| static parse_options | create_default () |
| Create a parser with the default options – this is the same result as the default constructor, but might be helpful if you like to be more explicit. | |
| static parse_options | create_strict () |
| Create a strict parser. | |
Configuration for various parsing options.
All parse functions should take in a parse_options as a paramter and should respect your settings.
The encoding format for strings.
|
inline |
|
inline |
|
static |
Create a strict parser.
In general, these options are meant to fail on anything that is not a 100% valid JSON document. More specifically:
|
inline |
The maximum allowed nesting depth of any structure in the JSON document. The JSON specification technically limits the depth to 20, but very few implementations actually conform to this, so it is fairly dangerous to set this value. By default, the value is nullopt, which means implementations should limit structure depth to k::max_structure_depth. Setting depth to a value above k::max_structure_depth is will cause std::invalid_argument to be thrown from parse functions.
|
inline |
|
inline |
The output encoding for multi-byte characters in strings. The default value is encoding::utf8.