! @brief Writes a BSON element with key @a name and array @a value */
| 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 |
nothing calls this directly
no test coverage detected