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

Method get_msgpack_string

deps/json/json.hpp:10655–10726  ·  view source on GitHub ↗

! @brief reads a MessagePack string This function first reads starting bytes to determine the expected string length and then copies this number of bytes into a string. @param[out] result created string @return whether string creation completed */

Source from the content-addressed store, hash-verified

10653 @return whether string creation completed
10654 */
10655 bool get_msgpack_string(string_t& result)
10656 {
10657 if (JSON_HEDLEY_UNLIKELY(!unexpect_eof(input_format_t::msgpack, "string")))
10658 {
10659 return false;
10660 }
10661
10662 switch (current)
10663 {
10664 // fixstr
10665 case 0xA0:
10666 case 0xA1:
10667 case 0xA2:
10668 case 0xA3:
10669 case 0xA4:
10670 case 0xA5:
10671 case 0xA6:
10672 case 0xA7:
10673 case 0xA8:
10674 case 0xA9:
10675 case 0xAA:
10676 case 0xAB:
10677 case 0xAC:
10678 case 0xAD:
10679 case 0xAE:
10680 case 0xAF:
10681 case 0xB0:
10682 case 0xB1:
10683 case 0xB2:
10684 case 0xB3:
10685 case 0xB4:
10686 case 0xB5:
10687 case 0xB6:
10688 case 0xB7:
10689 case 0xB8:
10690 case 0xB9:
10691 case 0xBA:
10692 case 0xBB:
10693 case 0xBC:
10694 case 0xBD:
10695 case 0xBE:
10696 case 0xBF:
10697 {
10698 return get_string(input_format_t::msgpack, static_cast<unsigned int>(current) & 0x1Fu, result);
10699 }
10700
10701 case 0xD9: // str 8
10702 {
10703 std::uint8_t len{};
10704 return get_number(input_format_t::msgpack, len) && get_string(input_format_t::msgpack, len, result);
10705 }
10706
10707 case 0xDA: // str 16
10708 {
10709 std::uint16_t len{};
10710 return get_number(input_format_t::msgpack, len) && get_string(input_format_t::msgpack, len, result);
10711 }
10712

Callers

nothing calls this directly

Calls 4

get_token_stringFunction · 0.85
createFunction · 0.85
concatFunction · 0.85
parse_errorMethod · 0.45

Tested by

no test coverage detected