nlohmann::detail::binary_reader
json.hpp
typename BasicJsonType
typename InputAdapterType
typename SAX json_sax_dom_parser<BasicJsonType>
typename BasicJsonType::number_integer_t using nlohmann::detail::binary_reader< BasicJsonType, InputAdapterType, SAX >::number_integer_t = typename BasicJsonType::number_integer_t number_integer_t
typename BasicJsonType::number_unsigned_t using nlohmann::detail::binary_reader< BasicJsonType, InputAdapterType, SAX >::number_unsigned_t = typename BasicJsonType::number_unsigned_t number_unsigned_t
typename BasicJsonType::number_float_t using nlohmann::detail::binary_reader< BasicJsonType, InputAdapterType, SAX >::number_float_t = typename BasicJsonType::number_float_t number_float_t
typename BasicJsonType::string_t using nlohmann::detail::binary_reader< BasicJsonType, InputAdapterType, SAX >::string_t = typename BasicJsonType::string_t string_t
typename BasicJsonType::binary_t using nlohmann::detail::binary_reader< BasicJsonType, InputAdapterType, SAX >::binary_t = typename BasicJsonType::binary_t binary_t
SAX using nlohmann::detail::binary_reader< BasicJsonType, InputAdapterType, SAX >::json_sax_t = SAX json_sax_t
typename InputAdapterType::char_type using nlohmann::detail::binary_reader< BasicJsonType, InputAdapterType, SAX >::char_type = typename InputAdapterType::char_type char_type
typename std::char_traits< char_type >::int_type using nlohmann::detail::binary_reader< BasicJsonType, InputAdapterType, SAX >::char_int_type = typename std::char_traits<char_type>::int_type char_int_type
InputAdapterType InputAdapterType nlohmann::detail::binary_reader< BasicJsonType, InputAdapterType, SAX >::ia ia

input adapter

char_int_type char_int_type nlohmann::detail::binary_reader< BasicJsonType, InputAdapterType, SAX >::current current = std::char_traits<char_type>::eof()

the current character

std::size_t std::size_t nlohmann::detail::binary_reader< BasicJsonType, InputAdapterType, SAX >::chars_read chars_read = 0

the number of characters read

const bool const bool nlohmann::detail::binary_reader< BasicJsonType, InputAdapterType, SAX >::is_little_endian is_little_endian = little_endianess()

whether we can assume little endianess

json_sax_t * json_sax_t* nlohmann::detail::binary_reader< BasicJsonType, InputAdapterType, SAX >::sax sax = nullptr

the SAX parser

nlohmann::detail::binary_reader< BasicJsonType, InputAdapterType, SAX >::binary_reader
(InputAdapterType &&adapter) noexcept
binary_reader
InputAdapterType && adapter

create a binary reader

adapter

input adapter to read from

JSON_HEDLEY_NON_NULL
nlohmann::detail::void
nlohmann::detail::binary_reader< BasicJsonType, InputAdapterType, SAX >::binary_reader
(const binary_reader &)=delete
binary_reader
const binary_reader &
nlohmann::detail::binary_reader< BasicJsonType, InputAdapterType, SAX >::binary_reader
(binary_reader &&)=default
binary_reader
binary_reader &&
binary_reader & binary_reader& nlohmann::detail::binary_reader< BasicJsonType, InputAdapterType, SAX >::operator= (const binary_reader &)=delete operator= const binary_reader &
binary_reader & binary_reader& nlohmann::detail::binary_reader< BasicJsonType, InputAdapterType, SAX >::operator= (binary_reader &&)=default operator= binary_reader &&
nlohmann::detail::binary_reader< BasicJsonType, InputAdapterType, SAX >::~binary_reader
()=default
~binary_reader
bool bool nlohmann::detail::binary_reader< BasicJsonType, InputAdapterType, SAX >::sax_parse (const input_format_t format, json_sax_t *sax_, const bool strict=true, const cbor_tag_handler_t tag_handler=cbor_tag_handler_t::error) sax_parse const input_format_t format json_sax_t * sax_ const bool strict true const cbor_tag_handler_t tag_handler cbor_tag_handler_t::error

format

the binary format to parse

sax_

a SAX event processor

strict

whether to expect the input to be consumed completed

tag_handler

how to treat CBOR tags

whether parsing was successful

nlohmann::detail::bson
nlohmann::detail::cbor
nlohmann::detail::parse_error::create
JSON_ASSERT
JSON_HEDLEY_UNLIKELY
nlohmann::detail::msgpack
nlohmann::detail::strict
nlohmann::detail::ubjson
bool bool nlohmann::detail::binary_reader< BasicJsonType, InputAdapterType, SAX >::parse_bson_internal () parse_bson_internal

Reads in a BSON-object and passes it to the SAX-parser.

whether a valid BSON-value was passed to the SAX parser

nlohmann::detail::bson
JSON_HEDLEY_UNLIKELY
bool bool nlohmann::detail::binary_reader< BasicJsonType, InputAdapterType, SAX >::get_bson_cstr (string_t &result) get_bson_cstr string_t & result

Parses a C-style string from the BSON input.

result

A reference to the string variable where the read string is to be stored.

`true` if the -byte indicating the end of the string was encountered before the EOF; false` indicates an unexpected EOF.

nlohmann::detail::bson
JSON_HEDLEY_UNLIKELY
typename NumberType
bool bool nlohmann::detail::binary_reader< BasicJsonType, InputAdapterType, SAX >::get_bson_string (const NumberType len, string_t &result) get_bson_string const NumberType len string_t & result

Parses a zero-terminated string of length len from the BSON input.

len

The length (including the zero-byte at the end) of the string to be read.

result

A reference to the string variable where the read string is to be stored.

NumberType

The type of the length len

len >= 1

`true` if the string was successfully parsed

nlohmann::detail::bson
nlohmann::detail::parse_error::create
JSON_HEDLEY_UNLIKELY
nlohmann::to_string
typename NumberType
bool bool nlohmann::detail::binary_reader< BasicJsonType, InputAdapterType, SAX >::get_bson_binary (const NumberType len, binary_t &result) get_bson_binary const NumberType len binary_t & result

Parses a byte array input of length len from the BSON input.

len

The length of the byte array to be read.

result

A reference to the binary variable where the read array is to be stored.

NumberType

The type of the length len

len >= 0

`true` if the byte array was successfully parsed

nlohmann::detail::bson
nlohmann::detail::parse_error::create
JSON_HEDLEY_UNLIKELY
nlohmann::to_string
bool bool nlohmann::detail::binary_reader< BasicJsonType, InputAdapterType, SAX >::parse_bson_element_internal (const char_int_type element_type, const std::size_t element_type_parse_position) parse_bson_element_internal const char_int_type element_type const std::size_t element_type_parse_position

Read a BSON document element of the given element_type.

element_type

The BSON element type, c.f. http://bsonspec.org/spec.html

element_type_parse_position

The position in the input stream, where the `element_type` was read.

Not all BSON element types are supported yet. An unsupported element_type will give rise to a parse_error.114: Unsupported BSON record type 0x...

whether a valid BSON-object/array was passed to the SAX parser

nlohmann::detail::bson
nlohmann::detail::parse_error::create
nlohmann::detail::string
nlohmann::detail::value
bool bool nlohmann::detail::binary_reader< BasicJsonType, InputAdapterType, SAX >::parse_bson_element_list (const bool is_array) parse_bson_element_list const bool is_array

Read a BSON element list (as specified in the BSON-spec)

The same binary layout is used for objects and arrays, hence it must be indicated with the argument is_array which one is expected (true > array, false > object).

is_array

Determines if the element list being read is to be treated as an object (is_array == false), or as an array (is_array == true).

whether a valid BSON-object/array was passed to the SAX parser

nlohmann::detail::bson
JSON_HEDLEY_UNLIKELY
nlohmann::detail::key
bool bool nlohmann::detail::binary_reader< BasicJsonType, InputAdapterType, SAX >::parse_bson_array () parse_bson_array

Reads an array from the BSON input and passes it to the SAX-parser.

whether a valid BSON-array was passed to the SAX parser

nlohmann::detail::bson
JSON_HEDLEY_UNLIKELY
bool bool nlohmann::detail::binary_reader< BasicJsonType, InputAdapterType, SAX >::parse_cbor_internal (const bool get_char, const cbor_tag_handler_t tag_handler) parse_cbor_internal const bool get_char const cbor_tag_handler_t tag_handler

get_char

whether a new character should be retrieved from the input (true) or whether the last read character should be considered instead (false)

tag_handler

how CBOR tags should be treated

whether a valid CBOR value was passed to the SAX parser

nlohmann::detail::cbor
nlohmann::detail::parse_error::create
nlohmann::detail::error
nlohmann::detail::ignore
JSON_ASSERT
JSON_HEDLEY_UNLIKELY
bool bool nlohmann::detail::binary_reader< BasicJsonType, InputAdapterType, SAX >::get_cbor_string (string_t &result) get_cbor_string string_t & result

reads a CBOR string

This function first reads starting bytes to determine the expected string length and then copies this number of bytes into a string. Additionally, CBOR's strings with indefinite lengths are supported.

result

created string

whether string creation completed

nlohmann::detail::cbor
nlohmann::detail::parse_error::create
JSON_HEDLEY_UNLIKELY
bool bool nlohmann::detail::binary_reader< BasicJsonType, InputAdapterType, SAX >::get_cbor_binary (binary_t &result) get_cbor_binary binary_t & result

reads a CBOR byte array

This function first reads starting bytes to determine the expected byte array length and then copies this number of bytes into the byte array. Additionally, CBOR's byte arrays with indefinite lengths are supported.

result

created byte array

whether byte array creation completed

nlohmann::detail::cbor
nlohmann::detail::parse_error::create
JSON_HEDLEY_UNLIKELY
bool bool nlohmann::detail::binary_reader< BasicJsonType, InputAdapterType, SAX >::get_cbor_array (const std::size_t len, const cbor_tag_handler_t tag_handler) get_cbor_array const std::size_t len const cbor_tag_handler_t tag_handler

len

the length of the array or std::size_t(-1) for an array of indefinite size

tag_handler

how CBOR tags should be treated

whether array creation completed

JSON_HEDLEY_UNLIKELY
bool bool nlohmann::detail::binary_reader< BasicJsonType, InputAdapterType, SAX >::get_cbor_object (const std::size_t len, const cbor_tag_handler_t tag_handler) get_cbor_object const std::size_t len const cbor_tag_handler_t tag_handler

len

the length of the object or std::size_t(-1) for an object of indefinite size

tag_handler

how CBOR tags should be treated

whether object creation completed

JSON_HEDLEY_UNLIKELY
nlohmann::detail::key
bool bool nlohmann::detail::binary_reader< BasicJsonType, InputAdapterType, SAX >::parse_msgpack_internal () parse_msgpack_internal

whether a valid MessagePack value was passed to the SAX parser

nlohmann::detail::parse_error::create
nlohmann::detail::msgpack
bool bool nlohmann::detail::binary_reader< BasicJsonType, InputAdapterType, SAX >::get_msgpack_string (string_t &result) get_msgpack_string string_t & result

reads a MessagePack string

This function first reads starting bytes to determine the expected string length and then copies this number of bytes into a string.

result

created string

whether string creation completed

nlohmann::detail::parse_error::create
JSON_HEDLEY_UNLIKELY
nlohmann::detail::msgpack
bool bool nlohmann::detail::binary_reader< BasicJsonType, InputAdapterType, SAX >::get_msgpack_binary (binary_t &result) get_msgpack_binary binary_t & result

reads a MessagePack byte array

This function first reads starting bytes to determine the expected byte array length and then copies this number of bytes into a byte array.

result

created byte array

whether byte array creation completed

nlohmann::detail::msgpack
bool bool nlohmann::detail::binary_reader< BasicJsonType, InputAdapterType, SAX >::get_msgpack_array (const std::size_t len) get_msgpack_array const std::size_t len

len

the length of the array

whether array creation completed

JSON_HEDLEY_UNLIKELY
bool bool nlohmann::detail::binary_reader< BasicJsonType, InputAdapterType, SAX >::get_msgpack_object (const std::size_t len) get_msgpack_object const std::size_t len

len

the length of the object

whether object creation completed

JSON_HEDLEY_UNLIKELY
nlohmann::detail::key
bool bool nlohmann::detail::binary_reader< BasicJsonType, InputAdapterType, SAX >::parse_ubjson_internal (const bool get_char=true) parse_ubjson_internal const bool get_char true

get_char

whether a new character should be retrieved from the input (true, default) or whether the last read character should be considered instead

whether a valid UBJSON value was passed to the SAX parser

bool bool nlohmann::detail::binary_reader< BasicJsonType, InputAdapterType, SAX >::get_ubjson_string (string_t &result, const bool get_char=true) get_ubjson_string string_t & result const bool get_char true

reads a UBJSON string

This function is either called after reading the 'S' byte explicitly indicating a string, or in case of an object key where the 'S' byte can be left out.

result

created string

get_char

whether a new character should be retrieved from the input (true, default) or whether the last read character should be considered instead

whether string creation completed

nlohmann::detail::parse_error::create
JSON_HEDLEY_UNLIKELY
nlohmann::detail::ubjson
bool bool nlohmann::detail::binary_reader< BasicJsonType, InputAdapterType, SAX >::get_ubjson_size_value (std::size_t &result) get_ubjson_size_value std::size_t & result

result

determined size

whether size determination completed

nlohmann::detail::parse_error::create
JSON_HEDLEY_UNLIKELY
nlohmann::detail::ubjson
bool bool nlohmann::detail::binary_reader< BasicJsonType, InputAdapterType, SAX >::get_ubjson_size_type (std::pair< std::size_t, char_int_type > &result) get_ubjson_size_type std::pair< std::size_t, char_int_type > & result

determine the type and size for a container

In the optimized UBJSON format, a type and a size can be provided to allow for a more compact representation.

result

pair of the size and the type

whether pair creation completed

nlohmann::detail::parse_error::create
JSON_HEDLEY_UNLIKELY
nlohmann::detail::ubjson
bool bool nlohmann::detail::binary_reader< BasicJsonType, InputAdapterType, SAX >::get_ubjson_value (const char_int_type prefix) get_ubjson_value const char_int_type prefix

prefix

the previously read or set type prefix

whether value creation completed

nlohmann::detail::parse_error::create
JSON_HEDLEY_UNLIKELY
nlohmann::detail::ubjson
bool bool nlohmann::detail::binary_reader< BasicJsonType, InputAdapterType, SAX >::get_ubjson_array () get_ubjson_array

whether array creation completed

JSON_HEDLEY_UNLIKELY
bool bool nlohmann::detail::binary_reader< BasicJsonType, InputAdapterType, SAX >::get_ubjson_object () get_ubjson_object

whether object creation completed

JSON_HEDLEY_UNLIKELY
nlohmann::detail::key
bool bool nlohmann::detail::binary_reader< BasicJsonType, InputAdapterType, SAX >::get_ubjson_high_precision_number () get_ubjson_high_precision_number nlohmann::detail::parse_error::create nlohmann::detail::input_adapter JSON_HEDLEY_UNLIKELY nlohmann::detail::lexer< BasicJsonType, InputAdapterType >::scan nlohmann::detail::ubjson
char_int_type char_int_type nlohmann::detail::binary_reader< BasicJsonType, InputAdapterType, SAX >::get () get

get next character from the input

This function provides the interface to the used input adapter. It does not throw in case the input reached EOF, but returns a -'ve valued `std::char_traits<char_type>::eof()` in that case.

character read from the input

char_int_type char_int_type nlohmann::detail::binary_reader< BasicJsonType, InputAdapterType, SAX >::get_ignore_noop () get_ignore_noop

character read from the input after ignoring all 'N' entries

typename NumberType
bool InputIsLittleEndian InputIsLittleEndian false
bool bool nlohmann::detail::binary_reader< BasicJsonType, InputAdapterType, SAX >::get_number (const input_format_t format, NumberType &result) get_number const input_format_t format NumberType & result JSON_HEDLEY_UNLIKELY
typename NumberType
bool bool nlohmann::detail::binary_reader< BasicJsonType, InputAdapterType, SAX >::get_string (const input_format_t format, const NumberType len, string_t &result) get_string const input_format_t format const NumberType len string_t & result

create a string by reading characters from the input

NumberType

the type of the number

format

the current format (for diagnostics)

len

number of characters to read

result

string created by reading len bytes

whether string creation completed

We can not reserve len bytes for the result, because len may be too large. Usually, unexpect_eof() detects the end of the input before we run out of string memory.

JSON_HEDLEY_UNLIKELY
typename NumberType
bool bool nlohmann::detail::binary_reader< BasicJsonType, InputAdapterType, SAX >::get_binary (const input_format_t format, const NumberType len, binary_t &result) get_binary const input_format_t format const NumberType len binary_t & result

create a byte array by reading bytes from the input

NumberType

the type of the number

format

the current format (for diagnostics)

len

number of bytes to read

result

byte array created by reading len bytes

whether byte array creation completed

We can not reserve len bytes for the result, because len may be too large. Usually, unexpect_eof() detects the end of the input before we run out of memory.

JSON_HEDLEY_NON_NULL
JSON_HEDLEY_UNLIKELY
bool bool nlohmann::detail::binary_reader< BasicJsonType, InputAdapterType, SAX >::unexpect_eof (const input_format_t format, const char *context) const unexpect_eof const input_format_t format const char * context

format

the current format (for diagnostics)

context

further context information (for diagnostics)

whether the last read character is not EOF

nlohmann::detail::parse_error::create
JSON_HEDLEY_UNLIKELY
std::string std::string nlohmann::detail::binary_reader< BasicJsonType, InputAdapterType, SAX >::get_token_string () const get_token_string

a string representation of the last read byte

nlohmann::detail::string
std::string std::string nlohmann::detail::binary_reader< BasicJsonType, InputAdapterType, SAX >::exception_message (const input_format_t format, const std::string &detail, const std::string &context) const exception_message const input_format_t format const std::string & detail const std::string & context

format

the current format

detail

a detailed error message

context

further context information

a message string to use in the parse_error exceptions

nlohmann::detail::bson
nlohmann::detail::cbor
JSON_ASSERT
nlohmann::detail::msgpack
nlohmann::detail::string
nlohmann::detail::ubjson

deserialization of CBOR, MessagePack, and UBJSON values

size_t
json_sax_t *
nlohmann::detail::binary_reader< BasicJsonType, InputAdapterType, SAX >
-ia
-sax
-current
-is_little_endian
-chars_read
int_type
InputAdapterType
bool
- nlohmann::detail::binary_reader
  binary_reader
- nlohmann::detail::binary_reader
  binary_reader
- nlohmann::detail::binary_reader
  binary_reader
- nlohmann::detail::binary_reader
  binary_t
- nlohmann::detail::binary_reader
  char_int_type
- nlohmann::detail::binary_reader
  char_type
- nlohmann::detail::binary_reader
  chars_read
- nlohmann::detail::binary_reader
  current
- nlohmann::detail::binary_reader
  exception_message
- nlohmann::detail::binary_reader
  get
- nlohmann::detail::binary_reader
  get_binary
- nlohmann::detail::binary_reader
  get_bson_binary
- nlohmann::detail::binary_reader
  get_bson_cstr
- nlohmann::detail::binary_reader
  get_bson_string
- nlohmann::detail::binary_reader
  get_cbor_array
- nlohmann::detail::binary_reader
  get_cbor_binary
- nlohmann::detail::binary_reader
  get_cbor_object
- nlohmann::detail::binary_reader
  get_cbor_string
- nlohmann::detail::binary_reader
  get_ignore_noop
- nlohmann::detail::binary_reader
  get_msgpack_array
- nlohmann::detail::binary_reader
  get_msgpack_binary
- nlohmann::detail::binary_reader
  get_msgpack_object
- nlohmann::detail::binary_reader
  get_msgpack_string
- nlohmann::detail::binary_reader
  get_number
- nlohmann::detail::binary_reader
  get_string
- nlohmann::detail::binary_reader
  get_token_string
- nlohmann::detail::binary_reader
  get_ubjson_array
- nlohmann::detail::binary_reader
  get_ubjson_high_precision_number
- nlohmann::detail::binary_reader
  get_ubjson_object
- nlohmann::detail::binary_reader
  get_ubjson_size_type
- nlohmann::detail::binary_reader
  get_ubjson_size_value
- nlohmann::detail::binary_reader
  get_ubjson_string
- nlohmann::detail::binary_reader
  get_ubjson_value
- nlohmann::detail::binary_reader
  ia
- nlohmann::detail::binary_reader
  is_little_endian
- nlohmann::detail::binary_reader
  json_sax_t
- nlohmann::detail::binary_reader
  number_float_t
- nlohmann::detail::binary_reader
  number_integer_t
- nlohmann::detail::binary_reader
  number_unsigned_t
- nlohmann::detail::binary_reader
  operator=
- nlohmann::detail::binary_reader
  operator=
- nlohmann::detail::binary_reader
  parse_bson_array
- nlohmann::detail::binary_reader
  parse_bson_element_internal
- nlohmann::detail::binary_reader
  parse_bson_element_list
- nlohmann::detail::binary_reader
  parse_bson_internal
- nlohmann::detail::binary_reader
  parse_cbor_internal
- nlohmann::detail::binary_reader
  parse_msgpack_internal
- nlohmann::detail::binary_reader
  parse_ubjson_internal
- nlohmann::detail::binary_reader
  sax
- nlohmann::detail::binary_reader
  sax_parse
- nlohmann::detail::binary_reader
  string_t
- nlohmann::detail::binary_reader
  unexpect_eof
- nlohmann::detail::binary_reader
  ~binary_reader