! @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 */
| 7572 | @return whether string creation completed |
| 7573 | */ |
| 7574 | bool get_msgpack_string(string_t& result) |
| 7575 | { |
| 7576 | if (JSON_UNLIKELY(not unexpect_eof(input_format_t::msgpack, "string"))) |
| 7577 | { |
| 7578 | return false; |
| 7579 | } |
| 7580 | |
| 7581 | switch (current) |
| 7582 | { |
| 7583 | // fixstr |
| 7584 | case 0xA0: |
| 7585 | case 0xA1: |
| 7586 | case 0xA2: |
| 7587 | case 0xA3: |
| 7588 | case 0xA4: |
| 7589 | case 0xA5: |
| 7590 | case 0xA6: |
| 7591 | case 0xA7: |
| 7592 | case 0xA8: |
| 7593 | case 0xA9: |
| 7594 | case 0xAA: |
| 7595 | case 0xAB: |
| 7596 | case 0xAC: |
| 7597 | case 0xAD: |
| 7598 | case 0xAE: |
| 7599 | case 0xAF: |
| 7600 | case 0xB0: |
| 7601 | case 0xB1: |
| 7602 | case 0xB2: |
| 7603 | case 0xB3: |
| 7604 | case 0xB4: |
| 7605 | case 0xB5: |
| 7606 | case 0xB6: |
| 7607 | case 0xB7: |
| 7608 | case 0xB8: |
| 7609 | case 0xB9: |
| 7610 | case 0xBA: |
| 7611 | case 0xBB: |
| 7612 | case 0xBC: |
| 7613 | case 0xBD: |
| 7614 | case 0xBE: |
| 7615 | case 0xBF: |
| 7616 | { |
| 7617 | return get_string(input_format_t::msgpack, current & 0x1F, result); |
| 7618 | } |
| 7619 | |
| 7620 | case 0xD9: // str 8 |
| 7621 | { |
| 7622 | uint8_t len; |
| 7623 | return get_number(input_format_t::msgpack, len) and get_string(input_format_t::msgpack, len, result); |
| 7624 | } |
| 7625 | |
| 7626 | case 0xDA: // str 16 |
| 7627 | { |
| 7628 | uint16_t len; |
| 7629 | return get_number(input_format_t::msgpack, len) and get_string(input_format_t::msgpack, len, result); |
| 7630 | } |
| 7631 |
nothing calls this directly
no test coverage detected