basic_json__InputIt_InputIt.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_array = {"alpha", "bravo", "charly", "delta", "easy"};
00009     json j_number = 42;
00010     json j_object = {{"one", "eins"}, {"two", "zwei"}};
00011 
00012     // create copies using iterators
00013     json j_array_range(j_array.begin() + 1, j_array.end() - 2);
00014     json j_number_range(j_number.begin(), j_number.end());
00015     json j_object_range(j_object.begin(), j_object.find("two"));
00016 
00017     // serialize the values
00018     std::cout << j_array_range << '\n';
00019     std::cout << j_number_range << '\n';
00020     std::cout << j_object_range << '\n';
00021 }


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