| 14 | |
| 15 | namespace JsonErrors { |
| 16 | ErrorGenerator EXPECTED_TYPE(std::string const& type) |
| 17 | { |
| 18 | return [type](Json::Value const* value, cmJSONState* state) -> void { |
| 19 | if (state->key().empty()) { |
| 20 | state->AddErrorAtValue(cmStrCat("Expected ", type), value); |
| 21 | return; |
| 22 | } |
| 23 | std::string errMsg = cmStrCat('"', state->key(), "\" expected ", type); |
| 24 | if (value && value->isConvertibleTo(Json::ValueType::stringValue)) { |
| 25 | errMsg = cmStrCat(errMsg, ", got: ", value->asString()); |
| 26 | } |
| 27 | state->AddErrorAtValue(errMsg, value); |
| 28 | }; |
| 29 | } |
| 30 | |
| 31 | void INVALID_STRING(Json::Value const* value, cmJSONState* state) |
| 32 | { |
no test coverage detected
searching dependent graphs…