MCPcopy Create free account
hub / github.com/Predelnik/DSpellCheck / parse_cbor_internal

Method parse_cbor_internal

deps/json/json.hpp:9498–9976  ·  view source on GitHub ↗

! @param[in] get_char whether a new character should be retrieved from the input (true) or whether the last read character should be considered instead (false) @param[in] tag_handler how CBOR tags should be treated @return whether a valid CBOR value was passed to the SAX parser */

Source from the content-addressed store, hash-verified

9496 @return whether a valid CBOR value was passed to the SAX parser
9497 */
9498 bool parse_cbor_internal(const bool get_char,
9499 const cbor_tag_handler_t tag_handler)
9500 {
9501 switch (get_char ? get() : current)
9502 {
9503 // EOF
9504 case std::char_traits<char_type>::eof():
9505 return unexpect_eof(input_format_t::cbor, "value");
9506
9507 // Integer 0x00..0x17 (0..23)
9508 case 0x00:
9509 case 0x01:
9510 case 0x02:
9511 case 0x03:
9512 case 0x04:
9513 case 0x05:
9514 case 0x06:
9515 case 0x07:
9516 case 0x08:
9517 case 0x09:
9518 case 0x0A:
9519 case 0x0B:
9520 case 0x0C:
9521 case 0x0D:
9522 case 0x0E:
9523 case 0x0F:
9524 case 0x10:
9525 case 0x11:
9526 case 0x12:
9527 case 0x13:
9528 case 0x14:
9529 case 0x15:
9530 case 0x16:
9531 case 0x17:
9532 return sax->number_unsigned(static_cast<number_unsigned_t>(current));
9533
9534 case 0x18: // Unsigned integer (one-byte uint8_t follows)
9535 {
9536 std::uint8_t number{};
9537 return get_number(input_format_t::cbor, number) && sax->number_unsigned(number);
9538 }
9539
9540 case 0x19: // Unsigned integer (two-byte uint16_t follows)
9541 {
9542 std::uint16_t number{};
9543 return get_number(input_format_t::cbor, number) && sax->number_unsigned(number);
9544 }
9545
9546 case 0x1A: // Unsigned integer (four-byte uint32_t follows)
9547 {
9548 std::uint32_t number{};
9549 return get_number(input_format_t::cbor, number) && sax->number_unsigned(number);
9550 }
9551
9552 case 0x1B: // Unsigned integer (eight-byte uint64_t follows)
9553 {
9554 std::uint64_t number{};
9555 return get_number(input_format_t::cbor, number) && sax->number_unsigned(number);

Callers

nothing calls this directly

Calls 12

getFunction · 0.85
get_token_stringFunction · 0.85
createFunction · 0.85
concatFunction · 0.85
number_unsignedMethod · 0.45
number_integerMethod · 0.45
binaryMethod · 0.45
stringMethod · 0.45
parse_errorMethod · 0.45
booleanMethod · 0.45
nullMethod · 0.45
number_floatMethod · 0.45

Tested by

no test coverage detected