Template Class binary_reader

Class Documentation

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

deserialization of CBOR, MessagePack, and UBJSON values

Public Functions

inline explicit binary_reader(InputAdapterType &&adapter, const input_format_t format = input_format_t::json) noexcept

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:

whether parsing was successful