MCPcopy Create free account
hub / github.com/M4THYOU/TokenDagger / get_msgpack_string

Method get_msgpack_string

src/nlohmann/json.hpp:10721–10792  ·  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

10719 @return whether string creation completed
10720 */
10721 bool get_msgpack_string(string_t& result)
10722 {
10723 if (JSON_HEDLEY_UNLIKELY(!unexpect_eof(input_format_t::msgpack, "string")))
10724 {
10725 return false;
10726 }
10727
10728 switch (current)
10729 {
10730 // fixstr
10731 case 0xA0:
10732 case 0xA1:
10733 case 0xA2:
10734 case 0xA3:
10735 case 0xA4:
10736 case 0xA5:
10737 case 0xA6:
10738 case 0xA7:
10739 case 0xA8:
10740 case 0xA9:
10741 case 0xAA:
10742 case 0xAB:
10743 case 0xAC:
10744 case 0xAD:
10745 case 0xAE:
10746 case 0xAF:
10747 case 0xB0:
10748 case 0xB1:
10749 case 0xB2:
10750 case 0xB3:
10751 case 0xB4:
10752 case 0xB5:
10753 case 0xB6:
10754 case 0xB7:
10755 case 0xB8:
10756 case 0xB9:
10757 case 0xBA:
10758 case 0xBB:
10759 case 0xBC:
10760 case 0xBD:
10761 case 0xBE:
10762 case 0xBF:
10763 {
10764 return get_string(input_format_t::msgpack, static_cast<unsigned int>(current) & 0x1Fu, result);
10765 }
10766
10767 case 0xD9: // str 8
10768 {
10769 std::uint8_t len{};
10770 return get_number(input_format_t::msgpack, len) && get_string(input_format_t::msgpack, len, result);
10771 }
10772
10773 case 0xDA: // str 16
10774 {
10775 std::uint16_t len{};
10776 return get_number(input_format_t::msgpack, len) && get_string(input_format_t::msgpack, len, result);
10777 }
10778

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