MCPcopy Create free account
hub / github.com/aixed/WeChat-Hook / get_bson_binary

Method get_bson_binary

include/json.hpp:9236–9251  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

9234 */
9235 template<typename NumberType>
9236 bool get_bson_binary(const NumberType len, binary_t& result)
9237 {
9238 if (JSON_HEDLEY_UNLIKELY(len < 0))
9239 {
9240 auto last_token = get_token_string();
9241 return sax->parse_error(chars_read, last_token, parse_error::create(112, chars_read,
9242 exception_message(input_format_t::bson, concat("byte array length cannot be negative, is ", std::to_string(len)), "binary"), nullptr));
9243 }
9244
9245 // All BSON binary values have a subtype
9246 std::uint8_t subtype{};
9247 get_number<std::uint8_t>(input_format_t::bson, subtype);
9248 result.set_subtype(subtype);
9249
9250 return get_binary(input_format_t::bson, len, result);
9251 }
9252
9253 /*!
9254 @brief Read a BSON document element of the given @a element_type.

Callers

nothing calls this directly

Calls 5

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

Tested by

no test coverage detected