Location:
collate.h
Link against:
TCollationMethod
Supported from 5.1
Defines a collation method. Collation means sorting pieces of text. It needs to take into account characters, accents and case; spaces and punctuation are usually ignored. It differs from ordinary methods of sorting in that it is locale-dependent — different languages use different ordering methods. Additionally, multiple collation methods may exist within the same locale.
A collation method provides the collation keys and other data
needed to customise collation; the Mem
and TDesC16
collation functions (e.g. Mem::CompareC()
) perform the collation.
Note that these functions use the standard collation method for the current
locale — you only need to specify an object of class
TCollationMethod
to customise this collation scheme. Collation
methods can be retrieved using member functions of the Mem
class.
Each one has a unique identifier.
A collation method specifies a main table of collation keys, and
optionally an overriding table that contains keys for which the values in the
main table are overridden. A collation key table
(TCollationKeyTable
) is the set of collation keys: primary (basic
character identity), secondary (accents and diacritics) and tertiary (case).
The quaternary key is the Unicode character values themselves.
The simplest way to customise a collation method is to create a local copy of the standard collation method and change it. For example, you could use the standard method, but not ignore punctuation and spaces:
TCollationMethod m = *Mem::CollationMethodByIndex(0); // get the standard method
m.iFlags |= TCollationMethod::EIgnoreNone; // dont ignore punctuation and spaces
Defined in TCollationMethod
:
Anonymous
, EAccentsBackwards
, EFoldCase
, EIgnoreNone
, ESwapCase
, ESwapKana
, iFlags
, iId
, iMainTable
, iOverrideTable
Anonymous
Miscellaneous constants.
|
const TCollationKeyTable* iMainTable
The main collation key table; if NULL, use the standard table.
TUint iFlags
Flags as defined above.