Lines Matching +full:x +full:- +full:access +full:- +full:token
6 // SPDX-FileCopyrightText: 2013-2023 Niels Lohmann <https://nlohmann.me>
7 // SPDX-License-Identifier: MIT
15 using namespace nlohmann::literals; // NOLINT(google-build-using-namespace)
26 …or.107] parse error at byte 1: JSON pointer must be empty or begin with '/' - was: 'foo'", json::p…
45 … "[json.exception.out_of_range.404] unresolved reference token '10e'", json::out_of_range&);
51 SECTION("nonconst access")
74 // array access
85 CHECK(!j.contains(json::json_pointer("/foo/-")));
87 // checked array access
91 // empty string access
112 // checked access
120 // escaped access
126 // unescaped access to nonexisting values yield object creation
137 CHECK(!j.contains(json::json_pointer("/a/d/-")));
138 CHECK_NOTHROW(j[json::json_pointer("/a/d/-")] = 42);
139 CHECK(!j.contains(json::json_pointer("/a/d/-")));
144 // unresolved access
147 … "[json.exception.out_of_range.404] unresolved reference token 'foo'", json::out_of_range&);
149 … "[json.exception.out_of_range.404] unresolved reference token 'foo'", json::out_of_range&);
153 SECTION("const access")
174 // array access
180 // checked array access
184 // empty string access
195 // checked access
203 // escaped access
207 // unescaped access
211 // unresolved access
214 … "[json.exception.out_of_range.404] unresolved reference token 'foo'", json::out_of_range&);
216 … "[json.exception.out_of_range.404] unresolved reference token 'foo'", json::out_of_range&);
219 SECTION("user-defined string literal")
240 // array access
247 CHECK(!j.contains("/foo/-"_json_pointer));
251 SECTION("array access")
253 SECTION("nonconst access")
258 // check reading access
307 … "[json.exception.out_of_range.404] unresolved reference token '1+1'", json::out_of_range&);
309 … "[json.exception.out_of_range.404] unresolved reference token '1+1'", json::out_of_range&);
314 …msg = std::string("[json.exception.out_of_range.404] unresolved reference token '") + too_large_in…
350 // assign to "-"
351 j["/-"_json_pointer] = 99;
354 // error when using "-" in const object
355 CHECK_THROWS_WITH_AS(j_const["/-"_json_pointer],
356 … "[json.exception.out_of_range.402] array index '-' (3) is out of range", json::out_of_range&);
357 CHECK(!j_const.contains("/-"_json_pointer));
359 // error when using "-" with at
360 CHECK_THROWS_WITH_AS(j.at("/-"_json_pointer),
361 … "[json.exception.out_of_range.402] array index '-' (7) is out of range", json::out_of_range&);
362 CHECK_THROWS_WITH_AS(j_const.at("/-"_json_pointer),
363 … "[json.exception.out_of_range.402] array index '-' (3) is out of range", json::out_of_range&);
364 CHECK(!j_const.contains("/-"_json_pointer));
367 SECTION("const access")
371 // check reading access
386 // assign to "-"
387 CHECK_THROWS_WITH_AS(j["/-"_json_pointer],
388 … "[json.exception.out_of_range.402] array index '-' (3) is out of range", json::out_of_range&);
389 CHECK_THROWS_WITH_AS(j.at("/-"_json_pointer),
390 … "[json.exception.out_of_range.402] array index '-' (3) is out of range", json::out_of_range&);
391 CHECK(!j.contains("/-"_json_pointer));
501 // all numbers -> array
509 // contains a number, but is not a number -> object
542 // empty json_pointer returns the root JSON-object
547 // simple field access
556 // object and children access
563 // check access via const pointer
582 // parent-pointer of the empty json_pointer is empty
618 // empty json_pointer returns the root JSON-object
622 // simple field access
629 // object and children access
642 // list children access
655 …tr_castring[] = "/foo/bar"; // NOLINT(hicpp-avoid-c-arrays,modernize-avoid-c-arrays,cppcoreguideli…
690 …or.107] parse error at byte 1: JSON pointer must be empty or begin with '/' - was: 'foo'", json::p…
692 …or.107] parse error at byte 1: JSON pointer must be empty or begin with '/' - was: 'foo'", json::p…
700 SECTION("less-than comparison")
759 CHECK(j.value(ptr, "x") == j.value(ptr_j, "x"));
760 CHECK(j.value(ptr, "x") == j.value(ptr_oj, "x"));