nlohmann::detail::binary_writer
json.hpp
typename BasicJsonType
typename CharType
typename BasicJsonType::string_t using nlohmann::detail::binary_writer< BasicJsonType, CharType >::string_t = typename BasicJsonType::string_t string_t
typename BasicJsonType::binary_t using nlohmann::detail::binary_writer< BasicJsonType, CharType >::binary_t = typename BasicJsonType::binary_t binary_t
typename BasicJsonType::number_float_t using nlohmann::detail::binary_writer< BasicJsonType, CharType >::number_float_t = typename BasicJsonType::number_float_t number_float_t
const bool const bool nlohmann::detail::binary_writer< BasicJsonType, CharType >::is_little_endian is_little_endian = little_endianess()

whether we can assume little endianess

output_adapter_t< CharType > output_adapter_t<CharType> nlohmann::detail::binary_writer< BasicJsonType, CharType >::oa oa = nullptr

the output

nlohmann::detail::binary_writer< BasicJsonType, CharType >::binary_writer
(output_adapter_t< CharType > adapter)
binary_writer
output_adapter_t< CharType > adapter

create a binary writer

adapter

output adapter to write to

JSON_ASSERT
void void nlohmann::detail::binary_writer< BasicJsonType, CharType >::write_bson (const BasicJsonType &j) write_bson const BasicJsonType & j

j

JSON value to serialize

j.type() == value_t::object

nlohmann::detail::type_error::create
JSON_THROW
nlohmann::detail::object
nlohmann::detail::string
void void nlohmann::detail::binary_writer< BasicJsonType, CharType >::write_cbor (const BasicJsonType &j) write_cbor const BasicJsonType & j

j

JSON value to serialize

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
void void nlohmann::detail::binary_writer< BasicJsonType, CharType >::write_msgpack (const BasicJsonType &j) write_msgpack const BasicJsonType & j

j

JSON value to serialize

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
void 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) write_ubjson const BasicJsonType & j const bool use_count const bool use_type const bool add_prefix true

j

JSON value to serialize

use_count

whether to use '#' prefixes (optimized format)

use_type

whether to use '$' prefixes (optimized format)

add_prefix

whether prefixes need to be used for this value

nlohmann::detail::array
nlohmann::detail::binary
nlohmann::detail::boolean
JSON_ASSERT
nlohmann::detail::null
nlohmann::detail::number_float
nlohmann::detail::number_integer
nlohmann::detail::number_unsigned
nlohmann::detail::object
nlohmann::detail::string
std::size_t static std::size_t nlohmann::detail::binary_writer< BasicJsonType, CharType >::calc_bson_entry_header_size (const string_t &name, const BasicJsonType &j) calc_bson_entry_header_size const string_t & name const BasicJsonType & j

The size of a BSON document entry header, including the id marker and the entry name size (and its null-terminator).

nlohmann::detail::out_of_range::create
JSON_HEDLEY_UNLIKELY
JSON_THROW
nlohmann::to_string
std::size_t static std::size_t nlohmann::detail::binary_writer< BasicJsonType, CharType >::calc_bson_string_size (const string_t &value) calc_bson_string_size const string_t & value

The size of the BSON-encoded string in value

std::size_t static std::size_t nlohmann::detail::binary_writer< BasicJsonType, CharType >::calc_bson_integer_size (const std::int64_t value) calc_bson_integer_size const std::int64_t value

The size of the BSON-encoded integer value

constexpr std::size_t static constexpr std::size_t nlohmann::detail::binary_writer< BasicJsonType, CharType >::calc_bson_unsigned_size (const std::uint64_t value) noexcept calc_bson_unsigned_size const std::uint64_t value

The size of the BSON-encoded unsigned integer in j

nlohmann::detail::value
std::size_t static std::size_t nlohmann::detail::binary_writer< BasicJsonType, CharType >::calc_bson_array_size (const typename BasicJsonType::array_t &value) calc_bson_array_size const typename BasicJsonType::array_t & value

The size of the BSON-encoded array value

nlohmann::to_string
std::size_t static std::size_t nlohmann::detail::binary_writer< BasicJsonType, CharType >::calc_bson_binary_size (const typename BasicJsonType::binary_t &value) calc_bson_binary_size const typename BasicJsonType::binary_t & value

The size of the BSON-encoded binary array value

std::size_t static std::size_t nlohmann::detail::binary_writer< BasicJsonType, CharType >::calc_bson_element_size (const string_t &name, const BasicJsonType &j) calc_bson_element_size const string_t & name const BasicJsonType & j

Calculates the size necessary to serialize the JSON value j with its name.

The calculated size for the BSON document entry for j with the given name.

nlohmann::detail::array
nlohmann::detail::binary
nlohmann::detail::boolean
JSON_ASSERT
nlohmann::detail::null
nlohmann::detail::number_float
nlohmann::detail::number_integer
nlohmann::detail::number_unsigned
nlohmann::detail::object
nlohmann::detail::string
std::size_t static std::size_t nlohmann::detail::binary_writer< BasicJsonType, CharType >::calc_bson_object_size (const typename BasicJsonType::object_t &value) calc_bson_object_size const typename BasicJsonType::object_t & value

Calculates the size of the BSON serialization of the given JSON-object j.

value

JSON value to serialize

value.type() == value_t::object

constexpr CharType static constexpr CharType nlohmann::detail::binary_writer< BasicJsonType, CharType >::get_cbor_float_prefix (float) get_cbor_float_prefix float
constexpr CharType static constexpr CharType nlohmann::detail::binary_writer< BasicJsonType, CharType >::get_cbor_float_prefix (double) get_cbor_float_prefix double
constexpr CharType static constexpr CharType nlohmann::detail::binary_writer< BasicJsonType, CharType >::get_msgpack_float_prefix (float) get_msgpack_float_prefix float
constexpr CharType static constexpr CharType nlohmann::detail::binary_writer< BasicJsonType, CharType >::get_msgpack_float_prefix (double) get_msgpack_float_prefix double
constexpr CharType static constexpr CharType nlohmann::detail::binary_writer< BasicJsonType, CharType >::get_ubjson_float_prefix (float) get_ubjson_float_prefix float
constexpr CharType static constexpr CharType nlohmann::detail::binary_writer< BasicJsonType, CharType >::get_ubjson_float_prefix (double) get_ubjson_float_prefix double
void void nlohmann::detail::binary_writer< BasicJsonType, CharType >::write_bson_entry_header (const string_t &name, const std::uint8_t element_type) write_bson_entry_header const string_t & name const std::uint8_t element_type

Writes the given element_type and name to the output adapter.

void void nlohmann::detail::binary_writer< BasicJsonType, CharType >::write_bson_boolean (const string_t &name, const bool value) write_bson_boolean const string_t & name const bool value

Writes a BSON element with key name and boolean value value.

void void nlohmann::detail::binary_writer< BasicJsonType, CharType >::write_bson_double (const string_t &name, const double value) write_bson_double const string_t & name const double value

Writes a BSON element with key name and double value value.

nlohmann::detail::value
void void nlohmann::detail::binary_writer< BasicJsonType, CharType >::write_bson_string (const string_t &name, const string_t &value) write_bson_string const string_t & name const string_t & value

Writes a BSON element with key name and string value value.

void void nlohmann::detail::binary_writer< BasicJsonType, CharType >::write_bson_null (const string_t &name) write_bson_null const string_t & name

Writes a BSON element with key name and null value.

void void nlohmann::detail::binary_writer< BasicJsonType, CharType >::write_bson_integer (const string_t &name, const std::int64_t value) write_bson_integer const string_t & name const std::int64_t value

Writes a BSON element with key name and integer value.

nlohmann::detail::value
void void nlohmann::detail::binary_writer< BasicJsonType, CharType >::write_bson_unsigned (const string_t &name, const BasicJsonType &j) write_bson_unsigned const string_t & name const BasicJsonType & j

Writes a BSON element with key name and unsigned value.

nlohmann::detail::out_of_range::create
JSON_THROW
nlohmann::to_string
void void nlohmann::detail::binary_writer< BasicJsonType, CharType >::write_bson_object_entry (const string_t &name, const typename BasicJsonType::object_t &value) write_bson_object_entry const string_t & name const typename BasicJsonType::object_t & value

Writes a BSON element with key name and object value.

void void nlohmann::detail::binary_writer< BasicJsonType, CharType >::write_bson_array (const string_t &name, const typename BasicJsonType::array_t &value) write_bson_array const string_t & name const typename BasicJsonType::array_t & value

Writes a BSON element with key name and array value.

nlohmann::to_string
void void nlohmann::detail::binary_writer< BasicJsonType, CharType >::write_bson_binary (const string_t &name, const binary_t &value) write_bson_binary const string_t & name const binary_t & value

Writes a BSON element with key name and binary value value.

void void nlohmann::detail::binary_writer< BasicJsonType, CharType >::write_bson_element (const string_t &name, const BasicJsonType &j) write_bson_element const string_t & name const BasicJsonType & j

Serializes the JSON value j to BSON and associates it with the key name.

name

The name to associate with the JSON entity j within the current BSON document

nlohmann::detail::array
nlohmann::detail::binary
nlohmann::detail::boolean
JSON_ASSERT
nlohmann::detail::null
nlohmann::detail::number_float
nlohmann::detail::number_integer
nlohmann::detail::number_unsigned
nlohmann::detail::object
nlohmann::detail::string
void void nlohmann::detail::binary_writer< BasicJsonType, CharType >::write_bson_object (const typename BasicJsonType::object_t &value) write_bson_object const typename BasicJsonType::object_t & value

value

JSON value to serialize

value.type() == value_t::object

typename NumberType
typename std::enable_if< std::is_floating_point< NumberType >::value, int >::type 0
void void nlohmann::detail::binary_writer< BasicJsonType, CharType >::write_number_with_ubjson_prefix (const NumberType n, const bool add_prefix) write_number_with_ubjson_prefix const NumberType n const bool add_prefix
typename NumberType
typename std::enable_if< std::is_unsigned< NumberType >::value, int >::type 0
void void nlohmann::detail::binary_writer< BasicJsonType, CharType >::write_number_with_ubjson_prefix (const NumberType n, const bool add_prefix) write_number_with_ubjson_prefix const NumberType n const bool add_prefix
typename NumberType
typename std::enable_if< std::is_signed< NumberType >::value &&!std::is_floating_point< NumberType >::value, int >::type 0
void void nlohmann::detail::binary_writer< BasicJsonType, CharType >::write_number_with_ubjson_prefix (const NumberType n, const bool add_prefix) write_number_with_ubjson_prefix const NumberType n const bool add_prefix
CharType CharType nlohmann::detail::binary_writer< BasicJsonType, CharType >::ubjson_prefix (const BasicJsonType &j) const noexcept ubjson_prefix const BasicJsonType & j

determine the type prefix of container values

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
typename NumberType
bool OutputIsLittleEndian OutputIsLittleEndian false
void void nlohmann::detail::binary_writer< BasicJsonType, CharType >::write_number (const NumberType n) write_number const NumberType n
void void nlohmann::detail::binary_writer< BasicJsonType, CharType >::write_compact_float (const number_float_t n, detail::input_format_t format) write_compact_float const number_float_t n detail::input_format_t format nlohmann::detail::cbor
typename C CharType
enable_if_t< std::is_signed< C >::value &&std::is_signed< char >::value > * nullptr
constexpr CharType static constexpr CharType nlohmann::detail::binary_writer< BasicJsonType, CharType >::to_char_type (std::uint8_t x) noexcept to_char_type std::uint8_t x nlohmann::detail::serializer< BasicJsonType >::for
typename C CharType
enable_if_t< std::is_signed< C >::value &&std::is_unsigned< char >::value > * nullptr
CharType static CharType nlohmann::detail::binary_writer< BasicJsonType, CharType >::to_char_type (std::uint8_t x) noexcept to_char_type std::uint8_t x
typename C CharType
enable_if_t< std::is_unsigned< C >::value > * nullptr
constexpr CharType static constexpr CharType nlohmann::detail::binary_writer< BasicJsonType, CharType >::to_char_type (std::uint8_t x) noexcept to_char_type std::uint8_t x
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
constexpr CharType static constexpr CharType nlohmann::detail::binary_writer< BasicJsonType, CharType >::to_char_type (InputCharType x) noexcept to_char_type InputCharType x

serialization to CBOR and MessagePack values

output_adapter_t< CharType >
nlohmann::detail::binary_writer< BasicJsonType, CharType >
-oa
-is_little_endian
bool
- nlohmann::detail::binary_writer
  binary_t
- nlohmann::detail::binary_writer
  binary_writer
- nlohmann::detail::binary_writer
  calc_bson_array_size
- nlohmann::detail::binary_writer
  calc_bson_binary_size
- nlohmann::detail::binary_writer
  calc_bson_element_size
- nlohmann::detail::binary_writer
  calc_bson_entry_header_size
- nlohmann::detail::binary_writer
  calc_bson_integer_size
- nlohmann::detail::binary_writer
  calc_bson_object_size
- nlohmann::detail::binary_writer
  calc_bson_string_size
- nlohmann::detail::binary_writer
  calc_bson_unsigned_size
- nlohmann::detail::binary_writer
  get_cbor_float_prefix
- nlohmann::detail::binary_writer
  get_cbor_float_prefix
- nlohmann::detail::binary_writer
  get_msgpack_float_prefix
- nlohmann::detail::binary_writer
  get_msgpack_float_prefix
- nlohmann::detail::binary_writer
  get_ubjson_float_prefix
- nlohmann::detail::binary_writer
  get_ubjson_float_prefix
- nlohmann::detail::binary_writer
  is_little_endian
- nlohmann::detail::binary_writer
  number_float_t
- nlohmann::detail::binary_writer
  oa
- nlohmann::detail::binary_writer
  string_t
- nlohmann::detail::binary_writer
  to_char_type
- nlohmann::detail::binary_writer
  to_char_type
- nlohmann::detail::binary_writer
  to_char_type
- nlohmann::detail::binary_writer
  to_char_type
- nlohmann::detail::binary_writer
  ubjson_prefix
- nlohmann::detail::binary_writer
  write_bson
- nlohmann::detail::binary_writer
  write_bson_array
- nlohmann::detail::binary_writer
  write_bson_binary
- nlohmann::detail::binary_writer
  write_bson_boolean
- nlohmann::detail::binary_writer
  write_bson_double
- nlohmann::detail::binary_writer
  write_bson_element
- nlohmann::detail::binary_writer
  write_bson_entry_header
- nlohmann::detail::binary_writer
  write_bson_integer
- nlohmann::detail::binary_writer
  write_bson_null
- nlohmann::detail::binary_writer
  write_bson_object
- nlohmann::detail::binary_writer
  write_bson_object_entry
- nlohmann::detail::binary_writer
  write_bson_string
- nlohmann::detail::binary_writer
  write_bson_unsigned
- nlohmann::detail::binary_writer
  write_cbor
- nlohmann::detail::binary_writer
  write_compact_float
- nlohmann::detail::binary_writer
  write_msgpack
- nlohmann::detail::binary_writer
  write_number
- nlohmann::detail::binary_writer
  write_number_with_ubjson_prefix
- nlohmann::detail::binary_writer
  write_number_with_ubjson_prefix
- nlohmann::detail::binary_writer
  write_number_with_ubjson_prefix
- nlohmann::detail::binary_writer
  write_ubjson