serialization to CBOR and MessagePack values More...
#include <json.hpp>
Public Member Functions | |
binary_writer (output_adapter_t< CharType > adapter) | |
create a binary writer More... | |
void | write_bson (const BasicJsonType &j) |
void | write_cbor (const BasicJsonType &j) |
void | write_msgpack (const BasicJsonType &j) |
void | write_ubjson (const BasicJsonType &j, const bool use_count, const bool use_type, const bool add_prefix=true) |
Static Public Member Functions | |
template<typename InputCharType , typename C = CharType, enable_if_t< std::is_signed< C >::value &&std::is_signed< char >::value &&std::is_same< char, typename std::remove_cv< InputCharType >::type >::value > * = nullptr> | |
static constexpr CharType | to_char_type (InputCharType x) noexcept |
template<typename C = CharType, enable_if_t< std::is_signed< C >::value &&std::is_signed< char >::value > * = nullptr> | |
static constexpr CharType | to_char_type (std::uint8_t x) noexcept |
template<typename C = CharType, enable_if_t< std::is_signed< C >::value &&std::is_unsigned< char >::value > * = nullptr> | |
static CharType | to_char_type (std::uint8_t x) noexcept |
template<typename C = CharType, enable_if_t< std::is_unsigned< C >::value > * = nullptr> | |
static constexpr CharType | to_char_type (std::uint8_t x) noexcept |
serialization to CBOR and MessagePack values
|
explicit |
create a binary writer
[in] | adapter | output adapter to write to |
|
staticconstexprnoexcept |
|
staticconstexprnoexcept |
|
staticnoexcept |
|
staticconstexprnoexcept |
void nlohmann::detail::binary_writer< BasicJsonType, CharType >::write_bson | ( | const BasicJsonType & | j | ) |
[in] | j | JSON value to serialize |
References nlohmann::detail::type_error::create(), and nlohmann::detail::object.
void nlohmann::detail::binary_writer< BasicJsonType, CharType >::write_cbor | ( | const BasicJsonType & | j | ) |
[in] | j | JSON value to serialize |
References nlohmann::detail::array, nlohmann::detail::binary, nlohmann::detail::boolean, nlohmann::detail::cbor, nlohmann::detail::null, nlohmann::detail::number_float, nlohmann::detail::number_integer, nlohmann::detail::number_unsigned, nlohmann::detail::object, nlohmann::detail::string, nlohmann::detail::binary_writer< BasicJsonType, CharType >::to_char_type(), and nlohmann::detail::binary_writer< BasicJsonType, CharType >::write_cbor().
Referenced by nlohmann::basic_json< ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType, JSONSerializer, BinaryType >::to_cbor(), and nlohmann::detail::binary_writer< BasicJsonType, CharType >::write_cbor().
void nlohmann::detail::binary_writer< BasicJsonType, CharType >::write_msgpack | ( | const BasicJsonType & | j | ) |
[in] | j | JSON value to serialize |
References nlohmann::detail::array, nlohmann::detail::binary, nlohmann::detail::boolean, nlohmann::detail::msgpack, nlohmann::detail::null, nlohmann::detail::number_float, nlohmann::detail::number_integer, nlohmann::detail::number_unsigned, nlohmann::detail::object, nlohmann::detail::string, nlohmann::detail::binary_writer< BasicJsonType, CharType >::to_char_type(), and nlohmann::detail::binary_writer< BasicJsonType, CharType >::write_msgpack().
Referenced by nlohmann::basic_json< ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType, JSONSerializer, BinaryType >::to_msgpack(), and nlohmann::detail::binary_writer< BasicJsonType, CharType >::write_msgpack().
void nlohmann::detail::binary_writer< BasicJsonType, CharType >::write_ubjson | ( | const BasicJsonType & | j, |
const bool | use_count, | ||
const bool | use_type, | ||
const bool | add_prefix = true |
||
) |
[in] | j | JSON value to serialize |
[in] | use_count | whether to use '#' prefixes (optimized format) |
[in] | use_type | whether to use '$' prefixes (optimized format) |
[in] | add_prefix | whether prefixes need to be used for this value |
References nlohmann::detail::array, nlohmann::detail::binary, nlohmann::detail::boolean, nlohmann::detail::null, nlohmann::detail::number_float, nlohmann::detail::number_integer, nlohmann::detail::number_unsigned, nlohmann::detail::object, nlohmann::detail::string, nlohmann::detail::binary_writer< BasicJsonType, CharType >::to_char_type(), and nlohmann::detail::binary_writer< BasicJsonType, CharType >::write_ubjson().
Referenced by nlohmann::basic_json< ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType, JSONSerializer, BinaryType >::to_ubjson(), and nlohmann::detail::binary_writer< BasicJsonType, CharType >::write_ubjson().