| 172 | .Bind("value"_s, &CacheVariable::Value, VariableValueHelper); |
| 173 | |
| 174 | bool VariableHelper(cm::optional<CacheVariable>& out, Json::Value const* value, |
| 175 | cmJSONState* state) |
| 176 | { |
| 177 | if (value->isBool()) { |
| 178 | out = CacheVariable{ |
| 179 | /*Type=*/"BOOL", |
| 180 | /*Value=*/value->asBool() ? "TRUE" : "FALSE", |
| 181 | }; |
| 182 | return true; |
| 183 | } |
| 184 | if (value->isString()) { |
| 185 | out = CacheVariable{ |
| 186 | /*Type=*/"", |
| 187 | /*Value=*/value->asString(), |
| 188 | }; |
| 189 | return true; |
| 190 | } |
| 191 | if (value->isObject()) { |
| 192 | out.emplace(); |
| 193 | return VariableObjectHelper(*out, value, state); |
| 194 | } |
| 195 | if (value->isNull()) { |
| 196 | out = cm::nullopt; |
| 197 | return true; |
| 198 | } |
| 199 | cmCMakePresetsErrors::INVALID_VARIABLE(value, state); |
| 200 | return false; |
| 201 | } |
| 202 | |
| 203 | auto const VariablesHelper = |
| 204 | JSONHelperBuilder::Map<cm::optional<CacheVariable>>( |
nothing calls this directly
no test coverage detected
searching dependent graphs…