nlib
nn::nlib::msgpack::JsonStreamParserSettings Struct Reference

Data structure used to store the JsonStreamParser settings parameters. More...

#include "nn/nlib/msgpack/JsonStreamParser.h"

Public Member Functions

constexpr JsonStreamParserSettings () noexcept
 Instantiates the object with default parameters (default constructor). Sets each data member to the default value.
 

Public Attributes

size_t max_array_size
 Specifies the maximum array size. The default is 8192 and the minimum value is 16.
 
size_t max_map_size
 Specifies the maximum associative array size. The default is 256 and the minimum value is 16.
 
size_t token_buffer_size
 Specifies the size of the buffer to store tokens. The default is 2048 and the minimum value is 512. More...
 
size_t max_depth
 Specifies the maximum value for the depth of array or associative array. The default is 7.
 
Format format
 Decides how formats are determined when parsing. The default is kFormatAdaptive. More...
 
bool strict
 If a value other than 0 is set, a stricter error check is performed. The default is 0. More...
 

Detailed Description

Data structure used to store the JsonStreamParser settings parameters.

Definition at line 34 of file JsonStreamParser.h.

Member Data Documentation

◆ format

nn::nlib::msgpack::JsonStreamParserSettings::format

Decides how formats are determined when parsing. The default is kFormatAdaptive.

Description
Value Description
kFormatAdaptive Parses based on the first read character.
kFormatJson Parses as JSON.
kFormatMsgpack Parses as msgpack.

Definition at line 47 of file JsonStreamParser.h.

◆ strict

nn::nlib::msgpack::JsonStreamParserSettings::strict

If a value other than 0 is set, a stricter error check is performed. The default is 0.

Description
If a value other than 0 is set:
  • Parsing JSON results in an error when the root element is not an array or associative array.
  • Parsing msgpack results in an error when the str format family data is not UTF-8.

Definition at line 48 of file JsonStreamParser.h.

◆ token_buffer_size

nn::nlib::msgpack::JsonStreamParserSettings::token_buffer_size

Specifies the size of the buffer to store tokens. The default is 2048 and the minimum value is 512.

Description
If a token with a size larger than the buffer size is obtained, truncation is reported (string) or an error (number or associative array key) is caused. The buffer is allocated when initializing the parser, and will not be expanded.

Definition at line 45 of file JsonStreamParser.h.


The documentation for this struct was generated from the following files: