Taxonomy Categories:
Member Functions:
Interface Category:
API.
Inherits From:
TTextMatch
Inherited By:
None.
Purpose:
Allows you to create a set of alternate text strings for alternate matching during scanning. For example, you can provide alternate matches so that he and she are considered equivalent.
Instantiation:
Allocate on the heap or the stack.
Deriving Classes:
Clients that want a different algorithm for matching alternative text strings should derive from this class.
Concurrency:
Not multithread safe.
Resource Use:
No special requirements.
virtual ~ TAlternateTextMatch ()
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.
TAlternateTextMatch & operator =(const TAlternateTextMatch & toCopy)
Interface Category:
API.
Purpose:
Assignment operator.
Calling Context:
Called when an object is assigned to another compatible object.
Parameters:
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.
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.
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.
virtual long Hash () const
Interface Category:
API.
Purpose:
Generates a hash value.
Calling Context:
Called to generate a hash value.
Parameters:
Return Value:
The numeric value of the hash.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
virtual void AddAlternateText (const TText & newText)
Interface Category:
API.
Purpose:
Adds a text string to the set of alternate text matches. The text match object makes a copy of the text string passed in, and owns the storage for it.
Calling Context:
Call this function directly.
Parameters:
- const TText & newText -The text string to add.
Return Value:
None.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
virtual void ClearAllText ()
Interface Category:
API.
Purpose:
Deletes all the text strings attached as alternates to this object.
Calling Context:
Called to delete all matches; for example, to reuse this object.
Parameters:
Return Value:
None.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
Member Function: TAlternateTextMatch::CreateAlternateTextIterator
virtual TIterator * CreateAlternateTextIterator () const
Interface Category:
API.
Purpose:
Creates an iterator to iterate over the TDeque containing the set of alternate text matches.
Calling Context:
Called by Match.
Parameters:
Return Value:
An iterator to iterate over the set of alternate text matches.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
The caller is responsible for deleting this iterator when done. If the set of alternate matches changes, a new iterator must be created.
virtual bool Match (const TText & targetText, TTextCount & matchLength) const
Interface Category:
API.
Purpose:
Determines whether a particular text string has a match in the set of alternate text matches. This function iterates through the list of alternate text strings. If a match i s found, it returns true and sets matchLength to the number of characters matched.
Calling Context:
Called during scanning operation.
Parameters:
- const TText & targetText -The text string to check for a match.
- TTextCount & matchLength -The number of characters matched.
Return Value:
Returns true if a match for the string is found.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
- TAlternateTextMatch ()
- TAlternateTextMatch (TTextOrder * textOrderToAdopt)
- TAlternateTextMatch (const TAlternateTextMatch & toCopy)
Interface Category:
API.
Purpose:
- Default constructor.
- Constructor with a specific text order.
- Copy constructor.
Calling Context:
- Called by the stream-in operators.
- Called when user wants to specify a text order.
- Called to copy an object.
Parameters:
- Takes no parameters.
- TTextOrder * textOrderToAdopt -The text order to be used for text matching.
- const TAlternateTextMatch & toCopy -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.