TerraForge3D  2.3.1
3D Terrain And Landscape Generator

◆ write_bson_element()

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

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

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

Definition at line 15038 of file json.hpp.

15040 {
15041 switch (j.type())
15042 {
15043 case value_t::object:
15044 return write_bson_object_entry(name, *j.m_value.object);
15045
15046 case value_t::array:
15047 return write_bson_array(name, *j.m_value.array);
15048
15049 case value_t::binary:
15050 return write_bson_binary(name, *j.m_value.binary);
15051
15052 case value_t::boolean:
15053 return write_bson_boolean(name, j.m_value.boolean);
15054
15056 return write_bson_double(name, j.m_value.number_float);
15057
15059 return write_bson_integer(name, j.m_value.number_integer);
15060
15062 return write_bson_unsigned(name, j);
15063
15064 case value_t::string:
15065 return write_bson_string(name, *j.m_value.string);
15066
15067 case value_t::null:
15068 return write_bson_null(name);
15069
15070 // LCOV_EXCL_START
15071 case value_t::discarded:
15072 default:
15073 JSON_ASSERT(false); // NOLINT(cert-dcl03-c,hicpp-static-assert,misc-static-assert)
15074 return;
15075 // LCOV_EXCL_STOP
15076 }
15077 }
void write_bson_array(const string_t &name, const typename BasicJsonType::array_t &value)
Writes a BSON element with key name and array value.
Definition: json.hpp:14958
void write_bson_double(const string_t &name, const double value)
Writes a BSON element with key name and double value value.
Definition: json.hpp:14825
void write_bson_integer(const string_t &name, const std::int64_t value)
Writes a BSON element with key name and integer value.
Definition: json.hpp:14874
void write_bson_string(const string_t &name, const string_t &value)
Writes a BSON element with key name and string value value.
Definition: json.hpp:14843
void write_bson_object_entry(const string_t &name, const typename BasicJsonType::object_t &value)
Writes a BSON element with key name and object value.
Definition: json.hpp:14927
void write_bson_binary(const string_t &name, const binary_t &value)
Writes a BSON element with key name and binary value value.
Definition: json.hpp:14976
void write_bson_null(const string_t &name)
Writes a BSON element with key name and null value.
Definition: json.hpp:14856
void write_bson_unsigned(const string_t &name, const BasicJsonType &j)
Writes a BSON element with key name and unsigned value.
Definition: json.hpp:14903
void write_bson_boolean(const string_t &name, const bool value)
Writes a BSON element with key name and boolean value value.
Definition: json.hpp:14815
@ number_integer
number value (signed integer)
@ discarded
discarded by the parser callback function
@ binary
binary array (ordered collection of bytes)
@ object
object (unordered set of name/value pairs)
@ number_float
number value (floating-point)
@ number_unsigned
number value (unsigned integer)
@ array
array (ordered collection of values)