| 207 | }; |
| 208 | |
| 209 | static cmJSONHelper<std::string> String( |
| 210 | JsonErrors::ErrorGenerator const& error = JsonErrors::INVALID_STRING, |
| 211 | std::string const& defval = "") |
| 212 | { |
| 213 | return [error, defval](std::string& out, Json::Value const* value, |
| 214 | cmJSONState* state) -> bool { |
| 215 | if (!value) { |
| 216 | out = defval; |
| 217 | return true; |
| 218 | } |
| 219 | if (!value->isString()) { |
| 220 | error(value, state); |
| 221 | return false; |
| 222 | } |
| 223 | out = value->asString(); |
| 224 | return true; |
| 225 | }; |
| 226 | }; |
| 227 | |
| 228 | static cmJSONHelper<std::string> String(std::string const& defval) |
| 229 | { |
searching dependent graphs…