SourcePro® 2022.1 |
SourcePro® API Reference Guide |
Iterates over matches found for a Unicode regular expression pattern. More...
#include <rw/i18n/RWURegexMatchIterator.h>
Public Types | |
typedef std::forward_iterator_tag | iterator_category |
typedef value_type * | pointer |
typedef value_type & | reference |
typedef RWURegexResult | value_type |
Public Member Functions | |
RWURegexMatchIterator () | |
RWURegexMatchIterator (const RWURegexMatchIterator &source) | |
RWURegexMatchIterator (RWURegularExpression ®ex, const RWUString &str) | |
RWURegexMatchIterator (RWURegularExpression ®ex, const RWUString &str, const RWUConstStringIterator &start) | |
RWURegexMatchIterator (RWURegularExpression ®ex, const RWUString &str, const RWUConstStringIterator &start, const RWUConstStringIterator &end, bool overlap=false) | |
~RWURegexMatchIterator () | |
bool | operator!= (const RWURegexMatchIterator &rhs) const |
RWURegexResult | operator* () const |
RWURegexMatchIterator & | operator++ () |
RWURegexMatchIterator | operator++ (int) |
const RWURegexResult * | operator-> () const |
RWURegexMatchIterator & | operator= (const RWURegexMatchIterator &rhs) |
bool | operator== (const RWURegexMatchIterator &rhs) const |
RWURegexMatchIterator provides a convenient interface for finding all successive matches of a particular regular expression pattern in a string. RWURegexMatchIterator is a forward iterator, allowing forward searches over the specified string using pre-increment and post-increment operators
By default, only non-overlapping matches are reported, but this behavior can be changed in the constructor.
Program output:
typedef std::forward_iterator_tag RWURegexMatchIterator::iterator_category |
Tags this class as a C++ Standard Library-compatible forward iterator.
typedef value_type* RWURegexMatchIterator::pointer |
Declares an alias for the value pointer type.
Declares an alias for the value reference type.
Declares an alias for the value type returned by operator*().
RWURegexMatchIterator::RWURegexMatchIterator | ( | ) |
Default constructor. Creates an invalid iterator, which can be used to test for the end-of-iteration condition.
RWURegexMatchIterator::RWURegexMatchIterator | ( | const RWURegexMatchIterator & | source | ) |
Copy constructor.
RWURegexMatchIterator::RWURegexMatchIterator | ( | RWURegularExpression & | regex, |
const RWUString & | str | ||
) |
Creates a match iterator from regular expression object regex and search string str. The entire search string is considered for a match. Only non-overlapping matches are reported.
RWURegexMatchIterator::RWURegexMatchIterator | ( | RWURegularExpression & | regex, |
const RWUString & | str, | ||
const RWUConstStringIterator & | start | ||
) |
Creates a match iterator from regular expression object regex, search string str, and starting position start. The string is searched from the specified starting position to the end of the string. Only non-overlapping matches are reported.
RWURegexMatchIterator::RWURegexMatchIterator | ( | RWURegularExpression & | regex, |
const RWUString & | str, | ||
const RWUConstStringIterator & | start, | ||
const RWUConstStringIterator & | end, | ||
bool | overlap = false |
||
) |
Creates a match iterator from regular expression object regex, search string str, starting position start, ending position end, and an overlap flag indicating whether or not to report overlapping matches. The string is searched from the specified starting position to the specified ending position. By default, only non-overlapping matches are reported.
RWURegexMatchIterator::~RWURegexMatchIterator | ( | ) |
Destructor.
bool RWURegexMatchIterator::operator!= | ( | const RWURegexMatchIterator & | rhs | ) | const |
Compares two iterators for inequality. Returns true
if self and rhs reference different regular expression pattern or search strings, or the position in the search string is different; otherwise, false
.
RWURegexResult RWURegexMatchIterator::operator* | ( | ) | const |
Dereference operator. Returns an RWURegexResult instance describing the current match.
RWURegexMatchIterator& RWURegexMatchIterator::operator++ | ( | ) |
Prefix increment operator. Advances self to the next occurrence of a match of the regular expression pattern in the search string, and returns a reference to self.
RWURegexMatchIterator RWURegexMatchIterator::operator++ | ( | int | ) |
Postfix increment operator. Advances self to the next occurrence of a match of the regular expression pattern in the search string, and returns a copy of the previous value of self.
const RWURegexResult* RWURegexMatchIterator::operator-> | ( | ) | const |
Returns a pointer to an RWURegexResult instance describing the current match. This pointer is valid only for the lifetime of the RWURegexMatchIterator instance from which it is obtained. The contents will change with any call to the prefix or postfix increment operators.
RWURegexMatchIterator& RWURegexMatchIterator::operator= | ( | const RWURegexMatchIterator & | rhs | ) |
Assignment operator. Assigns self the value of the rhs iterator. Makes a deep copy of all data, except self references the same regular expression and search string as rhs.
bool RWURegexMatchIterator::operator== | ( | const RWURegexMatchIterator & | rhs | ) | const |
Compares two iterators for equality. Returns true
if self and rhs reference the same regular expression pattern and search strings, and the position in the search string is the same; otherwise, false
.
Copyright © 2022 Rogue Wave Software, Inc., a Perforce company. All Rights Reserved. |