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

Method write_bson_binary

lesson6-Segmentation/json.hpp:13818–13827  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

13816 @brief Writes a BSON element with key @a name and binary value @a value
13817 */
13818 void write_bson_binary(const string_t& name,
13819 const binary_t& value)
13820 {
13821 write_bson_entry_header(name, 0x05);
13822
13823 write_number<std::int32_t, true>(static_cast<std::int32_t>(value.size()));
13824 write_number(value.has_subtype() ? value.subtype() : std::uint8_t(0x00));
13825
13826 oa->write_characters(reinterpret_cast<const CharType*>(value.data()), value.size());
13827 }
13828
13829 /*!
13830 @brief Calculates the size necessary to serialize the JSON value @a j with its @a name

Callers

nothing calls this directly

Calls 4

has_subtypeMethod · 0.80
subtypeMethod · 0.80
dataMethod · 0.80
sizeMethod · 0.45

Tested by

no test coverage detected