Iterator class to iterator through matches.
More...
#include <src/regex.h>
|
| Iterator () |
| Creates an end-of-sequence iterator.
|
|
| Iterator (std::string_view str, const Ex &re, size_t pos=0) |
| Creates an iterator for input string str, using regular expression re to search.
|
|
| Iterator (std::string &&str, const Ex &re)=delete |
|
| Iterator (const std::string &str, Ex &&re)=delete |
|
| Iterator (std::string &&str, Ex &&re)=delete |
|
bool | operator== (const Iterator &rhs) const |
| Returns true if the iterators point to the same match (or both are end-of-sequence iterators)
|
|
bool | operator!= (const Iterator &rhs) const |
| Returns true if the iterators are not pointing to the same match.
|
|
const value_type & | operator* () const |
| Returns a reference to the current match.
|
|
const value_type * | operator-> () const |
| Returns a pointer to the current match.
|
|
Iterator & | operator++ () |
| Advances the iterator to the next match.
|
|
Iterator class to iterator through matches.
Definition at line 231 of file regex.h.
◆ difference_type
◆ iterator_category
◆ pointer
◆ reference
◆ value_type
◆ Iterator() [1/5]
reg::Iterator::Iterator |
( |
| ) |
|
|
inline |
◆ Iterator() [2/5]
reg::Iterator::Iterator |
( |
std::string_view | str, |
|
|
const Ex & | re, |
|
|
size_t | pos = 0 ) |
|
inline |
Creates an iterator for input string str, using regular expression re to search.
- Note
- the string and regular expression objects should remain valid while iterating.
Definition at line 246 of file regex.h.
References findNext(), m_pos, m_re, and m_str.
◆ Iterator() [3/5]
reg::Iterator::Iterator |
( |
std::string && | str, |
|
|
const Ex & | re ) |
|
delete |
◆ Iterator() [4/5]
reg::Iterator::Iterator |
( |
const std::string & | str, |
|
|
Ex && | re ) |
|
delete |
◆ Iterator() [5/5]
reg::Iterator::Iterator |
( |
std::string && | str, |
|
|
Ex && | re ) |
|
delete |
◆ findNext()
void reg::Iterator::findNext |
( |
| ) |
|
|
inlineprivate |
◆ operator!=()
bool reg::Iterator::operator!= |
( |
const Iterator & | rhs | ) |
const |
|
inline |
Returns true if the iterators are not pointing to the same match.
Definition at line 259 of file regex.h.
259{
return rhs.m_pos!=
m_pos; }
References Iterator(), and m_pos.
◆ operator*()
const value_type & reg::Iterator::operator* |
( |
| ) |
const |
|
inline |
Returns a reference to the current match.
Definition at line 262 of file regex.h.
References m_match.
◆ operator++()
Iterator & reg::Iterator::operator++ |
( |
| ) |
|
|
inline |
◆ operator->()
const value_type * reg::Iterator::operator-> |
( |
| ) |
const |
|
inline |
Returns a pointer to the current match.
Definition at line 265 of file regex.h.
References m_match.
◆ operator==()
bool reg::Iterator::operator== |
( |
const Iterator & | rhs | ) |
const |
|
inline |
Returns true if the iterators point to the same match (or both are end-of-sequence iterators)
Definition at line 256 of file regex.h.
256{
return rhs.m_pos==
m_pos; }
References Iterator(), and m_pos.
◆ m_match
Match reg::Iterator::m_match |
|
private |
◆ m_pos
size_t reg::Iterator::m_pos = std::string::npos |
|
private |
◆ m_re
const Ex* reg::Iterator::m_re = nullptr |
|
private |
◆ m_str
std::string_view reg::Iterator::m_str |
|
private |
The documentation for this class was generated from the following file: