• Home
  • Raw
  • Download

Lines Matching full:json

2 //  __|  |   __|     |   | |  JSON for Modern C++ (supporting code)
4 // |_____|_____|_____|_|___| https://github.com/nlohmann/json
18 #include <nlohmann/json.hpp>
19 using nlohmann::json;
23 SECTION("empty JSON Pointer")
25 json const j = 1;
27 …OWS_WITH_AS(s = j.get<std::string>(), "[json.exception.type_error.302] type must be string, but is…
32 json j;
35 …a"]["b"]["c"].get<std::string>(), "[json.exception.type_error.302] (/a/b/c) type must be string, b…
40 json j;
42 …WITH_AS(j["object"].at("not_found"), "[json.exception.out_of_range.403] (/object) key 'not_found' …
47 json j;
49 …K_THROWS_WITH_AS(j["array"].at(5), "[json.exception.out_of_range.401] (/array) array index 5 is ou…
54 json j;
56 …AS(j["array"][4][5], "[json.exception.type_error.305] (/array/4) cannot use operator[] with a nume…
61 json j;
62 j["array"] = json::array();
63 …(j["array"].erase(j.begin()), "[json.exception.invalid_iterator.202] (/array) iterator does not fi…
66 SECTION("JSON Pointer escaping")
68 json j;
71 …/b"]["m~n"].get<std::string>(), "[json.exception.type_error.302] (/a~1b/m~0n) type must be string,…
76 json _;
77json::parse(""), "[json.exception.parse_error.101] parse error at line 1, column 1: attempting to …
82 json j = {{"foo", "bar"}};
83 json k = {{"bla", 1}};
85 …(k["bla"].begin(), k["bla"].end()), "[json.exception.type_error.312] (/bla) cannot use update() wi…
86 …_THROWS_WITH_AS(j.update(k["bla"]), "[json.exception.type_error.312] (/bla) cannot use update() wi…
92 …SECTION("Regression test for https://github.com/nlohmann/json/pull/2562#pullrequestreview-57485844…
94 …CHECK_THROWS_WITH_AS(json({"0", "0"})[1].get<int>(), "[json.exception.type_error.302] (/1) type mu…
95 …CHECK_THROWS_WITH_AS(json({"0", "1"})[1].get<int>(), "[json.exception.type_error.302] (/1) type mu…
98 …SECTION("Regression test for https://github.com/nlohmann/json/pull/2562/files/380a613f2b5d32425021…
100 json j;
102 …ECK_THROWS_WITH_AS(j.unflatten(), "[json.exception.type_error.315] (/~1foo) values in object must …
109 json j_arr = json::array();
110 j_arr.push_back(json::object());
111 j_arr.push_back(json::object());
112 j_arr.push_back(json::object());
113 j_arr.push_back(json::object());
114 json j_obj = json::object();
120 json j_arr = json::array();
121 auto object = json::object();
126 json j_obj = json::object();
132 json j_arr = json::array();
133 j_arr.emplace_back(json::object());
134 j_arr.emplace_back(json::object());
135 j_arr.emplace_back(json::object());
136 j_arr.emplace_back(json::object());
137 json j_obj = json::object();
143 json j_arr = json::array();
144 j_arr.insert(j_arr.begin(), json::object());
145 j_arr.insert(j_arr.begin(), json::object());
146 j_arr.insert(j_arr.begin(), json::object());
147 j_arr.insert(j_arr.begin(), json::object());
148 json j_obj = json::object();
154 json j_arr = json::array();
155 j_arr.insert(j_arr.begin(), 2, json::object());
156 json j_obj = json::object();
162 json j_arr = json::array();
163 json j_objects = {json::object(), json::object()};
165 json j_obj = json::object();
184 json j = json::object();
187 json j2 = json::object();
195 …K_THROWS_WITH_AS(constJ["one"].at(0), "[json.exception.type_error.304] (/one) cannot use at() with…
200 json j = json::object();
203 json j2 = json::object();
211 …K_THROWS_WITH_AS(constJ["one"].at(0), "[json.exception.type_error.304] (/one) cannot use at() with…
216 json root = json::array();
217 json lower = json::object();
220 json lowest = json::object();
234 json j_arr = json::array();
243 json const j_arr_copy = j_arr;