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

Function isStringInt

src/Core/Utils/StringUtils.cpp:50–62  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

48 }
49
50 bool isStringInt(const std::string& str)
51 {
52 if (!str.empty())
53 {
54 if (str.substr(0, 1) == "-")
55 {
56 std::string withoutSign = str.substr(1);
57 return all_of(withoutSign.begin(), withoutSign.end(), isdigit);
58 }
59 return all_of(str.begin(), str.end(), isdigit);
60 }
61 return false;
62 }
63
64 bool isStringFloat(const std::string& str)
65 {

Callers 1

isStringNumericFunction · 0.85

Calls 4

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

Tested by

no test coverage detected