| 140 | } |
| 141 | |
| 142 | void 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. |
| 153 | void ckpt_json_array_size(struct ParseState* Parser, struct Value* ReturnValue, struct Value** Param, int NumArgs) |