MCPcopy Create free account
hub / github.com/danielaparker/jsoncons / try_as_byte_string_view

Function try_as_byte_string_view

include/jsoncons/basic_json.hpp:1634–1649  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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 {

Callers 1

as_byte_string_viewFunction · 0.85

Calls 4

storage_kindFunction · 0.85
dataMethod · 0.45
lengthMethod · 0.45
valueMethod · 0.45

Tested by

no test coverage detected