Taxonomy Categories:
Member Functions:
Interface Category:
API.
Inherits From:
MCollectible
Inherited By:
TBitwiseTextOrder
TLanguageTextOrder
Purpose:
TTextOrder is an abstract base class that provides the protocol for comparing two text objects. TTextOrder is used by pattern iterators for searching. Derived classes of TTextOrder encapsulate collation tables for particular sets of characters and provide the mechanism for language-sensitive text ordering. Typically a single text-ordering object encapsulates the collation table for a particular locale.
The comparison functions do not consider style information when performing comparisons.
Instantiation:
TTextOrder is an abstract class that cannot be directly instantiated.
Deriving Classes:
Derived classes must implement the Compare functions and CreateTextPatternIterator.
Language-insensitive text ordering is provided by the concrete derived class TBitwiseTextOrder.
Protocol for language-sensitive text ordering is provided by the derived class TLanguageTextOrder. TTableBasedTextOrder provides a concrete implementation of TLanguageTextOrder.
Concurrency:
Not multithread safe.
Resource Use:
No special requirements.
virtual ~ TTextOrder ()
Interface Category:
API.
Purpose:
Destructor.
Calling Context:
Called to destroy an object.
Parameters:
Return Value:
None.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
Member Function: TTextOrder::Compare
- virtual ETextComparisonResult Compare (const TText & sourceText, const TText & targetText) const
- virtual ETextComparisonResult Compare (const TText & sourceText, const TText & targetText, TTextCount & sourceCharactersMatched, TTextCount & targetCharactersMatched) const
Interface Category:
API.
Purpose:
- Compares two text objects and returns the result as an ETextComparisonResult value.
- Compares two text objects and returns the result as an ETextComparisonResult value. Also fills in the given TTextCounts with the number of characters matched in both the source and the target strings.
Calling Context:
- Called by clients.
- Called by clients.
Parameters:
- const TText & sourceText -The source string for the comparison.
- const TText & targetText -The target string for the comparison.
- const TText & sourceText -The source string for the comparison.
- const TText & targetText -The target string for the comparison.
- TTextCount & sourceCharactersMatched -Variable to be filled in with the number of characters matched in the source string.
- TTextCount & targetCharactersMatched -Variable to be filled in with the number of characters matched in the target string.
Return Value:
The ETextComparisonResult value containing the results of the comparison.
Exceptions:
This function is pure virtual. Overrides might throw exceptions.
Concurrency:
Not multithread safe.
Other Considerations:
This is a pure virtual function and needs to be overridden.
Member Function: TTextOrder::CreateTextPatternIterator
virtual TTextPatternIterator * CreateTextPatternIterator (const TText * text, const TText & pattern, const TTextRange & searchRange) const
Interface Category:
API.
Purpose:
Creates an object of the text pattern iterator class that uses this text ordering class for pattern iteration.
Calling Context:
Called by clients.
Parameters:
- const TText * text -The text object to iterate through.
- const TText & pattern -The pattern to search for.
- const TTextRange & searchRange -The range of the text object to iterate through.
Return Value:
A TTextPatternIterator object.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
This is a pure virtual function and needs to be overridden.
Member Function: TTextOrder::TextIsEqual
virtual bool TextIsEqual (const TText & sourceText, const TText & targetText) const
Interface Category:
API.
Purpose:
Compares two TText objects, returning whether or not they are equal.
Calling Context:
Called by clients.
Parameters:
- const TText & sourceText -The source text string to compare.
- const TText & targetText -The target text string to compare.
Return Value:
Returns true if the text strings are equal.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
This function calls the Compare function. It will consider the strings equal if Compare returns kSourceEqual.
Member Function: TTextOrder::TextIsGreaterThan
virtual bool TextIsGreaterThan (const TText & sourceText, const TText & targetText) const
Interface Category:
API.
Purpose:
Compares two TText objects, returning whether or not the source text is greater than the target text.
Calling Context:
Called by clients.
Parameters:
- const TText & sourceText -The source text string to compare.
- const TText & targetText -The target text string to compare.
Return Value:
Returns true if the source text is greater than the target text.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
This function calls the Compare function. It will consider the source string greater than the target string if Compare returns either kSourcePrimaryGreater, kSourceSecondaryGreater or kSourceTertiaryGreater.
Member Function: TTextOrder::TextIsLessThan
virtual bool TextIsLessThan (const TText & sourceText, const TText & targetText) const
Interface Category:
API.
Purpose:
Compares two TText objects, returning whether or not the source text is less than the target text.
Calling Context:
Called by clients.
Parameters:
- const TText & sourceText -The source text string to compare.
- const TText & targetText -The target text string to compare.
Return Value:
Returns true if the source text is less than the target text.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
This function calls the Compare function. It will consider the source string less than the target string if Compare returns either kSourcePrimaryLess, kSourceSecondaryLess or kSourceTertiaryLess.
Member Function: TTextOrder::GetName
virtual void GetName (TLocalizableName & name) const
Interface Category:
API.
Purpose:
Returns the localizable name for this object.
Calling Context:
Called by clients.
Parameters:
Return Value:
None.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
Member Function: TTextOrder::SetName
virtual void SetName (const TLocalizableName & name)
Interface Category:
API.
Purpose:
Specifies the localizable name for this object.
Calling Context:
Called by clients.
Parameters:
Return Value:
None.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
Member Function: TTextOrder::Hash
virtual long Hash () const
Interface Category:
API.
Purpose:
Generates a hash value.
Calling Context:
Called by clients.
Parameters:
Return Value:
The numeric value of the hash.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
Member Function: TTextOrder::operator=
TTextOrder & operator =(const TTextOrder & order)
Interface Category:
API.
Purpose:
Assignment operator.
Calling Context:
Called when an object is assigned to another compatible object.
Parameters:
- const TTextOrder & order -The source object for the assignment.
Return Value:
A non-const reference to the left-hand side object.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
Member Function: TTextOrder::operator>>=
virtual TStream & operator >>=(TStream & toWhere) const
Interface Category:
API.
Purpose:
Stream-out operator.
Calling Context:
Called to stream out data.
Parameters:
- TStream & toWhere -The stream the object is streamed out to.
Return Value:
Returns a reference to the stream the object streams itself out to.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
Member Function: TTextOrder::operator<<=
virtual TStream & operator <<= (TStream & fromWhere)
Interface Category:
API.
Purpose:
Stream-in operator.
Calling Context:
Called to stream in data.
Parameters:
- TStream & fromWhere -The stream the object is streamed in from.
Return Value:
Returns a reference to the stream the object streams itself in from.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
- TTextOrder ()
- TTextOrder (const TTextOrder & order)
Interface Category:
API.
Purpose:
- Default constructor. This constructor is protected.
- Copy constructor. This constructor is protected.
Calling Context:
- Called by the stream-in operators.
- Called to copy an object.
Parameters:
- Takes no parameters.
- const TTextOrder & order -The object to copy.
Return Value:
None.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
Click the icon to mail questions or corrections about this material to Taligent personnel.
Copyright©1995 Taligent,Inc. All rights reserved.