MCPcopy Create free account
hub / github.com/danielaparker/jsoncons / jsonpointer_get_examples

Function jsonpointer_get_examples

examples/src/jsonpointer_examples.cpp:343–369  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

341}
342
343void jsonpointer_get_examples()
344{
345 {
346 json j(jsoncons::json_array_arg, {"baz","foo"});
347 json& item = jsonpointer::get(j,"/0");
348 std::cout << "(1) " << item << '\n';
349 }
350 {
351 const json j(jsoncons::json_array_arg, {"baz","foo"});
352 const json& item = jsonpointer::get(j,"/1");
353 std::cout << "(2) " << item << '\n';
354 }
355 {
356 json j(jsoncons::json_array_arg, {"baz","foo"});
357
358 std::error_code ec;
359 json& item = jsonpointer::get(j,"/1",ec);
360 std::cout << "(4) " << item << '\n';
361 }
362 {
363 const json j(jsoncons::json_array_arg, {"baz","foo"});
364
365 std::error_code ec;
366 const json& item = jsonpointer::get(j,"/0",ec);
367 std::cout << "(5) " << item << '\n';
368 }
369}
370
371void jsonpointer_address_example()
372{

Callers 1

mainFunction · 0.85

Calls 1

getFunction · 0.50

Tested by

no test coverage detected