--- trunk/src/utils/StringUtils.cpp 2005/03/08 21:07:34 406 +++ trunk/src/utils/StringUtils.cpp 2006/01/09 19:11:52 838 @@ -178,7 +178,7 @@ namespace oopse { return 0; } - std::string OOPSE_itoa(int value, unsigned int base = 10) { + std::string OOPSE_itoa(int value, unsigned int base) { const char digitMap[] = "0123456789abcdef"; std::string buf; @@ -217,4 +217,20 @@ namespace oopse { return str.substr(0, str.find('.')); } +bool isInteger(const std::string& str) { + + bool result = false; + + std::string::const_iterator i = str.begin(); + if (i != str.end() && (*i == '+' || *i == '-' || std::isdigit(*i) )) { + ++i; + while (i != str.end() && std::isdigit(*i)) + ++i; + if (i == str.end()) + result = true; + } + + return result; } + +}