| 287 | } |
| 288 | |
| 289 | bool cmQtAutoGenerator::InfoT::GetStringConfig(std::string const& key, |
| 290 | std::string& value, |
| 291 | bool required) const |
| 292 | { |
| 293 | { // Try config |
| 294 | std::string const configKey = this->ConfigKey(key); |
| 295 | Json::Value const& jval = this->Json_[configKey]; |
| 296 | if (!jval.isNull()) { |
| 297 | if (!jval.isString()) { |
| 298 | return this->LogError(cmStrCat(configKey, " is not a string.")); |
| 299 | } |
| 300 | value = jval.asString(); |
| 301 | if (required && value.empty()) { |
| 302 | return this->LogError(cmStrCat(configKey, " is empty.")); |
| 303 | } |
| 304 | return true; |
| 305 | } |
| 306 | } |
| 307 | // Try plain |
| 308 | return this->GetString(key, value, required); |
| 309 | } |
| 310 | |
| 311 | bool cmQtAutoGenerator::InfoT::GetBool(std::string const& key, bool& value, |
| 312 | bool required) const |