TerraForge3D  2.3.1
3D Terrain And Landscape Generator

◆ write_bson_array()

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

Writes a BSON element with key name and array value.

Definition at line 14958 of file json.hpp.

14960 {
14961 write_bson_entry_header(name, 0x04); // array
14962 write_number<std::int32_t, true>(static_cast<std::int32_t>(calc_bson_array_size(value)));
14963 std::size_t array_index = 0ul;
14964
14965 for (const auto &el : value)
14966 {
14967 write_bson_element(std::to_string(array_index++), el);
14968 }
14969
14970 oa->write_character(to_char_type(0x00));
14971 }
void 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.
Definition: json.hpp:14803
output_adapter_t< CharType > oa
the output
Definition: json.hpp:15519
void write_bson_element(const string_t &name, const BasicJsonType &j)
Serializes the JSON value j to BSON and associates it with the key name.
Definition: json.hpp:15038
static std::size_t calc_bson_array_size(const typename BasicJsonType::array_t &value)
Definition: json.hpp:14937