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

Method string_to_int

OpenHD/ohd_common/src/openhd_util.cpp:132–140  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

130 return matched;
131}
132std::optional<int> OHDUtil::string_to_int(const std::string& s) {
133 try {
134 auto ret = std::stoi(s);
135 return ret;
136 } catch (...) {
137 openhd::log::get_default()->warn("Cannot convert [{}] to int", s);
138 return std::nullopt;
139 }
140}
141
142std::optional<long> OHDUtil::string_to_long(const std::string& s) {
143 try {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected