| 231 | }; |
| 232 | |
| 233 | static cmJSONHelper<int> Int( |
| 234 | JsonErrors::ErrorGenerator const& error = JsonErrors::INVALID_INT, |
| 235 | int defval = 0) |
| 236 | { |
| 237 | return [error, defval](int& out, Json::Value const* value, |
| 238 | cmJSONState* state) -> bool { |
| 239 | if (!value) { |
| 240 | out = defval; |
| 241 | return true; |
| 242 | } |
| 243 | if (!value->isInt()) { |
| 244 | error(value, state); |
| 245 | return false; |
| 246 | } |
| 247 | out = value->asInt(); |
| 248 | return true; |
| 249 | }; |
| 250 | } |
| 251 | |
| 252 | static cmJSONHelper<int> Int(int defval) |
| 253 | { |
no test coverage detected