MCPcopy Create free account
hub / github.com/Open-GD/OpenGD / write_bson_array

Method write_bson_array

Source/external/json.hpp:16045–16059  ·  view source on GitHub ↗

! @brief Writes a BSON element with key @a name and array @a value */

Source from the content-addressed store, hash-verified

16043 @brief Writes a BSON element with key @a name and array @a value
16044 */
16045 void write_bson_array(const string_t& name,
16046 const typename BasicJsonType::array_t& value)
16047 {
16048 write_bson_entry_header(name, 0x04); // array
16049 write_number<std::int32_t>(static_cast<std::int32_t>(calc_bson_array_size(value)), true);
16050
16051 std::size_t array_index = 0ul;
16052
16053 for (const auto& el : value)
16054 {
16055 write_bson_element(std::to_string(array_index++), el);
16056 }
16057
16058 oa->write_character(to_char_type(0x00));
16059 }
16060
16061 /*!
16062 @brief Writes a BSON element with key @a name and binary value @a value

Callers

nothing calls this directly

Calls 2

to_stringFunction · 0.70
write_characterMethod · 0.45

Tested by

no test coverage detected