Decodes a Universal Binary JSON Specification (JSON) data format into a C++ data structure.
#include <jsoncons_ext/ubjson/ubjson.hpp>
template<class T>
T decode_ubjson(const std::vector<uint8_t>& v); // (1)
template<class T>
T decode_ubjson(std::istream>& is); // (2)
(1) Reads a UBJSON bytes buffer into a type T if T is an instantiation of basic_json or if T supports json_type_traits.
(2) Reads a UBJSON binary stream into a type T if T is an instantiation of basic_json or if T supports json_type_traits.
Throws ser_error if parsing fails.
- encode_ubjson encodes a json value to the Universal Binary JSON Specification data format.