MCPcopy Create free account
hub / github.com/build2/build2 / json_object_append

Function json_object_append

libbuild2/variable.cxx:2460–2482  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2458 }
2459
2460 static void
2461 json_object_append (value& v, names&& ns, const variable* var)
2462 {
2463 using val_traits = value_traits<json_value>;
2464 using obj_traits = value_traits<json_object>;
2465
2466 try
2467 {
2468 obj_traits::append (v, val_traits::convert (move (ns)));
2469 }
2470 catch (const invalid_argument& e)
2471 {
2472 // Note: ns is not guaranteed to be valid.
2473 //
2474 diag_record dr (fail);
2475 dr << "invalid json object";
2476
2477 if (var != nullptr)
2478 dr << " in variable " << var->name;
2479
2480 dr << ": " << e;
2481 }
2482 }
2483
2484 static void
2485 json_object_prepend (value& v, names&& ns, const variable* var)

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected