| 167 | } |
| 168 | |
| 169 | static int assignIntegerFromArg(const Argument &arg, int &integer) |
| 170 | { |
| 171 | if (!arg.isPresent()) { |
| 172 | return 0; |
| 173 | } |
| 174 | try { |
| 175 | integer = stringToNumber<int>(arg.firstValue()); |
| 176 | if (integer < 0) { |
| 177 | throw ConversionException(); |
| 178 | } |
| 179 | } catch (const ConversionException &) { |
| 180 | cerr << Phrases::Error << "The specified number of milliseconds \"" << arg.firstValue() << "\" is no unsigned integer." << Phrases::EndFlush; |
| 181 | return -4; |
| 182 | } |
| 183 | return 0; |
| 184 | } |
| 185 | |
| 186 | int Application::loadConfig() |
| 187 | { |