| 95 | } |
| 96 | |
| 97 | static std::shared_ptr<IValue*> jsonToPredicateList(json& arr) { |
| 98 | size_t count = arr.is_array() ? arr.size() : 0; |
| 99 | IValue** valueArray = new IValue*[count]; |
| 100 | |
| 101 | for (size_t i = 0; i < count; i++) { |
| 102 | valueArray[i] = CreateValue( |
| 103 | arr[i]["category"], |
| 104 | arr[i]["id"], |
| 105 | "category"); |
| 106 | } |
| 107 | |
| 108 | return std::shared_ptr<IValue*>(valueArray, [count](IValue** del) { |
| 109 | for (size_t i = 0; i < count; i++) { |
| 110 | del[i]->Release(); |
| 111 | } |
| 112 | delete[] del; |
| 113 | }); |
| 114 | } |
| 115 | |
| 116 | static json getEnvironment(Context& context) { |
| 117 | return { |
no test coverage detected