SourcePro® 2025.1 |
SourcePro® API Reference Guide |
Iterates over matches found using RWTRegex. More...
#include <rw/tools/regex.h>
Public Member Functions | |
RWTRegexMatchIterator () | |
RWTRegexMatchIterator (const RWTRegexMatchIterator< T > &source) | |
RWTRegexMatchIterator (RWTRegex< T > ®ex, const RChar *str, size_t start=size_t(0), size_t length=size_t(-1), bool overlap=false) | |
RWTRegexMatchIterator (RWTRegex< T > ®ex, const RString &str, size_t start=size_t(0), size_t length=size_t(-1), bool overlap=false) | |
RWTRegexMatchIterator (RWTRegexMatchIterator< T > &&rhs) | |
~RWTRegexMatchIterator () | |
RWTRegexResult< T > | operator* () const |
RWTRegexMatchIterator & | operator++ () |
const RWTRegexMatchIterator | operator++ (int) |
RWTRegexMatchIterator & | operator+= (size_t count) |
const RWTRegexResult< T > * | operator-> () const |
RWTRegexMatchIterator & | operator= (const RWTRegexMatchIterator &rhs) |
RWTRegexMatchIterator & | operator= (RWTRegexMatchIterator< T > &&rhs) |
void | swap (RWTRegexMatchIterator< T > &rhs) |
Friends | |
bool | operator!= (const RWTRegexMatchIterator< T > &lhs, const RWTRegexMatchIterator< T > &rhs) |
bool | operator== (const RWTRegexMatchIterator< T > &lhs, const RWTRegexMatchIterator< T > &rhs) |
Class RWTRegexMatchIterator is an iterator class provided with RWTRegex for iteration over matches of a pattern in a given string.
Program Output:
RWTRegexMatchIterator< T >::RWTRegexMatchIterator | ( | ) |
Default constructor
RWTRegexMatchIterator< T >::RWTRegexMatchIterator | ( | const RWTRegexMatchIterator< T > & | source | ) |
Copy constructor
RWTRegexMatchIterator< T >::RWTRegexMatchIterator | ( | RWTRegexMatchIterator< T > && | rhs | ) |
Move constructor. The constructed instance takes ownership of the data owned by rhs.
RWTRegexMatchIterator< T >::RWTRegexMatchIterator | ( | RWTRegex< T > & | regex, |
const RChar * | str, | ||
size_t | start = size_t(0), | ||
size_t | length = size_t(-1), | ||
bool | overlap = false ) |
Constructor. Initializes a match iterator to the first match in str, starting from the start character offset, of the regular expression pattern given in regex. The parameter length defines the length of str. If not specified, the length is calculated as the number of characters up to the first NULL
character, according to the character traits.
RWTRegexMatchIterator< T >::RWTRegexMatchIterator | ( | RWTRegex< T > & | regex, |
const RString & | str, | ||
size_t | start = size_t(0), | ||
size_t | length = size_t(-1), | ||
bool | overlap = false ) |
Constructor. Initializes a match iterator to the first match in str, starting from the start character offset, of the regular expression pattern given in regex. The parameter length identifies the length of str. If not specified, the length is assigned the length of str.
RWTRegexMatchIterator< T >::~RWTRegexMatchIterator | ( | ) |
Destructor
RWTRegexResult< T > RWTRegexMatchIterator< T >::operator* | ( | ) | const |
Dereferences the iterator, giving a reference to the regular expression object represented in the iterator.
RWTRegexMatchIterator & RWTRegexMatchIterator< T >::operator++ | ( | ) |
Pre-increment operator
const RWTRegexMatchIterator RWTRegexMatchIterator< T >::operator++ | ( | int | ) |
Post-increment operator
RWTRegexMatchIterator & RWTRegexMatchIterator< T >::operator+= | ( | size_t | count | ) |
Advances through count matches.
const RWTRegexResult< T > * RWTRegexMatchIterator< T >::operator-> | ( | ) | const |
Returns a pointer to the regular expression object represented in the iterator.
RWTRegexMatchIterator & RWTRegexMatchIterator< T >::operator= | ( | const RWTRegexMatchIterator< T > & | rhs | ) |
Assignment operator
RWTRegexMatchIterator & RWTRegexMatchIterator< T >::operator= | ( | RWTRegexMatchIterator< T > && | rhs | ) |
Move assignment. Self takes ownership of the data owned by rhs.
void RWTRegexMatchIterator< T >::swap | ( | RWTRegexMatchIterator< T > & | rhs | ) |
Swaps the data owned by self with the data owned by rhs.
|
friend |
Returns the negation of operator==(const RWTRegexMatchIterator<T>& lhs, const RWTRegexMatchIterator<T>& rhs).
|
friend |
Compares two iterators for equality based on the regular expression and the starting position in the string.
Copyright © 2025 Rogue Wave Software, Inc., a Perforce company. All Rights Reserved. |