MCPcopy Create free account
hub / github.com/WarmUpTill/SceneSwitcher / GetInt

Function GetInt

lib/utils/math-helpers.cpp:52–63  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

50}
51
52std::optional<int> GetInt(const std::string &str)
53{
54 char *end = nullptr;
55 int value = (int)std::strtol(str.c_str(), &end, 10);
56
57 if (end != str.c_str() && *end == '\0' && value != INT_MAX &&
58 value != INT_MIN) {
59 return value;
60 }
61
62 return {};
63}
64
65bool DoubleEquals(double left, double right, double epsilon)
66{

Callers 3

IntValueMethod · 0.85
test-math.cppFile · 0.85
SetSourceSettingFunction · 0.85

Calls 1

c_strMethod · 0.45

Tested by

no test coverage detected