| 93 | } |
| 94 | |
| 95 | int getArgInt(const std::string &s) |
| 96 | { |
| 97 | std::string value = getArgString(s); |
| 98 | try { |
| 99 | return std::stoi(value); |
| 100 | } catch (...) { // std::invalid_argument or std::out_of_range |
| 101 | std::stringstream ss; |
| 102 | ss << "Invalid value '" << value << "' in command-line argument " << s |
| 103 | << ". Should be an integer"; |
| 104 | postStatusMsg(ss, OSP_LOG_WARNING); |
| 105 | return 0; |
| 106 | } |
| 107 | } |
| 108 | |
| 109 | void initFromCommandLine(int *_ac, const char ***_av) |
| 110 | { |
no test coverage detected