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

Function empty

include/jsoncons/basic_json.hpp:3407–3431  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3405 }
3406
3407 bool empty() const noexcept
3408 {
3409 switch (storage_kind())
3410 {
3411 case json_storage_kind::byte_str:
3412 return cast<byte_string_storage>().length() == 0;
3413 break;
3414 case json_storage_kind::short_str:
3415 return cast<short_string_storage>().length() == 0;
3416 case json_storage_kind::long_str:
3417 return cast<long_string_storage>().length() == 0;
3418 case json_storage_kind::array:
3419 return cast<array_storage>().value().empty();
3420 case json_storage_kind::empty_object:
3421 return true;
3422 case json_storage_kind::object:
3423 return cast<object_storage>().value().empty();
3424 case json_storage_kind::const_json_ref:
3425 return cast<const_json_ref_storage>().value().empty();
3426 case json_storage_kind::json_ref:
3427 return cast<json_ref_storage>().value().empty();
3428 default:
3429 return false;
3430 }
3431 }
3432
3433 std::size_t capacity() const
3434 {

Callers 1

compareFunction · 0.85

Calls 4

storage_kindFunction · 0.85
lengthMethod · 0.45
emptyMethod · 0.45
valueMethod · 0.45

Tested by

no test coverage detected