! @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 */
| 9475 | @return whether string creation completed |
| 9476 | */ |
| 9477 | bool get_msgpack_string(string_t& result) |
| 9478 | { |
| 9479 | if (JSON_HEDLEY_UNLIKELY(!unexpect_eof(input_format_t::msgpack, "string"))) |
| 9480 | { |
| 9481 | return false; |
| 9482 | } |
| 9483 | |
| 9484 | switch (current) |
| 9485 | { |
| 9486 | // fixstr |
| 9487 | case 0xA0: |
| 9488 | case 0xA1: |
| 9489 | case 0xA2: |
| 9490 | case 0xA3: |
| 9491 | case 0xA4: |
| 9492 | case 0xA5: |
| 9493 | case 0xA6: |
| 9494 | case 0xA7: |
| 9495 | case 0xA8: |
| 9496 | case 0xA9: |
| 9497 | case 0xAA: |
| 9498 | case 0xAB: |
| 9499 | case 0xAC: |
| 9500 | case 0xAD: |
| 9501 | case 0xAE: |
| 9502 | case 0xAF: |
| 9503 | case 0xB0: |
| 9504 | case 0xB1: |
| 9505 | case 0xB2: |
| 9506 | case 0xB3: |
| 9507 | case 0xB4: |
| 9508 | case 0xB5: |
| 9509 | case 0xB6: |
| 9510 | case 0xB7: |
| 9511 | case 0xB8: |
| 9512 | case 0xB9: |
| 9513 | case 0xBA: |
| 9514 | case 0xBB: |
| 9515 | case 0xBC: |
| 9516 | case 0xBD: |
| 9517 | case 0xBE: |
| 9518 | case 0xBF: |
| 9519 | { |
| 9520 | return get_string(input_format_t::msgpack, static_cast<unsigned int>(current) & 0x1Fu, result); |
| 9521 | } |
| 9522 | |
| 9523 | case 0xD9: // str 8 |
| 9524 | { |
| 9525 | std::uint8_t len{}; |
| 9526 | return get_number(input_format_t::msgpack, len) && get_string(input_format_t::msgpack, len, result); |
| 9527 | } |
| 9528 | |
| 9529 | case 0xDA: // str 16 |
| 9530 | { |
| 9531 | std::uint16_t len{}; |
| 9532 | return get_number(input_format_t::msgpack, len) && get_string(input_format_t::msgpack, len, result); |
| 9533 | } |
| 9534 |
nothing calls this directly
no test coverage detected