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

Function ckpt_json_get_bool

common/script/json_api.cpp:132–140  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

130}
131
132void ckpt_json_get_bool(struct ParseState* Parser, struct Value* ReturnValue, struct Value** Param, int NumArgs)
133{
134 const ScriptArgs args(Parser, Param, NumArgs, "json_get_bool");
135 nlohmann::json* get = tree(args, 0);
136 if (!get->is_boolean()) {
137 args.fail("argument 1 is not a boolean");
138 }
139 ReturnValue->Val->Integer = get->get<bool>() ? 1 : 0;
140}
141
142void ckpt_json_get_string(struct ParseState* Parser, struct Value* ReturnValue, struct Value** Param, int NumArgs)
143{

Callers

nothing calls this directly

Calls 2

treeFunction · 0.85
failMethod · 0.80

Tested by

no test coverage detected