20 #ifndef __COMMON_UTIL_H 21 # define __COMMON_UTIL_H 39 inline bool isTrue(QString
const & str)
41 return str ==
"1" || str.toLower() ==
"yes" || str.toLower() ==
"true" || str.toLower() ==
"on";
54 return str ==
"0" || str.toLower() ==
"no" || str.toLower() ==
"false" || str.toLower() ==
"off";
bool isTrue(QString const &str)
Tests if the string means 'true'.
bool isFalse(QString const &str)
Tests if the string means 'false'.
COMMON_EXPORT QString strFromEscapedCharArray(QByteArray const &str)
Converts escaped 7-bit character arrays to unicode string.
COMMON_EXPORT QByteArray binFromEscapedCharArray(QByteArray const &str)
Converts escaped 7-bit character arrays to binary arrays.
COMMON_EXPORT QByteArray strToEscapedCharArray(QString const &str)
Converts unicode strings to escaped 7-bit character arrays.
COMMON_EXPORT QByteArray binToEscapedCharArray(QByteArray const &src)
Converts binary arrays to escaped 7-bit character arrays.
COMMON_EXPORT QVariant toVariant(QString const &value, QVariant const &defaultValue)
Converts strings to variant values.