MCPcopy Create free account
hub / github.com/EmmyLua/EmmyLuaDebugger / merge_patch

Function merge_patch

third-party/nlohmann/include/nlohmann/json.hpp:4644–4668  ·  view source on GitHub ↗

@brief applies a JSON Merge Patch @sa https://json.nlohmann.me/api/basic_json/merge_patch/

Source from the content-addressed store, hash-verified

4642 /// @brief applies a JSON Merge Patch
4643 /// @sa https://json.nlohmann.me/api/basic_json/merge_patch/
4644 void merge_patch(const basic_json& apply_patch)
4645 {
4646 if (apply_patch.is_object())
4647 {
4648 if (!is_object())
4649 {
4650 *this = object();
4651 }
4652 for (auto it = apply_patch.begin(); it != apply_patch.end(); ++it)
4653 {
4654 if (it.value().is_null())
4655 {
4656 erase(it.key());
4657 }
4658 else
4659 {
4660 operator[](it.key()).merge_patch(it.value());
4661 }
4662 }
4663 }
4664 else
4665 {
4666 *this = apply_patch;
4667 }
4668 }
4669
4670 /// @}
4671};

Callers

nothing calls this directly

Calls 6

is_objectFunction · 0.85
eraseFunction · 0.85
beginMethod · 0.80
endMethod · 0.80
valueMethod · 0.45
keyMethod · 0.45

Tested by

no test coverage detected