clear.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 values
00008     json j_null;
00009     json j_boolean = true;
00010     json j_number_integer = 17;
00011     json j_number_float = 23.42;
00012     json j_object = {{"one", 1}, {"two", 2}};
00013     json j_array = {1, 2, 4, 8, 16};
00014     json j_string = "Hello, world";
00015 
00016     // call clear()
00017     j_null.clear();
00018     j_boolean.clear();
00019     j_number_integer.clear();
00020     j_number_float.clear();
00021     j_object.clear();
00022     j_array.clear();
00023     j_string.clear();
00024 
00025     // serialize the cleared values()
00026     std::cout << j_null << '\n';
00027     std::cout << j_boolean << '\n';
00028     std::cout << j_number_integer << '\n';
00029     std::cout << j_number_float << '\n';
00030     std::cout << j_object << '\n';
00031     std::cout << j_array << '\n';
00032     std::cout << j_string << '\n';
00033 }


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