| 140 | } |
| 141 | |
| 142 | std::optional<long> OHDUtil::string_to_long(const std::string& s) { |
| 143 | try { |
| 144 | auto ret = std::stol(s); |
| 145 | return ret; |
| 146 | } catch (...) { |
| 147 | openhd::log::get_default()->warn("Cannot convert [{}] to long", s); |
| 148 | return std::nullopt; |
| 149 | } |
| 150 | } |
| 151 | |
| 152 | std::optional<float> OHDUtil::string_to_float(const std::string& s) { |
| 153 | try { |
nothing calls this directly
no outgoing calls
no test coverage detected