| 1632 | } |
| 1633 | |
| 1634 | conversion_result<byte_string_view> try_as_byte_string_view() const |
| 1635 | { |
| 1636 | using result_type = conversion_result<byte_string_view>; |
| 1637 | |
| 1638 | switch (storage_kind()) |
| 1639 | { |
| 1640 | case json_storage_kind::byte_str: |
| 1641 | return result_type(in_place, cast<byte_string_storage>().data(),cast<byte_string_storage>().length()); |
| 1642 | case json_storage_kind::const_json_ref: |
| 1643 | return cast<const_json_ref_storage>().value().try_as_byte_string_view(); |
| 1644 | case json_storage_kind::json_ref: |
| 1645 | return cast<json_ref_storage>().value().try_as_byte_string_view(); |
| 1646 | default: |
| 1647 | return result_type(jsoncons::unexpect, conv_errc::not_byte_string); |
| 1648 | } |
| 1649 | } |
| 1650 | |
| 1651 | byte_string_view as_byte_string_view() const |
| 1652 | { |
no test coverage detected