Go to the documentation of this file.00001 #include <json.hpp>
00002
00003 using json = nlohmann::json;
00004
00005 int main()
00006 {
00007
00008 json source = R"(
00009 {
00010 "baz": "qux",
00011 "foo": "bar"
00012 }
00013 )"_json;
00014
00015
00016 json target = R"(
00017 {
00018 "baz": "boo",
00019 "hello": [
00020 "world"
00021 ]
00022 }
00023 )"_json;
00024
00025
00026 json patch = json::diff(source, target);
00027
00028
00029 json patched_source = source.patch(patch);
00030
00031
00032 std::cout << std::setw(4) << patch << "\n\n"
00033 << std::setw(4) << patched_source << std::endl;
00034 }