MCPcopy Create free account
hub / github.com/Cantera/cantera / isInt

Function isInt

src/base/AnyMap.cpp:75–95  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

73}
74
75bool isInt(const string& val)
76{
77 string str = ba::trim_copy(val);
78 if (str.empty()) {
79 return false;
80 }
81 int istart = 0;
82 char ch = str[0];
83 if (ch == '+' || ch == '-') {
84 istart = 1;
85 if (str.size() == 1) {
86 return false;
87 }
88 }
89 for (size_t i = istart; i < str.size(); i++) {
90 if (!isdigit(str[i])) {
91 return false;
92 }
93 }
94 return true;
95}
96
97bool isBool(const string& val) {
98 string str = ba::trim_copy(val);

Callers 2

elementTypesFunction · 0.85
decodeMethod · 0.85

Calls 2

emptyMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected