ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/OpenMD/branches/development/src/utils/StringUtils.cpp
(Generate patch)

Comparing trunk/src/utils/StringUtils.cpp (file contents):
Revision 406 by gezelter, Tue Mar 8 21:07:34 2005 UTC vs.
Revision 838 by tim, Mon Jan 9 19:11:52 2006 UTC

# Line 178 | Line 178 | namespace oopse {
178      return 0;
179    }
180    
181 <  std::string OOPSE_itoa(int value, unsigned int base = 10) {    
181 >  std::string OOPSE_itoa(int value, unsigned int base) {    
182      const char digitMap[] = "0123456789abcdef";
183      std::string buf;
184  
# 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