MCPcopy Create free account
hub / github.com/ObEngine/ObEngine / is_int

Function is_int

extlibs/vili/src/utils.cpp:24–33  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

22 }
23
24 bool is_int(const std::string& str)
25 {
26 if (!str.empty())
27 {
28 if (str.substr(0, 1) == "-")
29 return std::all_of(str.begin() + 1, str.end(), is_digit);
30 return std::all_of(str.begin(), str.end(), is_digit);
31 }
32 return false;
33 }
34
35 bool is_float(const std::string& str)
36 {

Callers 1

value_typeFunction · 0.85

Calls 4

substrMethod · 0.80
emptyMethod · 0.45
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected