ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/group/trunk/OOPSE-4/src/utils/StringUtils.cpp
(Generate patch)

Comparing trunk/OOPSE-4/src/utils/StringUtils.cpp (file contents):
Revision 2241 by tim, Fri May 27 04:41:34 2005 UTC vs.
Revision 2537 by tim, Mon Jan 9 19:11:52 2006 UTC

# Line 217 | Line 217 | namespace oopse {
217      return str.substr(0, str.find('.'));
218    }
219  
220 + bool isInteger(const std::string& str) {
221 +
222 +    bool result = false;
223 +
224 +    std::string::const_iterator i = str.begin();    
225 +    if (i != str.end() && (*i == '+' || *i == '-' || std::isdigit(*i) )) {
226 +        ++i;        
227 +        while (i != str.end() && std::isdigit(*i))
228 +            ++i;
229 +        if (i == str.end())
230 +            result = true;
231 +    }
232 +    
233 +    return result;
234   }
235 +
236 + }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines