MCPcopy Create free account
hub / github.com/OpenFodder/openfodder / write_bson_array

Method write_bson_array

Source/Utils/json.hpp:13798–13812  ·  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

13796 @brief Writes a BSON element with key @a name and array @a value
13797 */
13798 void write_bson_array(const string_t& name,
13799 const typename BasicJsonType::array_t& value)
13800 {
13801 write_bson_entry_header(name, 0x04); // array
13802 write_number<std::int32_t, true>(static_cast<std::int32_t>(calc_bson_array_size(value)));
13803
13804 std::size_t array_index = 0ul;
13805
13806 for (const auto& el : value)
13807 {
13808 write_bson_element(std::to_string(array_index++), el);
13809 }
13810
13811 oa->write_character(to_char_type(0x00));
13812 }
13813
13814 /*!
13815 @brief Writes a BSON element with key @a name and binary value @a value

Callers

nothing calls this directly

Calls 1

write_characterMethod · 0.45

Tested by

no test coverage detected