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.
- TSpanTextPatternIterator (const TText * text, const TText & pattern, const ESpanType spanType, const TTextRange & searchRange =TTextRange :: GetMaximumRange ())
- TSpanTextPatternIterator (const TSpanTextPatternIterator &)
Interface Category:
API.
Purpose:
- Constructs an iterator for the specified text object, pattern, type of iteration, and range.
- Copy constructor.
Calling Context:
- Called to instantiate this class.
- Called to copy an object.
Parameters:
- const TText * text -The text to iterate through.
- const TText & pattern -The pattern to search for.
- const ESpanType spanType -The type of iteration, either inclusive or exclusive.
- const TTextRange & searchRange =TTextRange :: GetMaximumRange () -The range of the text to iterate through.
- const TSpanTextPatternIterator & -The object to copy.
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.
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.
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:
- const TText & pattern -The pattern for the iterator to search for.
Return Value:
None.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
Overrides inherited TTextPatternIterator function.
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.
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:
- const TText * text -The text.
- const TTextRange & searchRange -The search range within the text.
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.