MCPcopy Create free account
hub / github.com/AllentDan/LibtorchTutorials / write_bson_array

Method write_bson_array

lesson6-Segmentation/json.hpp:13799–13813  ·  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

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