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

Method string_to_long_hex

OpenHD/ohd_common/src/openhd_util.cpp:162–171  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

160}
161
162std::optional<long> OHDUtil::string_to_long_hex(const std::string& s) {
163 if (!contains(s, "0x")) return std::nullopt;
164 try {
165 auto ret = std::stol(s, 0, 16);
166 return ret;
167 } catch (...) {
168 openhd::log::get_default()->warn("Cannot convert [{}] to long (hex)", s);
169 return std::nullopt;
170 }
171}
172
173std::vector<std::string> OHDUtil::split_into_substrings(
174 const std::string& input, const char separator) {

Callers

nothing calls this directly

Calls 1

containsFunction · 0.85

Tested by

no test coverage detected