The classes you use to create text-ordering objects provide the lowest level mechanism for comparing text strings. Comparison functions provided by these classes compare character data stored in two different text objects, returning information about whether a string is less than, greater than, or equal to another string.
You can use these functions for simple comparisons and to implement sorting algorithms for text elements. Functions provided by TTableBasedTextOrder are language-sensitive because they perform comparisons according to the rules of a natural language rather than according to the Unicode values. In most cases, the ordering of Unicode values associated with a set of characters does not produce correct ordering results. For example, for ASCII-based character sets, Z is ordered before a, and z is ordered before ñ.
TTextOrder is the abstract base class for comparing two text objects, providing the lowest level mechanism for sorting text elements or searching for specific text. The system includes derived classes that perform both language-sensitive and language-insensitive comparison functions:
- TLanguageTextOrder--Includes the protocol for creating an ordering object for a specific natural language. This class provides the functions for controlling the specificity of the comparison.
- TTableBasedTextOrder--Uses a table of ordering values to provide language-sensitive comparison functions. For any natural language, you can create a table that lists each character or character cluster in increasing order, along with the ordering priority of each relationship within the ordering. See "Using a text ordering object," next, for a description of ordering priorities.
- TBitwiseTextOrder--Provides the protocol for language-insensitive comparison of text strings. TBitwiseTextOrder performs a bitwise comparison of the Unicode values in the text strings.