git-svn-id: svn://db.shs.com.ru/pip@274 12ceb7fc-bf1f-11e4-8940-5bc7170c53b5
This commit is contained in:
@@ -613,6 +613,14 @@ bool PIString::endsWith(const PIString & str) const {
|
||||
}
|
||||
|
||||
|
||||
bool PIString::toBool() const {
|
||||
PIString s(*this);
|
||||
s = s.trimmed().toLowerCase();
|
||||
if ( atof(s.toNativeDecimalPoints().data()) > 0. || s == "true" || s == "yes" || s == "on" || s == "ok") return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
PIString PIString::takeSymbol() {
|
||||
PIString ret;
|
||||
int sz = size_s(), ss = -1;
|
||||
|
||||
@@ -578,7 +578,7 @@ public:
|
||||
|
||||
|
||||
//! \brief Return \c true if string equal "true", "yes", "on" or positive not null numeric value
|
||||
bool toBool() const {PIString s(*this); if (atof(s.toNativeDecimalPoints().data()) > 0. || s.trimmed().toLowerCase() == "true" || s.trimmed().toLowerCase() == "yes" || s.trimmed().toLowerCase() == "on") return true; return false;}
|
||||
bool toBool() const;
|
||||
|
||||
//! \brief Return \c char numeric value of string
|
||||
char toChar() const;
|
||||
|
||||
Reference in New Issue
Block a user