| 382 | } |
| 383 | |
| 384 | bool TryParseInteger(cmExecutionStatus& status, std::string const& str, int& i) |
| 385 | { |
| 386 | try { |
| 387 | i = std::stoi(str); |
| 388 | } catch (std::invalid_argument const&) { |
| 389 | status.SetError(cmStrCat("Invalid integer: '", str, '\'')); |
| 390 | cmSystemTools::SetFatalErrorOccurred(); |
| 391 | return false; |
| 392 | } catch (std::out_of_range const&) { |
| 393 | status.SetError(cmStrCat("Integer out of range: '", str, '\'')); |
| 394 | cmSystemTools::SetFatalErrorOccurred(); |
| 395 | return false; |
| 396 | } |
| 397 | |
| 398 | return true; |
| 399 | } |
| 400 | |
| 401 | } // anonymous namespace |
| 402 |
no test coverage detected
searching dependent graphs…