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_array = {"alpha", "bravo", "charly", "delta", "easy"};
00009 json j_number = 42;
00010 json j_object = {{"one", "eins"}, {"two", "zwei"}};
00011
00012
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
00018 std::cout << j_array_range << '\n';
00019 std::cout << j_number_range << '\n';
00020 std::cout << j_object_range << '\n';
00021 }