| 81 | |
| 82 | |
| 83 | bool 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 | |
| 94 | bool checkIfFloat(const std::string &s) |
nothing calls this directly
no outgoing calls
no test coverage detected