MCPcopy Create free account
hub / github.com/OpenMS/OpenMS / getStringOption_

Method getStringOption_

src/openms/source/APPLICATIONS/TOPPBase.cpp:1246–1275  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1244 }
1245
1246 String TOPPBase::getStringOption_(const String& name) const
1247 {
1248 const ParameterInformation& p = findEntry_(name);
1249 if (p.type != ParameterInformation::STRING
1250 && p.type != ParameterInformation::INPUT_FILE
1251 && p.type != ParameterInformation::OUTPUT_FILE
1252 && p.type != ParameterInformation::OUTPUT_PREFIX)
1253 {
1254 throw WrongParameterType(__FILE__, __LINE__, OPENMS_PRETTY_FUNCTION, name);
1255 }
1256 if (p.required && (getParam_(name).isEmpty() || getParam_(name) == ""))
1257 {
1258 String message = "'" + name + "'";
1259 if (!p.valid_strings.empty())
1260 {
1261 message += " [valid: " + ListUtils::concatenate(p.valid_strings, ", ") + "]";
1262 }
1263 throw RequiredParameterNotGiven(__FILE__, __LINE__, OPENMS_PRETTY_FUNCTION, message);
1264 }
1265 String tmp = getParamAsString_(name, p.default_value.toString());
1266 writeDebug_(String("Value of string option '") + name + "': " + tmp, 1);
1267
1268 // if required or set by user, do some validity checks
1269 if (p.required || !tmp.empty())
1270 {
1271 fileParamValidityCheck_(tmp, name, p);
1272 }
1273
1274 return tmp;
1275 }
1276
1277 double TOPPBase::getDoubleOption_(const String& name) const
1278 {

Callers 1

main_Method · 0.80

Calls 5

concatenateFunction · 0.85
StringClass · 0.50
isEmptyMethod · 0.45
emptyMethod · 0.45
toStringMethod · 0.45

Tested by

no test coverage detected