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

Function jsonpointer_address_example

examples/src/jsonpointer_examples.cpp:371–395  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

369}
370
371void jsonpointer_address_example()
372{
373 auto j = json::parse(R"(
374 {
375 "a/b": ["bar", "baz"],
376 "m~n": ["foo", "qux"]
377 }
378 )");
379
380 jsonpointer::json_pointer ptr;
381 ptr /= "m~n";
382 ptr /= "1";
383
384 std::cout << "(1) " << ptr << "\n\n";
385
386 std::cout << "(2)\n";
387 for (const auto& item : ptr)
388 {
389 std::cout << item << "\n";
390 }
391 std::cout << "\n";
392
393 json item = jsonpointer::get(j, ptr);
394 std::cout << "(3) " << item << "\n";
395}
396
397void jsonpointer_address_iterator_example()
398{

Callers 1

mainFunction · 0.85

Calls 2

parseFunction · 0.85
getFunction · 0.50

Tested by

no test coverage detected