Class: TSpanTextPatternIterator

Declaration: TextComparison.h

Taxonomy Categories:

Member Functions:


Interface Category:

API.

Inherits From:

TTextPatternIterator

Inherited By:

None.

Purpose:

Derived from TTextPatternIterator, this class iterates over spans of contiguous characters that either include or exclude the characters specified in the pattern. The iteration functions are similar to the C string span functions. For example, if you have the string abczzzdefyyyghixxx and the pattern xyz, inclusive iteration returns the spans zzz, yyy, and xxx, while exclusive iteration returns the spans abc, def, and ghi.

Instantiation:

Allocate on the heap or the stack.

Deriving Classes:

The class is designed to be used directly.

Concurrency:

Not multithread safe.

Resource Use:

No special requirements.

Member Function: TSpanTextPatternIterator::TSpanTextPatternIterator

  1. TSpanTextPatternIterator (const TText * text, const TText & pattern, const ESpanType spanType, const TTextRange & searchRange =TTextRange :: GetMaximumRange ())
  2. TSpanTextPatternIterator (const TSpanTextPatternIterator &)

Interface Category:

API.

Purpose:

  1. Constructs an iterator for the specified text object, pattern, type of iteration, and range.
  2. Copy constructor.

Calling Context:

  1. Called to instantiate this class.
  2. Called to copy an object.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

The type of iteration, either inclusive or exclusive must be specified. There is no default.

Member Function: TSpanTextPatternIterator::~TSpanTextPatternIterator

virtual ~ TSpanTextPatternIterator ()

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: TSpanTextPatternIterator::SetPattern

virtual void SetPattern (const TText & pattern)

Interface Category:

API.

Purpose:

Specifies the pattern for the iterator to search for.

Calling Context:

Called by clients.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

Overrides inherited TTextPatternIterator function.

Member Function: TSpanTextPatternIterator::operator=

const TSpanTextPatternIterator & operator =(const TSpanTextPatternIterator &)

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: TSpanTextPatternIterator::SetText

virtual void SetText (const TText * text, const TTextRange & searchRange)

Interface Category:

API.

Purpose:

Sets the text on which a pattern search, if requested, will be performed.

Calling Context:

Called by clients.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

Overrides inherited TTextPatternIterator function.
Click the icon to mail questions or corrections about this material to Taligent personnel.
Copyright©1995 Taligent,Inc. All rights reserved.