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

Function as_cstring

include/jsoncons/basic_json.hpp:3920–3935  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3918 }
3919
3920 const char_type* as_cstring() const
3921 {
3922 switch (storage_kind())
3923 {
3924 case json_storage_kind::short_str:
3925 return cast<short_string_storage>().c_str();
3926 case json_storage_kind::long_str:
3927 return cast<long_string_storage>().c_str();
3928 case json_storage_kind::const_json_ref:
3929 return cast<const_json_ref_storage>().value().as_cstring();
3930 case json_storage_kind::json_ref:
3931 return cast<json_ref_storage>().value().as_cstring();
3932 default:
3933 JSONCONS_THROW(json_runtime_error<std::domain_error>("Not a cstring"));
3934 }
3935 }
3936
3937 basic_json& at(const string_view_type& key)
3938 {

Callers 1

try_as_doubleFunction · 0.85

Calls 3

storage_kindFunction · 0.85
c_strMethod · 0.45
valueMethod · 0.45

Tested by

no test coverage detected