Local convenience functions
| 1646 | |
| 1647 | // Local convenience functions |
| 1648 | static int stringToInteger(const std::string& string, bool* ok) { |
| 1649 | int value = 0; |
| 1650 | *ok = true; |
| 1651 | try { |
| 1652 | value = std::stoi(string); |
| 1653 | } catch (const std::invalid_argument&) { |
| 1654 | *ok = false; |
| 1655 | } catch (const std::out_of_range&) { |
| 1656 | *ok = false; |
| 1657 | } |
| 1658 | return value; |
| 1659 | } |
| 1660 | |
| 1661 | static double stringToDouble(const std::string& string, bool* ok) { |
| 1662 | double value = 0; |
no outgoing calls
no test coverage detected