MCPcopy Create free account
hub / github.com/Kitware/CMake / GetStringConfig

Method GetStringConfig

Source/cmQtAutoGenerator.cxx:289–309  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

287}
288
289bool 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
311bool cmQtAutoGenerator::InfoT::GetBool(std::string const& key, bool& value,
312 bool required) const

Callers 2

InitFromInfoMethod · 0.80
InitFromInfoMethod · 0.80

Calls 8

ConfigKeyMethod · 0.95
LogErrorMethod · 0.95
GetStringMethod · 0.95
isNullMethod · 0.80
isStringMethod · 0.80
asStringMethod · 0.80
cmStrCatFunction · 0.70
emptyMethod · 0.45

Tested by

no test coverage detected