MCPcopy Create free account
hub / github.com/GDRETools/gdsdecomp / get_msgpack_string

Method get_msgpack_string

external/tinygltf/json.hpp:9946–10016  ·  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

9944 @return whether string creation completed
9945 */
9946 bool get_msgpack_string(string_t& result)
9947 {
9948 if (JSON_HEDLEY_UNLIKELY(!unexpect_eof(input_format_t::msgpack, "string")))
9949 {
9950 return false;
9951 }
9952
9953 switch (current)
9954 {
9955 // fixstr
9956 case 0xA0:
9957 case 0xA1:
9958 case 0xA2:
9959 case 0xA3:
9960 case 0xA4:
9961 case 0xA5:
9962 case 0xA6:
9963 case 0xA7:
9964 case 0xA8:
9965 case 0xA9:
9966 case 0xAA:
9967 case 0xAB:
9968 case 0xAC:
9969 case 0xAD:
9970 case 0xAE:
9971 case 0xAF:
9972 case 0xB0:
9973 case 0xB1:
9974 case 0xB2:
9975 case 0xB3:
9976 case 0xB4:
9977 case 0xB5:
9978 case 0xB6:
9979 case 0xB7:
9980 case 0xB8:
9981 case 0xB9:
9982 case 0xBA:
9983 case 0xBB:
9984 case 0xBC:
9985 case 0xBD:
9986 case 0xBE:
9987 case 0xBF:
9988 {
9989 return get_string(input_format_t::msgpack, static_cast<unsigned int>(current) & 0x1Fu, result);
9990 }
9991
9992 case 0xD9: // str 8
9993 {
9994 std::uint8_t len{};
9995 return get_number(input_format_t::msgpack, len) && get_string(input_format_t::msgpack, len, result);
9996 }
9997
9998 case 0xDA: // str 16
9999 {
10000 std::uint16_t len{};
10001 return get_number(input_format_t::msgpack, len) && get_string(input_format_t::msgpack, len, result);
10002 }
10003

Callers

nothing calls this directly

Calls 3

get_token_stringFunction · 0.85
createFunction · 0.85
parse_errorMethod · 0.45

Tested by

no test coverage detected