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

Method get_msgpack_string

Source/external/json.hpp:10651–10722  ·  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

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

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