| Home · All Classes · Main Classes · Deprecated |
MCollator is a MLocale dependant class that is used to do locale aware string comparisons. More...
Public Member Functions | |
| MCollator () | |
| MCollator (const MLocale &locale) | |
| MCollator (const MCollator &other) | |
| virtual | ~MCollator () |
| bool | operator() (const QString &s1, const QString &s2) const |
| MCollator & | operator= (const MCollator &other) |
Static Public Member Functions | |
| static MLocale::Comparison | compare (const QString &first, const QString &second) |
| static MLocale::Comparison | compare (MLocale &locale, const QString &first, const QString &second) |
MCollator is a MLocale dependant class that is used to do locale aware string comparisons.
MCollator can be created using MLocale::collator(). It is used as a functor or with the comparison methods.
Example:
MLocale loc; // default locale MCollator comp = loc.collator(); QStringList stringList; stringList << "bb" << "da" << "aa" << "ab"; qSort(stringList.begin(), stringList.end(), comp); // sorts the list
| MCollator::MCollator | ( | ) |
Constructor, gets locale data from default locale.
| MCollator::MCollator | ( | const MLocale & | locale | ) |
Constructor, creates a collator based on given MLocale.
| MCollator::MCollator | ( | const MCollator & | other | ) |
Copy constructor.
| MCollator::~MCollator | ( | ) | [virtual] |
| MLocale::Comparison MCollator::compare | ( | const QString & | first, | |
| const QString & | second | |||
| ) | [static] |
Compares two strings with the default MLocale.
| MLocale::Comparison MCollator::compare | ( | MLocale & | locale, | |
| const QString & | first, | |||
| const QString & | second | |||
| ) | [static] |
Compares two strings using the given locale.
operator () works as lessThan comparison.
Returns true if first string is less than the second
| Copyright © 2010 Nokia Corporation | MeeGo Touch |