Changeset 71:415b45c71663 in SMSSender for lib/libutils/src/strutils.cpp


Ignore:
Timestamp:
Feb 7, 2010 10:17:45 PM (12 years ago)
Author:
Sämy Zehnder <saemy.zehnder@…>
Branch:
3.0
Convert:
svn:3639001d-8e34-449c-bb86-3782b86c4877/branches/3.0@70
Message:
  • Reorganized all the libraries. libinterfaces and libgateways are removed now and libdatatypes contains now all these files.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • lib/libutils/src/strutils.cpp

    r41 r71  
    1515
    1616bool 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;
    1920}
    2021
    2122bool 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;
    2426}
Note: See TracChangeset for help on using the changeset viewer.