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

Function flatten_and_unflatten

examples/src/jsonpointer_examples.cpp:448–477  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

446}
447
448void flatten_and_unflatten()
449{
450 json input = json::parse(R"(
451 {
452 "application": "hiking",
453 "reputons": [
454 {
455 "rater": "HikingAsylum",
456 "assertion": "advanced",
457 "rated": "Marilyn C",
458 "rating": 0.90
459 },
460 {
461 "rater": "HikingAsylum",
462 "assertion": "intermediate",
463 "rated": "Hongmin",
464 "rating": 0.75
465 }
466 ]
467 }
468 )");
469
470 json flattened = jsonpointer::flatten(input);
471
472 std::cout << pretty_print(flattened) << "\n\n";
473
474 json unflattened = jsonpointer::unflatten(flattened);
475
476 assert(unflattened == input);
477}
478
479void flatten_and_unflatten2()
480{

Callers 1

mainFunction · 0.70

Calls 4

parseFunction · 0.85
pretty_printFunction · 0.85
flattenFunction · 0.50
unflattenFunction · 0.50

Tested by

no test coverage detected