MCPcopy Create free account
hub / github.com/BernardoGiordano/Checkpoint / ckpt_json_object_element

Function ckpt_json_object_element

common/script/json_api.cpp:175–184  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

173}
174
175void ckpt_json_object_element(struct ParseState* Parser, struct Value* ReturnValue, struct Value** Param, int NumArgs)
176{
177 const ScriptArgs args(Parser, Param, NumArgs, "json_object_element");
178 nlohmann::json* get = tree(args, 0);
179 const char* name = args.str(1);
180 if (!get->is_object() || !get->contains(name)) {
181 args.fail("no member '%s'", name);
182 }
183 ReturnValue->Val->Pointer = &(*get)[name];
184}
185
186void ckpt_json_object_key(struct ParseState* Parser, struct Value* ReturnValue, struct Value** Param, int NumArgs)
187{

Callers

nothing calls this directly

Calls 3

treeFunction · 0.85
strMethod · 0.80
failMethod · 0.80

Tested by

no test coverage detected