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

Function ckpt_json_get_string

common/script/json_api.cpp:142–150  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

140}
141
142void ckpt_json_get_string(struct ParseState* Parser, struct Value* ReturnValue, struct Value** Param, int NumArgs)
143{
144 const ScriptArgs args(Parser, Param, NumArgs, "json_get_string");
145 nlohmann::json* get = tree(args, 0);
146 if (!get->is_string()) {
147 args.fail("argument 1 is not a string");
148 }
149 ReturnValue->Val->Pointer = strToRet(get->get_ref<std::string&>());
150}
151
152// nlohmann's size(): array/object element count, 1 for scalars, 0 for null.
153void ckpt_json_array_size(struct ParseState* Parser, struct Value* ReturnValue, struct Value** Param, int NumArgs)

Callers

nothing calls this directly

Calls 3

treeFunction · 0.85
strToRetFunction · 0.85
failMethod · 0.80

Tested by

no test coverage detected