STLdoc
STLdocumentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Public Types | Public Member Functions | Private Member Functions | Private Attributes | List of all members
regex_token_iterator< _BidIt, _Elem, _RxTraits > Class Template Reference

Public Types

typedef regex_iterator< _BidIt, _Elem, _RxTraits > _Position
 
typedef regex_token_iterator< _BidIt, _Elem, _RxTraits > _Myt
 
typedef basic_regex< _Elem, _RxTraits > regex_type
 
typedef sub_match< _BidIt > value_type
 
typedef ptrdiff_t difference_type
 
typedef const value_typepointer
 
typedef const value_typereference
 
typedef forward_iterator_tag iterator_category
 

Public Member Functions

 regex_token_iterator ()
 
 regex_token_iterator (_BidIt _First, _BidIt _Last, const regex_type &_Re, int _Sub=0, regex_constants::match_flag_type _Fl=regex_constants::match_default)
 
 regex_token_iterator (_BidIt _First, _BidIt _Last, const regex_type &_Re, const vector< int > &_Subx, regex_constants::match_flag_type _Fl=regex_constants::match_default)
 
template<size_t _Nx>
 regex_token_iterator (_BidIt _First, _BidIt _Last, const regex_type &_Re, const int(&_Subx)[_Nx], regex_constants::match_flag_type _Fl=regex_constants::match_default)
 
 regex_token_iterator (_BidIt _First, _BidIt _Last, const regex_type &_Re, _XSTD initializer_list< int > _Ilist, regex_constants::match_flag_type _Fl=regex_constants::match_default)
 
 regex_token_iterator (_BidIt, _BidIt, const regex_type &&, int=0, regex_constants::match_flag_type=regex_constants::match_default)=delete
 
 regex_token_iterator (_BidIt, _BidIt, const regex_type &&, const vector< int > &, regex_constants::match_flag_type=regex_constants::match_default)=delete
 
template<size_t _Nx>
 regex_token_iterator (_BidIt, _BidIt, const regex_type &&, const int(&)[_Nx], regex_constants::match_flag_type=regex_constants::match_default)=delete
 
 regex_token_iterator (_BidIt, _BidIt, const regex_type &&, _XSTD initializer_list< int >, regex_constants::match_flag_type=regex_constants::match_default)=delete
 
 regex_token_iterator (const regex_token_iterator &_Right)
 
regex_token_iteratoroperator= (const regex_token_iterator &_Right)
 
bool operator== (const _Myt &_Right) const
 
bool operator!= (const _Myt &_Right) const
 
const value_typeoperator* () const
 
pointer operator-> () const
 
_Mytoperator++ ()
 
_Myt operator++ (int)
 

Private Member Functions

bool _Has_suffix () const
 
void _Init (_BidIt _First, _BidIt _Last)
 
const value_type_Current () const
 

Private Attributes

_Position _Pos
 
const value_type_Res
 
value_type _Suffix
 
size_t _Cur
 
vector< int > _Subs
 

Member Typedef Documentation

template<class _BidIt , class _Elem = _Iter_value_t<_BidIt>, class _RxTraits = regex_traits<_Elem>>
typedef regex_token_iterator<_BidIt, _Elem, _RxTraits> regex_token_iterator< _BidIt, _Elem, _RxTraits >::_Myt
template<class _BidIt , class _Elem = _Iter_value_t<_BidIt>, class _RxTraits = regex_traits<_Elem>>
typedef regex_iterator<_BidIt, _Elem, _RxTraits> regex_token_iterator< _BidIt, _Elem, _RxTraits >::_Position
template<class _BidIt , class _Elem = _Iter_value_t<_BidIt>, class _RxTraits = regex_traits<_Elem>>
typedef ptrdiff_t regex_token_iterator< _BidIt, _Elem, _RxTraits >::difference_type
template<class _BidIt , class _Elem = _Iter_value_t<_BidIt>, class _RxTraits = regex_traits<_Elem>>
typedef forward_iterator_tag regex_token_iterator< _BidIt, _Elem, _RxTraits >::iterator_category
template<class _BidIt , class _Elem = _Iter_value_t<_BidIt>, class _RxTraits = regex_traits<_Elem>>
typedef const value_type* regex_token_iterator< _BidIt, _Elem, _RxTraits >::pointer
template<class _BidIt , class _Elem = _Iter_value_t<_BidIt>, class _RxTraits = regex_traits<_Elem>>
typedef const value_type& regex_token_iterator< _BidIt, _Elem, _RxTraits >::reference
template<class _BidIt , class _Elem = _Iter_value_t<_BidIt>, class _RxTraits = regex_traits<_Elem>>
typedef basic_regex<_Elem, _RxTraits> regex_token_iterator< _BidIt, _Elem, _RxTraits >::regex_type
template<class _BidIt , class _Elem = _Iter_value_t<_BidIt>, class _RxTraits = regex_traits<_Elem>>
typedef sub_match<_BidIt> regex_token_iterator< _BidIt, _Elem, _RxTraits >::value_type

Constructor & Destructor Documentation

template<class _BidIt , class _Elem = _Iter_value_t<_BidIt>, class _RxTraits = regex_traits<_Elem>>
regex_token_iterator< _BidIt, _Elem, _RxTraits >::regex_token_iterator ( )
inline
3358  : _Res(0)
3359  { // construct end of sequence iterator
3360  }
const value_type * _Res
Definition: regex:3548
template<class _BidIt , class _Elem = _Iter_value_t<_BidIt>, class _RxTraits = regex_traits<_Elem>>
regex_token_iterator< _BidIt, _Elem, _RxTraits >::regex_token_iterator ( _BidIt  _First,
_BidIt  _Last,
const regex_type _Re,
int  _Sub = 0,
regex_constants::match_flag_type  _Fl = regex_constants::match_default 
)
inline
3366  : _Pos(_First, _Last, _Re, _Fl), _Cur(0), _Subs(&_Sub, &_Sub + 1)
3367  { // construct from RE, target text, and single submatch specifier
3368  _Init(_First, _Last);
3369  }
_Position _Pos
Definition: regex:3547
void _Init(_BidIt _First, _BidIt _Last)
Definition: regex:3558
size_t _Cur
Definition: regex:3550
vector< int > _Subs
Definition: regex:3551
_FwdIt _Last
Definition: algorithm:1936
template<class _BidIt , class _Elem = _Iter_value_t<_BidIt>, class _RxTraits = regex_traits<_Elem>>
regex_token_iterator< _BidIt, _Elem, _RxTraits >::regex_token_iterator ( _BidIt  _First,
_BidIt  _Last,
const regex_type _Re,
const vector< int > &  _Subx,
regex_constants::match_flag_type  _Fl = regex_constants::match_default 
)
inline
3375  : _Pos(_First, _Last, _Re, _Fl), _Cur(0),
3376  _Subs(_Subx.begin(), _Subx.end())
3377  { // construct from RE, target text, and vector submatch specifier
3378  if (_Subs.empty())
3379  _Res = 0; // treat empty vector as end of sequence
3380  else
3381  _Init(_First, _Last);
3382  }
const value_type * _Res
Definition: regex:3548
_Position _Pos
Definition: regex:3547
void _Init(_BidIt _First, _BidIt _Last)
Definition: regex:3558
iterator begin() _NOEXCEPT
Definition: vector:1056
iterator end() _NOEXCEPT
Definition: vector:1066
size_t _Cur
Definition: regex:3550
vector< int > _Subs
Definition: regex:3551
_FwdIt _Last
Definition: algorithm:1936
bool empty() const _NOEXCEPT
Definition: vector:1188
template<class _BidIt , class _Elem = _Iter_value_t<_BidIt>, class _RxTraits = regex_traits<_Elem>>
template<size_t _Nx>
regex_token_iterator< _BidIt, _Elem, _RxTraits >::regex_token_iterator ( _BidIt  _First,
_BidIt  _Last,
const regex_type _Re,
const int(&)  _Subx[_Nx],
regex_constants::match_flag_type  _Fl = regex_constants::match_default 
)
inline
3390  : _Pos(_First, _Last, _Re, _Fl), _Cur(0),
3391  _Subs(_Subx, _Subx + _Nx)
3392  { // construct from RE, target text, and array submatch specifier
3393  _Init(_First, _Last);
3394  }
_Position _Pos
Definition: regex:3547
void _Init(_BidIt _First, _BidIt _Last)
Definition: regex:3558
size_t _Cur
Definition: regex:3550
vector< int > _Subs
Definition: regex:3551
_FwdIt _Last
Definition: algorithm:1936
template<class _BidIt , class _Elem = _Iter_value_t<_BidIt>, class _RxTraits = regex_traits<_Elem>>
regex_token_iterator< _BidIt, _Elem, _RxTraits >::regex_token_iterator ( _BidIt  _First,
_BidIt  _Last,
const regex_type _Re,
_XSTD initializer_list< int >  _Ilist,
regex_constants::match_flag_type  _Fl = regex_constants::match_default 
)
inline
3401  : _Pos(_First, _Last, _Re, _Fl), _Cur(0),
3402  _Subs(_Ilist.begin(), _Ilist.end())
3403  { // construct from RE, target text, and ilist submatch specifier
3404  _Init(_First, _Last);
3405  }
_Position _Pos
Definition: regex:3547
void _Init(_BidIt _First, _BidIt _Last)
Definition: regex:3558
size_t _Cur
Definition: regex:3550
vector< int > _Subs
Definition: regex:3551
_FwdIt _Last
Definition: algorithm:1936
template<class _BidIt , class _Elem = _Iter_value_t<_BidIt>, class _RxTraits = regex_traits<_Elem>>
regex_token_iterator< _BidIt, _Elem, _RxTraits >::regex_token_iterator ( _BidIt  ,
_BidIt  ,
const regex_type &&  ,
int  = 0,
regex_constants::match_flag_type  = regex_constants::match_default 
)
delete
template<class _BidIt , class _Elem = _Iter_value_t<_BidIt>, class _RxTraits = regex_traits<_Elem>>
regex_token_iterator< _BidIt, _Elem, _RxTraits >::regex_token_iterator ( _BidIt  ,
_BidIt  ,
const regex_type &&  ,
const vector< int > &  ,
regex_constants::match_flag_type  = regex_constants::match_default 
)
delete
template<class _BidIt , class _Elem = _Iter_value_t<_BidIt>, class _RxTraits = regex_traits<_Elem>>
template<size_t _Nx>
regex_token_iterator< _BidIt, _Elem, _RxTraits >::regex_token_iterator ( _BidIt  ,
_BidIt  ,
const regex_type &&  ,
const   int(&)[_Nx],
regex_constants::match_flag_type  = regex_constants::match_default 
)
delete
template<class _BidIt , class _Elem = _Iter_value_t<_BidIt>, class _RxTraits = regex_traits<_Elem>>
regex_token_iterator< _BidIt, _Elem, _RxTraits >::regex_token_iterator ( _BidIt  ,
_BidIt  ,
const regex_type &&  ,
_XSTD initializer_list< int >  ,
regex_constants::match_flag_type  = regex_constants::match_default 
)
delete
template<class _BidIt , class _Elem = _Iter_value_t<_BidIt>, class _RxTraits = regex_traits<_Elem>>
regex_token_iterator< _BidIt, _Elem, _RxTraits >::regex_token_iterator ( const regex_token_iterator< _BidIt, _Elem, _RxTraits > &  _Right)
inline
3431  : _Pos(_Right._Pos), _Cur(_Right._Cur),
3432  _Suffix(_Right._Suffix), _Subs(_Right._Subs)
3433  { // construct copy of _Right
3434  if (_Right._Res == 0)
3435  _Res = 0;
3436  else if (_Right._Res == &_Right._Suffix)
3437  _Res = &_Suffix;
3438  else
3439  _Res = _Current();
3440  }
const value_type * _Res
Definition: regex:3548
_Position _Pos
Definition: regex:3547
value_type _Suffix
Definition: regex:3549
const value_type * _Current() const
Definition: regex:3574
size_t _Cur
Definition: regex:3550
vector< int > _Subs
Definition: regex:3551

Member Function Documentation

template<class _BidIt , class _Elem = _Iter_value_t<_BidIt>, class _RxTraits = regex_traits<_Elem>>
const value_type* regex_token_iterator< _BidIt, _Elem, _RxTraits >::_Current ( ) const
inlineprivate
3575  { // return pointer to current submatch
3576  return (&(_Subs[_Cur] == -1
3577  ? _Pos->prefix() : (*_Pos)[_Subs[_Cur]]));
3578  }
_Position _Pos
Definition: regex:3547
size_t _Cur
Definition: regex:3550
vector< int > _Subs
Definition: regex:3551
template<class _BidIt , class _Elem = _Iter_value_t<_BidIt>, class _RxTraits = regex_traits<_Elem>>
bool regex_token_iterator< _BidIt, _Elem, _RxTraits >::_Has_suffix ( ) const
inlineprivate
3554  { // check for suffix specifier
3555  return (_STD find(_Subs.begin(), _Subs.end(), -1) != _Subs.end());
3556  }
iterator begin() _NOEXCEPT
Definition: vector:1056
iterator end() _NOEXCEPT
Definition: vector:1066
vector< int > _Subs
Definition: regex:3551
_InIt find(_InIt _First, _InIt _Last, const _Ty &_Val)
Definition: xutility:3282
template<class _BidIt , class _Elem = _Iter_value_t<_BidIt>, class _RxTraits = regex_traits<_Elem>>
void regex_token_iterator< _BidIt, _Elem, _RxTraits >::_Init ( _BidIt  _First,
_BidIt  _Last 
)
inlineprivate
3559  { // initialize
3560  _DEBUG_RANGE(_First, _Last);
3561  if (!_Pos._Atend())
3562  _Res = _Current();
3563  else if (_Has_suffix())
3564  { // mark suffix (no match)
3565  _Suffix.matched = true;
3566  _Suffix.first = _First;
3567  _Suffix.second = _Last;
3568  _Res = &_Suffix;
3569  }
3570  else
3571  _Res = 0;
3572  }
_Ty2 second
Definition: utility:243
bool _Atend() const
Definition: regex:3324
#define _DEBUG_RANGE(first, last)
Definition: xutility:822
const value_type * _Res
Definition: regex:3548
bool matched
Definition: regex:643
_Position _Pos
Definition: regex:3547
value_type _Suffix
Definition: regex:3549
const value_type * _Current() const
Definition: regex:3574
_Ty1 first
Definition: utility:242
bool _Has_suffix() const
Definition: regex:3553
_FwdIt _Last
Definition: algorithm:1936
template<class _BidIt , class _Elem = _Iter_value_t<_BidIt>, class _RxTraits = regex_traits<_Elem>>
bool regex_token_iterator< _BidIt, _Elem, _RxTraits >::operator!= ( const _Myt _Right) const
inline
3473  { // test for inequality
3474  return (!(*this == _Right));
3475  }
constexpr const _Ty &() _Right
Definition: algorithm:3591
template<class _BidIt , class _Elem = _Iter_value_t<_BidIt>, class _RxTraits = regex_traits<_Elem>>
const value_type& regex_token_iterator< _BidIt, _Elem, _RxTraits >::operator* ( ) const
inline
3478  { // return designated submatch
3479  #if _ITERATOR_DEBUG_LEVEL == 2
3480  if (_Res == 0)
3481  { // report error
3482  _DEBUG_ERROR("regex_token_iterator not dereferencable");
3484  }
3485 
3486  #elif _ITERATOR_DEBUG_LEVEL == 1
3488  #endif /* _ITERATOR_DEBUG_LEVEL */
3489 
3490  _Analysis_assume_(_Res != 0);
3491 
3492  return (*_Res);
3493  }
const value_type * _Res
Definition: regex:3548
#define _SCL_SECURE_OUT_OF_RANGE
Definition: yvals.h:396
#define _Analysis_assume_(expr)
Definition: sal.h:2896
#define _SCL_SECURE_VALIDATE_RANGE(cond)
Definition: yvals.h:392
#define _DEBUG_ERROR(mesg)
Definition: xutility:32
template<class _BidIt , class _Elem = _Iter_value_t<_BidIt>, class _RxTraits = regex_traits<_Elem>>
_Myt& regex_token_iterator< _BidIt, _Elem, _RxTraits >::operator++ ( )
inline
3501  { // preincrement
3502  #if _ITERATOR_DEBUG_LEVEL == 2
3503  if (_Res == 0)
3504  { // report error
3505  _DEBUG_ERROR("regex_token_iterator not incrementable");
3507  }
3508 
3509  #elif _ITERATOR_DEBUG_LEVEL == 1
3511  #endif /* _ITERATOR_DEBUG_LEVEL */
3512 
3513  _Position _Prev(_Pos);
3514  if (_Res == 0)
3515  ;
3516  else if (_Res == &_Suffix)
3517  _Res = 0;
3518  else if (++_Cur < _Subs.size())
3519  _Res = _Current();
3520  else
3521  { // advance to next full match
3522  _Cur = 0;
3523  ++_Pos;
3524  if (!_Pos._Atend())
3525  _Res = _Current();
3526  else if (_Has_suffix() && _Prev->suffix().length() != 0)
3527  { // mark suffix
3528  _Suffix.matched = true;
3529  _Suffix.first = _Prev->suffix().first;
3530  _Suffix.second = _Prev->suffix().second;
3531  _Res = &_Suffix;
3532  }
3533  else
3534  _Res = 0;
3535  }
3536  return (*this);
3537  }
_Ty2 second
Definition: utility:243
bool _Atend() const
Definition: regex:3324
const value_type * _Res
Definition: regex:3548
bool matched
Definition: regex:643
_Position _Pos
Definition: regex:3547
value_type _Suffix
Definition: regex:3549
const value_type * _Current() const
Definition: regex:3574
_Ty1 first
Definition: utility:242
bool _Has_suffix() const
Definition: regex:3553
#define _SCL_SECURE_OUT_OF_RANGE
Definition: yvals.h:396
size_type size() const _NOEXCEPT
Definition: vector:1178
regex_iterator< _BidIt, _Elem, _RxTraits > _Position
Definition: regex:3348
size_t _Cur
Definition: regex:3550
vector< int > _Subs
Definition: regex:3551
#define _SCL_SECURE_VALIDATE_RANGE(cond)
Definition: yvals.h:392
#define _DEBUG_ERROR(mesg)
Definition: xutility:32
template<class _BidIt , class _Elem = _Iter_value_t<_BidIt>, class _RxTraits = regex_traits<_Elem>>
_Myt regex_token_iterator< _BidIt, _Elem, _RxTraits >::operator++ ( int  )
inline
3540  { // postincrement
3541  _Myt _Tmp = *this;
3542  ++*this;
3543  return (_Tmp);
3544  }
regex_token_iterator< _BidIt, _Elem, _RxTraits > _Myt
Definition: regex:3349
template<class _BidIt , class _Elem = _Iter_value_t<_BidIt>, class _RxTraits = regex_traits<_Elem>>
pointer regex_token_iterator< _BidIt, _Elem, _RxTraits >::operator-> ( ) const
inline
3496  { // return pointer to designated submatch
3497  return (pointer_traits<pointer>::pointer_to(**this));
3498  }
Definition: xmemory0:244
template<class _BidIt , class _Elem = _Iter_value_t<_BidIt>, class _RxTraits = regex_traits<_Elem>>
regex_token_iterator& regex_token_iterator< _BidIt, _Elem, _RxTraits >::operator= ( const regex_token_iterator< _BidIt, _Elem, _RxTraits > &  _Right)
inline
3443  { // assign from _Right
3444  if (&_Right != this)
3445  { // copy from _Right
3446  _Pos = _Right._Pos;
3447  _Cur = _Right._Cur;
3448  _Suffix = _Right._Suffix;
3449  _Subs = _Right._Subs;
3450  if (_Right._Res == 0)
3451  _Res = 0;
3452  else if (_Right._Res == &_Right._Suffix)
3453  _Res = &_Suffix;
3454  else
3455  _Res = _Current();
3456  }
3457  return (*this);
3458  }
const value_type * _Res
Definition: regex:3548
_Position _Pos
Definition: regex:3547
value_type _Suffix
Definition: regex:3549
const value_type * _Current() const
Definition: regex:3574
size_t _Cur
Definition: regex:3550
vector< int > _Subs
Definition: regex:3551
template<class _BidIt , class _Elem = _Iter_value_t<_BidIt>, class _RxTraits = regex_traits<_Elem>>
bool regex_token_iterator< _BidIt, _Elem, _RxTraits >::operator== ( const _Myt _Right) const
inline
3461  { // test for equality
3462  if (_Res == 0 || _Right._Res == 0)
3463  return (_Res == _Right._Res);
3464  else if (*_Res == *_Right._Res
3465  && _Pos == _Right._Pos
3466  && _Subs == _Right._Subs)
3467  return (true);
3468  else
3469  return (false);
3470  }
const value_type * _Res
Definition: regex:3548
_Position _Pos
Definition: regex:3547
vector< int > _Subs
Definition: regex:3551
constexpr const _Ty &() _Right
Definition: algorithm:3591

Member Data Documentation

template<class _BidIt , class _Elem = _Iter_value_t<_BidIt>, class _RxTraits = regex_traits<_Elem>>
size_t regex_token_iterator< _BidIt, _Elem, _RxTraits >::_Cur
private
template<class _BidIt , class _Elem = _Iter_value_t<_BidIt>, class _RxTraits = regex_traits<_Elem>>
_Position regex_token_iterator< _BidIt, _Elem, _RxTraits >::_Pos
private
template<class _BidIt , class _Elem = _Iter_value_t<_BidIt>, class _RxTraits = regex_traits<_Elem>>
const value_type* regex_token_iterator< _BidIt, _Elem, _RxTraits >::_Res
private
template<class _BidIt , class _Elem = _Iter_value_t<_BidIt>, class _RxTraits = regex_traits<_Elem>>
vector<int> regex_token_iterator< _BidIt, _Elem, _RxTraits >::_Subs
private
template<class _BidIt , class _Elem = _Iter_value_t<_BidIt>, class _RxTraits = regex_traits<_Elem>>
value_type regex_token_iterator< _BidIt, _Elem, _RxTraits >::_Suffix
private

The documentation for this class was generated from the following file: