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 (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 = _REGEX_VALT(_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 = _REGEX_VALT(_BidIt), class _RxTraits = regex_traits<_Elem>>
typedef regex_iterator<_BidIt, _Elem, _RxTraits> regex_token_iterator< _BidIt, _Elem, _RxTraits >::_Position
template<class _BidIt , class _Elem = _REGEX_VALT(_BidIt), class _RxTraits = regex_traits<_Elem>>
typedef ptrdiff_t regex_token_iterator< _BidIt, _Elem, _RxTraits >::difference_type
template<class _BidIt , class _Elem = _REGEX_VALT(_BidIt), class _RxTraits = regex_traits<_Elem>>
typedef forward_iterator_tag regex_token_iterator< _BidIt, _Elem, _RxTraits >::iterator_category
template<class _BidIt , class _Elem = _REGEX_VALT(_BidIt), class _RxTraits = regex_traits<_Elem>>
typedef const value_type* regex_token_iterator< _BidIt, _Elem, _RxTraits >::pointer
template<class _BidIt , class _Elem = _REGEX_VALT(_BidIt), class _RxTraits = regex_traits<_Elem>>
typedef const value_type& regex_token_iterator< _BidIt, _Elem, _RxTraits >::reference
template<class _BidIt , class _Elem = _REGEX_VALT(_BidIt), class _RxTraits = regex_traits<_Elem>>
typedef basic_regex<_Elem, _RxTraits> regex_token_iterator< _BidIt, _Elem, _RxTraits >::regex_type
template<class _BidIt , class _Elem = _REGEX_VALT(_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 = _REGEX_VALT(_BidIt), class _RxTraits = regex_traits<_Elem>>
regex_token_iterator< _BidIt, _Elem, _RxTraits >::regex_token_iterator ( )
inline
3314  : _Res(0)
3315  { // construct end of sequence iterator
3316  }
const value_type * _Res
Definition: regex:3481
template<class _BidIt , class _Elem = _REGEX_VALT(_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
3322  : _Pos(_First, _Last, _Re, _Fl), _Cur(0), _Subs(&_Sub, &_Sub + 1)
3323  { // construct from RE, target text, and single submatch specifier
3324  _Init(_First, _Last);
3325  }
_Position _Pos
Definition: regex:3480
void _Init(_BidIt _First, _BidIt _Last)
Definition: regex:3491
size_t _Cur
Definition: regex:3483
vector< int > _Subs
Definition: regex:3484
_FwdIt _Last
Definition: algorithm:1936
template<class _BidIt , class _Elem = _REGEX_VALT(_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
3331  : _Pos(_First, _Last, _Re, _Fl), _Cur(0),
3332  _Subs(_Subx.begin(), _Subx.end())
3333  { // construct from RE, target text, and vector submatch specifier
3334  if (_Subs.empty())
3335  _Res = 0; // treat empty vector as end of sequence
3336  else
3337  _Init(_First, _Last);
3338  }
const value_type * _Res
Definition: regex:3481
_Position _Pos
Definition: regex:3480
void _Init(_BidIt _First, _BidIt _Last)
Definition: regex:3491
iterator begin() _NOEXCEPT
Definition: vector:1023
iterator end() _NOEXCEPT
Definition: vector:1033
size_t _Cur
Definition: regex:3483
vector< int > _Subs
Definition: regex:3484
_FwdIt _Last
Definition: algorithm:1936
bool empty() const _NOEXCEPT
Definition: vector:1156
template<class _BidIt , class _Elem = _REGEX_VALT(_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
3346  : _Pos(_First, _Last, _Re, _Fl), _Cur(0),
3347  _Subs(_Subx, _Subx + _Nx)
3348  { // construct from RE, target text, and array submatch specifier
3349  _Init(_First, _Last);
3350  }
_Position _Pos
Definition: regex:3480
void _Init(_BidIt _First, _BidIt _Last)
Definition: regex:3491
size_t _Cur
Definition: regex:3483
vector< int > _Subs
Definition: regex:3484
_FwdIt _Last
Definition: algorithm:1936
template<class _BidIt , class _Elem = _REGEX_VALT(_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
3357  : _Pos(_First, _Last, _Re, _Fl), _Cur(0),
3358  _Subs(_Ilist.begin(), _Ilist.end())
3359  { // construct from RE, target text, and ilist submatch specifier
3360  _Init(_First, _Last);
3361  }
_Position _Pos
Definition: regex:3480
void _Init(_BidIt _First, _BidIt _Last)
Definition: regex:3491
size_t _Cur
Definition: regex:3483
vector< int > _Subs
Definition: regex:3484
_FwdIt _Last
Definition: algorithm:1936
template<class _BidIt , class _Elem = _REGEX_VALT(_BidIt), class _RxTraits = regex_traits<_Elem>>
regex_token_iterator< _BidIt, _Elem, _RxTraits >::regex_token_iterator ( const regex_token_iterator< _BidIt, _Elem, _RxTraits > &  _Right)
inline
3364  : _Pos(_Right._Pos), _Cur(_Right._Cur),
3365  _Suffix(_Right._Suffix), _Subs(_Right._Subs)
3366  { // construct copy of _Right
3367  if (_Right._Res == 0)
3368  _Res = 0;
3369  else if (_Right._Res == &_Right._Suffix)
3370  _Res = &_Suffix;
3371  else
3372  _Res = _Current();
3373  }
const value_type * _Res
Definition: regex:3481
_Position _Pos
Definition: regex:3480
value_type _Suffix
Definition: regex:3482
const value_type * _Current() const
Definition: regex:3507
size_t _Cur
Definition: regex:3483
vector< int > _Subs
Definition: regex:3484

Member Function Documentation

template<class _BidIt , class _Elem = _REGEX_VALT(_BidIt), class _RxTraits = regex_traits<_Elem>>
const value_type* regex_token_iterator< _BidIt, _Elem, _RxTraits >::_Current ( ) const
inlineprivate
3508  { // return pointer to current submatch
3509  return (&(_Subs[_Cur] == -1
3510  ? _Pos->prefix() : (*_Pos)[_Subs[_Cur]]));
3511  }
_Position _Pos
Definition: regex:3480
size_t _Cur
Definition: regex:3483
vector< int > _Subs
Definition: regex:3484
template<class _BidIt , class _Elem = _REGEX_VALT(_BidIt), class _RxTraits = regex_traits<_Elem>>
bool regex_token_iterator< _BidIt, _Elem, _RxTraits >::_Has_suffix ( ) const
inlineprivate
3487  { // check for suffix specifier
3488  return (_STD find(_Subs.begin(), _Subs.end(), -1) != _Subs.end());
3489  }
iterator begin() _NOEXCEPT
Definition: vector:1023
iterator end() _NOEXCEPT
Definition: vector:1033
vector< int > _Subs
Definition: regex:3484
_InIt find(_InIt _First, _InIt _Last, const _Ty &_Val)
Definition: xutility:3050
template<class _BidIt , class _Elem = _REGEX_VALT(_BidIt), class _RxTraits = regex_traits<_Elem>>
void regex_token_iterator< _BidIt, _Elem, _RxTraits >::_Init ( _BidIt  _First,
_BidIt  _Last 
)
inlineprivate
3492  { // initialize
3493  _DEBUG_RANGE(_First, _Last);
3494  if (!_Pos._Atend())
3495  _Res = _Current();
3496  else if (_Has_suffix())
3497  { // mark suffix (no match)
3498  _Suffix.matched = true;
3499  _Suffix.first = _First;
3500  _Suffix.second = _Last;
3501  _Res = &_Suffix;
3502  }
3503  else
3504  _Res = 0;
3505  }
bool _Atend() const
Definition: regex:3280
#define _DEBUG_RANGE(first, last)
Definition: xutility:467
const value_type * _Res
Definition: regex:3481
bool matched
Definition: regex:616
_Position _Pos
Definition: regex:3480
value_type _Suffix
Definition: regex:3482
const value_type * _Current() const
Definition: regex:3507
_Ty1 first
Definition: utility:198
bool _Has_suffix() const
Definition: regex:3486
second
Definition: utility:167
_FwdIt _Last
Definition: algorithm:1936
template<class _BidIt , class _Elem = _REGEX_VALT(_BidIt), class _RxTraits = regex_traits<_Elem>>
bool regex_token_iterator< _BidIt, _Elem, _RxTraits >::operator!= ( const _Myt _Right) const
inline
3406  { // test for inequality
3407  return (!(*this == _Right));
3408  }
const _Ty & _Right
Definition: algorithm:4087
template<class _BidIt , class _Elem = _REGEX_VALT(_BidIt), class _RxTraits = regex_traits<_Elem>>
const value_type& regex_token_iterator< _BidIt, _Elem, _RxTraits >::operator* ( ) const
inline
3411  { // return designated submatch
3412  #if _ITERATOR_DEBUG_LEVEL == 2
3413  if (_Res == 0)
3414  { // report error
3415  _DEBUG_ERROR("regex_token_iterator not dereferencable");
3417  }
3418 
3419  #elif _ITERATOR_DEBUG_LEVEL == 1
3421  #endif /* _ITERATOR_DEBUG_LEVEL */
3422 
3423  _Analysis_assume_(_Res != 0);
3424 
3425  return (*_Res);
3426  }
const value_type * _Res
Definition: regex:3481
#define _SCL_SECURE_OUT_OF_RANGE
Definition: yvals.h:351
#define _Analysis_assume_(expr)
Definition: sal.h:2916
#define _SCL_SECURE_VALIDATE_RANGE(cond)
Definition: yvals.h:347
#define _DEBUG_ERROR(mesg)
Definition: xutility:32
template<class _BidIt , class _Elem = _REGEX_VALT(_BidIt), class _RxTraits = regex_traits<_Elem>>
_Myt& regex_token_iterator< _BidIt, _Elem, _RxTraits >::operator++ ( )
inline
3434  { // preincrement
3435  #if _ITERATOR_DEBUG_LEVEL == 2
3436  if (_Res == 0)
3437  { // report error
3438  _DEBUG_ERROR("regex_token_iterator not incrementable");
3440  }
3441 
3442  #elif _ITERATOR_DEBUG_LEVEL == 1
3444  #endif /* _ITERATOR_DEBUG_LEVEL */
3445 
3446  _Position _Prev(_Pos);
3447  if (_Res == 0)
3448  ;
3449  else if (_Res == &_Suffix)
3450  _Res = 0;
3451  else if (++_Cur < _Subs.size())
3452  _Res = _Current();
3453  else
3454  { // advance to next full match
3455  _Cur = 0;
3456  ++_Pos;
3457  if (!_Pos._Atend())
3458  _Res = _Current();
3459  else if (_Has_suffix() && _Prev->suffix().length() != 0)
3460  { // mark suffix
3461  _Suffix.matched = true;
3462  _Suffix.first = _Prev->suffix().first;
3463  _Suffix.second = _Prev->suffix().second;
3464  _Res = &_Suffix;
3465  }
3466  else
3467  _Res = 0;
3468  }
3469  return (*this);
3470  }
bool _Atend() const
Definition: regex:3280
const value_type * _Res
Definition: regex:3481
bool matched
Definition: regex:616
_Position _Pos
Definition: regex:3480
value_type _Suffix
Definition: regex:3482
const value_type * _Current() const
Definition: regex:3507
_Ty1 first
Definition: utility:198
bool _Has_suffix() const
Definition: regex:3486
#define _SCL_SECURE_OUT_OF_RANGE
Definition: yvals.h:351
size_type size() const _NOEXCEPT
Definition: vector:1146
regex_iterator< _BidIt, _Elem, _RxTraits > _Position
Definition: regex:3304
size_t _Cur
Definition: regex:3483
vector< int > _Subs
Definition: regex:3484
#define _SCL_SECURE_VALIDATE_RANGE(cond)
Definition: yvals.h:347
#define _DEBUG_ERROR(mesg)
Definition: xutility:32
second
Definition: utility:167
template<class _BidIt , class _Elem = _REGEX_VALT(_BidIt), class _RxTraits = regex_traits<_Elem>>
_Myt regex_token_iterator< _BidIt, _Elem, _RxTraits >::operator++ ( int  )
inline
3473  { // postincrement
3474  _Myt _Tmp = *this;
3475  ++*this;
3476  return (_Tmp);
3477  }
regex_token_iterator< _BidIt, _Elem, _RxTraits > _Myt
Definition: regex:3305
template<class _BidIt , class _Elem = _REGEX_VALT(_BidIt), class _RxTraits = regex_traits<_Elem>>
pointer regex_token_iterator< _BidIt, _Elem, _RxTraits >::operator-> ( ) const
inline
3429  { // return pointer to designated submatch
3430  return (_STD pointer_traits<pointer>::pointer_to(**this));
3431  }
Definition: xmemory0:198
template<class _BidIt , class _Elem = _REGEX_VALT(_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
3376  { // assign from _Right
3377  if (&_Right != this)
3378  { // copy from _Right
3379  _Pos = _Right._Pos;
3380  _Cur = _Right._Cur;
3381  _Suffix = _Right._Suffix;
3382  _Subs = _Right._Subs;
3383  if (_Right._Res == 0)
3384  _Res = 0;
3385  else if (_Right._Res == &_Right._Suffix)
3386  _Res = &_Suffix;
3387  else
3388  _Res = _Current();
3389  }
3390  return (*this);
3391  }
const value_type * _Res
Definition: regex:3481
_Position _Pos
Definition: regex:3480
value_type _Suffix
Definition: regex:3482
const value_type * _Current() const
Definition: regex:3507
size_t _Cur
Definition: regex:3483
vector< int > _Subs
Definition: regex:3484
template<class _BidIt , class _Elem = _REGEX_VALT(_BidIt), class _RxTraits = regex_traits<_Elem>>
bool regex_token_iterator< _BidIt, _Elem, _RxTraits >::operator== ( const _Myt _Right) const
inline
3394  { // test for equality
3395  if (_Res == 0 || _Right._Res == 0)
3396  return (_Res == _Right._Res);
3397  else if (*_Res == *_Right._Res
3398  && _Pos == _Right._Pos
3399  && _Subs == _Right._Subs)
3400  return (true);
3401  else
3402  return (false);
3403  }
const value_type * _Res
Definition: regex:3481
_Position _Pos
Definition: regex:3480
vector< int > _Subs
Definition: regex:3484
const _Ty & _Right
Definition: algorithm:4087

Member Data Documentation

template<class _BidIt , class _Elem = _REGEX_VALT(_BidIt), class _RxTraits = regex_traits<_Elem>>
size_t regex_token_iterator< _BidIt, _Elem, _RxTraits >::_Cur
private
template<class _BidIt , class _Elem = _REGEX_VALT(_BidIt), class _RxTraits = regex_traits<_Elem>>
_Position regex_token_iterator< _BidIt, _Elem, _RxTraits >::_Pos
private
template<class _BidIt , class _Elem = _REGEX_VALT(_BidIt), class _RxTraits = regex_traits<_Elem>>
const value_type* regex_token_iterator< _BidIt, _Elem, _RxTraits >::_Res
private
template<class _BidIt , class _Elem = _REGEX_VALT(_BidIt), class _RxTraits = regex_traits<_Elem>>
vector<int> regex_token_iterator< _BidIt, _Elem, _RxTraits >::_Subs
private
template<class _BidIt , class _Elem = _REGEX_VALT(_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: