| 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 | { |
no test coverage detected