Changeset 71:415b45c71663 in SMSSender for lib/libutils/src/strutils.cpp
- Timestamp:
- Feb 7, 2010 10:17:45 PM (12 years ago)
- Branch:
- 3.0
- Convert:
- svn:3639001d-8e34-449c-bb86-3782b86c4877/branches/3.0@70
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
lib/libutils/src/strutils.cpp
r41 r71 15 15 16 16 bool StrUtils::isPositiveNumeric(const QString& s){ 17 QString test(s); 18 return test.remove(QRegExp("^\\d+$")) == ""; 17 bool ok; 18 int val = s.toInt(&ok); 19 return ok && val >= 0; 19 20 } 20 21 21 22 bool StrUtils::isNegativeNumeric(const QString& s){ 22 QString test(s); 23 return test.remove(QRegExp("^-\\d+$")) == ""; 23 bool ok; 24 int val = s.toInt(&ok); 25 return ok && val <= 0; 24 26 }
Note: See TracChangeset
for help on using the changeset viewer.