MCPcopy Create free account
hub / github.com/OpenHD/OpenHD / string_to_long

Method string_to_long

OpenHD/ohd_common/src/openhd_util.cpp:142–150  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

140}
141
142std::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
152std::optional<float> OHDUtil::string_to_float(const std::string& s) {
153 try {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected