| 1305 | } |
| 1306 | |
| 1307 | Int TOPPBase::getIntOption_(const String& name) const |
| 1308 | { |
| 1309 | const ParameterInformation& p = findEntry_(name); |
| 1310 | if (p.type != ParameterInformation::INT) |
| 1311 | { |
| 1312 | throw WrongParameterType(__FILE__, __LINE__, OPENMS_PRETTY_FUNCTION, name); |
| 1313 | } |
| 1314 | if (p.required && getParam_(name).isEmpty()) |
| 1315 | { |
| 1316 | throw RequiredParameterNotGiven(__FILE__, __LINE__, OPENMS_PRETTY_FUNCTION, name); |
| 1317 | } |
| 1318 | Int tmp = getParamAsInt_(name, (Int)p.default_value); |
| 1319 | // not checking if NAN here (as done with double, as NAN is not supported for Int) |
| 1320 | writeDebug_(String("Value of int option '") + name + "': " + String(tmp), 1); |
| 1321 | |
| 1322 | //check if in valid range |
| 1323 | if (p.required || (!getParam_(name).isEmpty() && tmp != (Int)p.default_value)) |
| 1324 | { |
| 1325 | if (tmp < p.min_int || tmp > p.max_int) |
| 1326 | { |
| 1327 | throw InvalidParameter(__FILE__, __LINE__, OPENMS_PRETTY_FUNCTION, String("Invalid value '") + tmp + "' for integer parameter '" + name + "' given. Out of valid range: '" + p.min_int + "'-'" + p.max_int + "'."); |
| 1328 | } |
| 1329 | } |
| 1330 | |
| 1331 | return tmp; |
| 1332 | } |
| 1333 | |
| 1334 | void TOPPBase::fileParamValidityCheck_(const StringList& param_value, const String& param_name, const ParameterInformation& p) const |
| 1335 | { |