Symbian Developer Library

SYMBIAN OS V6.1 EDITION FOR C++

[Index] [Glossary] [Previous] [Next]



Location: collate.h
Link against:

Struct TCollationMethod

TCollationMethod

Support

Supported from 5.1

Description

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


Enumerations


Enum Anonymous

Anonymous

Description

Miscellaneous constants.

EIgnoreNone

Don't ignore any keys (punctuation, etc. is normally ignored).

ESwapCase

Reverse the normal order of upper and lower case for characters differing only in case.

EAccentsBackwards

Compare secondary keys which represent accents in reverse order (from right to left); this is needed for French when comparing words that differ only in accents.

ESwapKana

Reverse the normal order for characters differing only in whether they are katakana or hiragana.

EFoldCase

Fold all characters to lower case before extracting keys; needed for comparison of filenames, for which case is ignored but other tertiary distinctions are not.

[Top]


Data members


iId

TUint iId

Description

The UID of the collation method.


iMainTable

const TCollationKeyTable* iMainTable

Description

The main collation key table; if NULL, use the standard table.


iOverrideTable

const TCollationKeyTable* iOverrideTable

Description

If non-NULL, tailoring for collation keys.


iFlags

TUint iFlags

Description

Flags as defined above.