! @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 */
| 9214 | @return whether string creation completed |
| 9215 | */ |
| 9216 | bool get_msgpack_string(string_t& result) |
| 9217 | { |
| 9218 | if (JSON_HEDLEY_UNLIKELY(!unexpect_eof(input_format_t::msgpack, "string"))) |
| 9219 | { |
| 9220 | return false; |
| 9221 | } |
| 9222 | |
| 9223 | switch (current) |
| 9224 | { |
| 9225 | // fixstr |
| 9226 | case 0xA0: |
| 9227 | case 0xA1: |
| 9228 | case 0xA2: |
| 9229 | case 0xA3: |
| 9230 | case 0xA4: |
| 9231 | case 0xA5: |
| 9232 | case 0xA6: |
| 9233 | case 0xA7: |
| 9234 | case 0xA8: |
| 9235 | case 0xA9: |
| 9236 | case 0xAA: |
| 9237 | case 0xAB: |
| 9238 | case 0xAC: |
| 9239 | case 0xAD: |
| 9240 | case 0xAE: |
| 9241 | case 0xAF: |
| 9242 | case 0xB0: |
| 9243 | case 0xB1: |
| 9244 | case 0xB2: |
| 9245 | case 0xB3: |
| 9246 | case 0xB4: |
| 9247 | case 0xB5: |
| 9248 | case 0xB6: |
| 9249 | case 0xB7: |
| 9250 | case 0xB8: |
| 9251 | case 0xB9: |
| 9252 | case 0xBA: |
| 9253 | case 0xBB: |
| 9254 | case 0xBC: |
| 9255 | case 0xBD: |
| 9256 | case 0xBE: |
| 9257 | case 0xBF: |
| 9258 | { |
| 9259 | return get_string(input_format_t::msgpack, static_cast<unsigned int>(current) & 0x1Fu, result); |
| 9260 | } |
| 9261 | |
| 9262 | case 0xD9: // str 8 |
| 9263 | { |
| 9264 | std::uint8_t len{}; |
| 9265 | return get_number(input_format_t::msgpack, len) && get_string(input_format_t::msgpack, len, result); |
| 9266 | } |
| 9267 | |
| 9268 | case 0xDA: // str 16 |
| 9269 | { |
| 9270 | std::uint16_t len{}; |
| 9271 | return get_number(input_format_t::msgpack, len) && get_string(input_format_t::msgpack, len, result); |
| 9272 | } |
| 9273 |
nothing calls this directly
no test coverage detected