MCPcopy Create free account
hub / github.com/davidrmiller/biosim4 / checkIfInt

Function checkIfInt

src/params.cpp:83–91  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

81
82
83bool checkIfInt(const std::string &s)
84{
85 //return s.find_first_not_of("-0123456789") == std::string::npos;
86 std::istringstream iss(s);
87 int i;
88 iss >> std::noskipws >> i; // noskipws considers leading whitespace invalid
89 // Check the entire string was consumed and if either failbit or badbit is set
90 return iss.eof() && !iss.fail();
91}
92
93
94bool checkIfFloat(const std::string &s)

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected