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


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