Class: TAlternateTextMatch

Declaration: Formatter.h

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.

Member Function: TAlternateTextMatch::~TAlternateTextMatch

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.

Member Function: TAlternateTextMatch::operator=

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.

Member Function: TAlternateTextMatch::operator>>=

virtual TStream & operator >>=(TStream & toWhere) const

Interface Category:

API.

Purpose:

Stream-out operator.

Calling Context:

Called to stream out data.

Parameters:

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: TAlternateTextMatch::operator<<=

virtual TStream & operator <<= (TStream & fromWhere)

Interface Category:

API.

Purpose:

Stream-in operator.

Calling Context:

Called to stream in data.

Parameters:

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.

Member Function: TAlternateTextMatch::Hash

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.

Member Function: TAlternateTextMatch::AddAlternateText

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:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TAlternateTextMatch::ClearAllText

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.

Member Function: TAlternateTextMatch::Match

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:

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.

Member Function: TAlternateTextMatch::TAlternateTextMatch

  1. TAlternateTextMatch ()
  2. TAlternateTextMatch (TTextOrder * textOrderToAdopt)
  3. TAlternateTextMatch (const TAlternateTextMatch & toCopy)

Interface Category:

API.

Purpose:

  1. Default constructor.
  2. Constructor with a specific text order.
  3. Copy constructor.

Calling Context:

  1. Called by the stream-in operators.
  2. Called when user wants to specify a text order.
  3. Called to copy an object.

Parameters:

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.