unflatten.cpp
Go to the documentation of this file.
00001 #include <json.hpp>
00002 
00003 using json = nlohmann::json;
00004 
00005 int main()
00006 {
00007     // create JSON value
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     // call unflatten()
00023     std::cout << std::setw(4) << j_flattened.unflatten() << '\n';
00024 }


rc_visard_driver
Author(s): Heiko Hirschmueller , Christian Emmerich , Felix Ruess
autogenerated on Thu Jun 6 2019 20:43:07