Template Class binary_reader

Class Documentation

template<typename BasicJsonType, typename SAX = json_sax_dom_parser<BasicJsonType>>
class binary_reader

deserialization of CBOR, MessagePack, and UBJSON values

Public Functions

inline explicit binary_reader(input_adapter_t adapter)

create a binary reader

Parameters:

adapter[in] input adapter to read from

binary_reader(const binary_reader&) = delete
binary_reader(binary_reader&&) = default
binary_reader &operator=(const binary_reader&) = delete
binary_reader &operator=(binary_reader&&) = default
~binary_reader() = default
inline bool sax_parse(const input_format_t format, json_sax_t *sax_, const bool strict = true)
Parameters:
  • format[in] the binary format to parse

  • sax_[in] a SAX event processor

  • strict[in] whether to expect the input to be consumed completed

Returns:

inline explicit binary_reader(InputAdapterType &&adapter)

create a binary reader

Parameters:

adapter[in] input adapter to read from

binary_reader(const binary_reader&) = delete
binary_reader(binary_reader&&) = default
binary_reader &operator=(const binary_reader&) = delete
binary_reader &operator=(binary_reader&&) = default
~binary_reader() = default
inline bool 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)
Parameters:
  • format[in] the binary format to parse

  • sax_[in] a SAX event processor

  • strict[in] whether to expect the input to be consumed completed

  • tag_handler[in] how to treat CBOR tags

Returns:

Public Static Functions

static inline constexpr bool little_endianess(int num = 1) noexcept

determine system byte order

Returns:

true if and only if system’s byte order is little endian