MCPcopy Create free account
hub / github.com/aixed/WeChat-Hook / get_msgpack_string

Method get_msgpack_string

include/json.hpp:10568–10639  ·  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

10566 @return whether string creation completed
10567 */
10568 bool get_msgpack_string(string_t& result)
10569 {
10570 if (JSON_HEDLEY_UNLIKELY(!unexpect_eof(input_format_t::msgpack, "string")))
10571 {
10572 return false;
10573 }
10574
10575 switch (current)
10576 {
10577 // fixstr
10578 case 0xA0:
10579 case 0xA1:
10580 case 0xA2:
10581 case 0xA3:
10582 case 0xA4:
10583 case 0xA5:
10584 case 0xA6:
10585 case 0xA7:
10586 case 0xA8:
10587 case 0xA9:
10588 case 0xAA:
10589 case 0xAB:
10590 case 0xAC:
10591 case 0xAD:
10592 case 0xAE:
10593 case 0xAF:
10594 case 0xB0:
10595 case 0xB1:
10596 case 0xB2:
10597 case 0xB3:
10598 case 0xB4:
10599 case 0xB5:
10600 case 0xB6:
10601 case 0xB7:
10602 case 0xB8:
10603 case 0xB9:
10604 case 0xBA:
10605 case 0xBB:
10606 case 0xBC:
10607 case 0xBD:
10608 case 0xBE:
10609 case 0xBF:
10610 {
10611 return get_string(input_format_t::msgpack, static_cast<unsigned int>(current) & 0x1Fu, result);
10612 }
10613
10614 case 0xD9: // str 8
10615 {
10616 std::uint8_t len{};
10617 return get_number(input_format_t::msgpack, len) && get_string(input_format_t::msgpack, len, result);
10618 }
10619
10620 case 0xDA: // str 16
10621 {
10622 std::uint16_t len{};
10623 return get_number(input_format_t::msgpack, len) && get_string(input_format_t::msgpack, len, result);
10624 }
10625

Callers

nothing calls this directly

Calls 4

get_token_stringFunction · 0.70
createFunction · 0.70
concatFunction · 0.70
parse_errorMethod · 0.45

Tested by

no test coverage detected