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 j_flattened =
00009 {
00010 {"/answer/everything", 42},
00011 {"/happy", true},
00012 {"/list/0", 1},
00013 {"/list/1", 0},
00014 {"/list/2", 2},
00015 {"/name", "Niels"},
00016 {"/nothing", nullptr},
00017 {"/object/currency", "USD"},
00018 {"/object/value", 42.99},
00019 {"/pi", 3.141}
00020 };
00021
00022
00023 std::cout << std::setw(4) << j_flattened.unflatten() << '\n';
00024 }