MCPcopy Create free account
hub / github.com/CalcProgrammer1/OpenRGB / get_bson_binary

Method get_bson_binary

dependencies/json/json.hpp:7938–7952  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

7936 */
7937 template<typename NumberType>
7938 bool get_bson_binary(const NumberType len, binary_t& result)
7939 {
7940 if (JSON_HEDLEY_UNLIKELY(len < 0))
7941 {
7942 auto last_token = get_token_string();
7943 return sax->parse_error(chars_read, last_token, parse_error::create(112, chars_read, exception_message(input_format_t::bson, "byte array length cannot be negative, is " + std::to_string(len), "binary")));
7944 }
7945
7946 // All BSON binary values have a subtype
7947 std::uint8_t subtype{};
7948 get_number<std::uint8_t>(input_format_t::bson, subtype);
7949 result.set_subtype(subtype);
7950
7951 return get_binary(input_format_t::bson, len, result);
7952 }
7953
7954 /*!
7955 @brief Read a BSON document element of the given @a element_type.

Callers

nothing calls this directly

Calls 5

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

Tested by

no test coverage detected