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

Function merge_or_update

include/jsoncons/basic_json.hpp:4404–4433  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4402 // merge_or_update
4403
4404 void merge_or_update(const basic_json& source)
4405 {
4406 switch (source.storage_kind())
4407 {
4408 case json_storage_kind::empty_object:
4409 break;
4410 case json_storage_kind::object:
4411 switch (storage_kind())
4412 {
4413 case json_storage_kind::empty_object:
4414 create_object_implicitly();
4415 cast<object_storage>().value().merge_or_update(source.cast<object_storage>().value());
4416 break;
4417 case json_storage_kind::object:
4418 cast<object_storage>().value().merge_or_update(source.cast<object_storage>().value());
4419 break;
4420 case json_storage_kind::json_ref:
4421 cast<json_ref_storage>().value().merge_or_update(source);
4422 break;
4423 default:
4424 JSONCONS_THROW(json_runtime_error<std::domain_error>("Attempting to merge or update a value that is not an object"));
4425 }
4426 break;
4427 case json_storage_kind::json_ref:
4428 merge_or_update(source.cast<json_ref_storage>().value());
4429 break;
4430 default:
4431 JSONCONS_THROW(json_runtime_error<std::domain_error>("Attempting to merge a value that is not an object"));
4432 }
4433 }
4434
4435 void merge_or_update(basic_json&& source)
4436 {

Callers

nothing calls this directly

Calls 4

storage_kindFunction · 0.85
create_object_implicitlyFunction · 0.85
merge_or_updateMethod · 0.45
valueMethod · 0.45

Tested by

no test coverage detected