#include <NCTableSort.h>
Public Member Functions | |
Compare (int sortCol, bool reverse) | |
bool | operator() (YItem *item1, YItem *item2) const |
Protected Member Functions | |
std::wstring | smartSortKey (YItem *item) const |
long long | toNumber (const std::wstring &str, bool *ok) const |
Protected Attributes | |
const int | _sortCol |
const bool | _reverse |
Comparison functor.
This uses the sort key of the cell if it has one, the label if not.
It also tries to convert strings to numbers to do a numeric comparison if possible.
bool NCTableSortDefault::Compare::operator() | ( | YItem * | item1, |
YItem * | item2 ) const |
The comparison itself: Return the result of item1 < item2
|
protected |
Return the sort key of column no. _sortCol for an item or, if it doesn't have one, its label in that column.
|
protected |
Try to convert a string to a number. Return the number and set the 'ok' flag to 'true' on success, to 'false' on failure.