MCPcopy Create free account
hub / github.com/Open-GD/OpenGD / get_bson_binary

Method get_bson_binary

Source/external/json.hpp:9319–9334  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

9317 */
9318 template<typename NumberType>
9319 bool get_bson_binary(const NumberType len, binary_t& result)
9320 {
9321 if (JSON_HEDLEY_UNLIKELY(len < 0))
9322 {
9323 auto last_token = get_token_string();
9324 return sax->parse_error(chars_read, last_token, parse_error::create(112, chars_read,
9325 exception_message(input_format_t::bson, concat("byte array length cannot be negative, is ", std::to_string(len)), "binary"), nullptr));
9326 }
9327
9328 // All BSON binary values have a subtype
9329 std::uint8_t subtype{};
9330 get_number<std::uint8_t>(input_format_t::bson, subtype);
9331 result.set_subtype(subtype);
9332
9333 return get_binary(input_format_t::bson, len, result);
9334 }
9335
9336 /*!
9337 @brief Read a BSON document element of the given @a element_type.

Callers

nothing calls this directly

Calls 5

get_token_stringFunction · 0.85
createFunction · 0.85
concatFunction · 0.85
to_stringFunction · 0.70
parse_errorMethod · 0.45

Tested by

no test coverage detected