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

Method write_bson_binary

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

13815 @brief Writes a BSON element with key @a name and binary value @a value
13816 */
13817 void write_bson_binary(const string_t& name,
13818 const binary_t& value)
13819 {
13820 write_bson_entry_header(name, 0x05);
13821
13822 write_number<std::int32_t, true>(static_cast<std::int32_t>(value.size()));
13823 write_number(value.has_subtype() ? value.subtype() : std::uint8_t(0x00));
13824
13825 oa->write_characters(reinterpret_cast<const CharType*>(value.data()), value.size());
13826 }
13827
13828 /*!
13829 @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
sizeMethod · 0.45
write_charactersMethod · 0.45

Tested by

no test coverage detected