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, 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 &&, 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
3376  : _Res(0)
3377  { // construct end of sequence iterator
3378  }
const value_type * _Res
Definition: regex:3564
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
3384  : _Pos(_First, _Last, _Re, _Fl), _Cur(0), _Subs(&_Sub, &_Sub + 1)
3385  { // construct from RE, target text, and single submatch specifier
3386  _Init(_First, _Last);
3387  }
_Position _Pos
Definition: regex:3563
void _Init(_BidIt _First, _BidIt _Last)
Definition: regex:3574
size_t _Cur
Definition: regex:3566
vector< int > _Subs
Definition: regex:3567
_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
3393  : _Pos(_First, _Last, _Re, _Fl), _Cur(0),
3394  _Subs(_Subx.begin(), _Subx.end())
3395  { // construct from RE, target text, and vector submatch specifier
3396  if (_Subs.empty())
3397  _Res = 0; // treat empty vector as end of sequence
3398  else
3399  _Init(_First, _Last);
3400  }
const value_type * _Res
Definition: regex:3564
_Position _Pos
Definition: regex:3563
void _Init(_BidIt _First, _BidIt _Last)
Definition: regex:3574
iterator begin() _NOEXCEPT
Definition: vector:1643
iterator end() _NOEXCEPT
Definition: vector:1653
size_t _Cur
Definition: regex:3566
vector< int > _Subs
Definition: regex:3567
_FwdIt _Last
Definition: algorithm:1936
bool empty() const _NOEXCEPT
Definition: vector:1703
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
3408  : _Pos(_First, _Last, _Re, _Fl), _Cur(0),
3409  _Subs(_Subx, _Subx + _Nx)
3410  { // construct from RE, target text, and array submatch specifier
3411  _Init(_First, _Last);
3412  }
_Position _Pos
Definition: regex:3563
void _Init(_BidIt _First, _BidIt _Last)
Definition: regex:3574
size_t _Cur
Definition: regex:3566
vector< int > _Subs
Definition: regex:3567
_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,
initializer_list< int _Ilist,
regex_constants::match_flag_type  _Fl = regex_constants::match_default 
)
inline
3419  : _Pos(_First, _Last, _Re, _Fl), _Cur(0),
3420  _Subs(_Ilist.begin(), _Ilist.end())
3421  { // construct from RE, target text, and ilist submatch specifier
3422  _Init(_First, _Last);
3423  }
constexpr const _Elem * end() const _NOEXCEPT
Definition: initializer_list:44
_Position _Pos
Definition: regex:3563
void _Init(_BidIt _First, _BidIt _Last)
Definition: regex:3574
size_t _Cur
Definition: regex:3566
vector< int > _Subs
Definition: regex:3567
constexpr const _Elem * begin() const _NOEXCEPT
Definition: initializer_list:39
_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 &&  ,
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
3449  : _Pos(_Right._Pos), _Cur(_Right._Cur),
3450  _Suffix(_Right._Suffix), _Subs(_Right._Subs)
3451  { // construct copy of _Right
3452  if (_Right._Res == 0)
3453  _Res = 0;
3454  else if (_Right._Res == &_Right._Suffix)
3455  _Res = &_Suffix;
3456  else
3457  _Res = _Current();
3458  }
const value_type * _Res
Definition: regex:3564
_Position _Pos
Definition: regex:3563
value_type _Suffix
Definition: regex:3565
const value_type * _Current() const
Definition: regex:3590
size_t _Cur
Definition: regex:3566
vector< int > _Subs
Definition: regex:3567

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
3591  { // return pointer to current submatch
3592  return (&(_Subs[_Cur] == -1
3593  ? _Pos->prefix() : (*_Pos)[_Subs[_Cur]]));
3594  }
_Position _Pos
Definition: regex:3563
size_t _Cur
Definition: regex:3566
vector< int > _Subs
Definition: regex:3567
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
3570  { // check for suffix specifier
3571  return (_STD find(_Subs.begin(), _Subs.end(), -1) != _Subs.end());
3572  }
iterator begin() _NOEXCEPT
Definition: vector:1643
iterator end() _NOEXCEPT
Definition: vector:1653
vector< int > _Subs
Definition: regex:3567
_InIt find(_InIt _First, _InIt _Last, const _Ty &_Val)
Definition: xutility:3185
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
3575  { // initialize
3576  _DEBUG_RANGE(_First, _Last);
3577  if (!_Pos._Atend())
3578  _Res = _Current();
3579  else if (_Has_suffix())
3580  { // mark suffix (no match)
3581  _Suffix.matched = true;
3582  _Suffix.first = _First;
3583  _Suffix.second = _Last;
3584  _Res = &_Suffix;
3585  }
3586  else
3587  _Res = 0;
3588  }
_Ty2 second
Definition: utility:271
bool _Atend() const
Definition: regex:3342
#define _DEBUG_RANGE(first, last)
Definition: xutility:902
const value_type * _Res
Definition: regex:3564
bool matched
Definition: regex:664
_Position _Pos
Definition: regex:3563
value_type _Suffix
Definition: regex:3565
const value_type * _Current() const
Definition: regex:3590
_Ty1 first
Definition: utility:270
bool _Has_suffix() const
Definition: regex:3569
_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
3491  { // test for inequality
3492  return (!(*this == _Right));
3493  }
constexpr const _Ty &() _Right
Definition: algorithm:3723
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
3496  { // return designated submatch
3497  #if _ITERATOR_DEBUG_LEVEL == 2
3498  if (_Res == 0)
3499  { // report error
3500  _DEBUG_ERROR("regex_token_iterator not dereferencable");
3501  }
3502 
3503  #elif _ITERATOR_DEBUG_LEVEL == 1
3505  #endif /* _ITERATOR_DEBUG_LEVEL */
3506 
3507  _Analysis_assume_(_Res != 0);
3508 
3509  return (*_Res);
3510  }
const value_type * _Res
Definition: regex:3564
#define _Analysis_assume_(expr)
Definition: sal.h:2896
#define _SCL_SECURE_VALIDATE_RANGE(cond)
Definition: yvals.h:432
#define _DEBUG_ERROR(mesg)
Definition: xutility:33
template<class _BidIt , class _Elem = _Iter_value_t<_BidIt>, class _RxTraits = regex_traits<_Elem>>
_Myt& regex_token_iterator< _BidIt, _Elem, _RxTraits >::operator++ ( )
inline
3518  { // preincrement
3519  #if _ITERATOR_DEBUG_LEVEL == 2
3520  if (_Res == 0)
3521  { // report error
3522  _DEBUG_ERROR("regex_token_iterator not incrementable");
3523  }
3524 
3525  #elif _ITERATOR_DEBUG_LEVEL == 1
3527  #endif /* _ITERATOR_DEBUG_LEVEL */
3528 
3529  _Position _Prev(_Pos);
3530  if (_Res == 0)
3531  ;
3532  else if (_Res == &_Suffix)
3533  _Res = 0;
3534  else if (++_Cur < _Subs.size())
3535  _Res = _Current();
3536  else
3537  { // advance to next full match
3538  _Cur = 0;
3539  ++_Pos;
3540  if (!_Pos._Atend())
3541  _Res = _Current();
3542  else if (_Has_suffix() && _Prev->suffix().length() != 0)
3543  { // mark suffix
3544  _Suffix.matched = true;
3545  _Suffix.first = _Prev->suffix().first;
3546  _Suffix.second = _Prev->suffix().second;
3547  _Res = &_Suffix;
3548  }
3549  else
3550  _Res = 0;
3551  }
3552  return (*this);
3553  }
_Ty2 second
Definition: utility:271
bool _Atend() const
Definition: regex:3342
const value_type * _Res
Definition: regex:3564
bool matched
Definition: regex:664
_Position _Pos
Definition: regex:3563
value_type _Suffix
Definition: regex:3565
const value_type * _Current() const
Definition: regex:3590
_Ty1 first
Definition: utility:270
bool _Has_suffix() const
Definition: regex:3569
size_type size() const _NOEXCEPT
Definition: vector:1708
regex_iterator< _BidIt, _Elem, _RxTraits > _Position
Definition: regex:3366
size_t _Cur
Definition: regex:3566
vector< int > _Subs
Definition: regex:3567
#define _SCL_SECURE_VALIDATE_RANGE(cond)
Definition: yvals.h:432
#define _DEBUG_ERROR(mesg)
Definition: xutility:33
template<class _BidIt , class _Elem = _Iter_value_t<_BidIt>, class _RxTraits = regex_traits<_Elem>>
_Myt regex_token_iterator< _BidIt, _Elem, _RxTraits >::operator++ ( int  )
inline
3556  { // postincrement
3557  _Myt _Tmp = *this;
3558  ++*this;
3559  return (_Tmp);
3560  }
regex_token_iterator< _BidIt, _Elem, _RxTraits > _Myt
Definition: regex:3367
template<class _BidIt , class _Elem = _Iter_value_t<_BidIt>, class _RxTraits = regex_traits<_Elem>>
pointer regex_token_iterator< _BidIt, _Elem, _RxTraits >::operator-> ( ) const
inline
3513  { // return pointer to designated submatch
3514  return (pointer_traits<pointer>::pointer_to(**this));
3515  }
Definition: xmemory0:254
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
3461  { // assign from _Right
3462  if (this != _STD addressof(_Right))
3463  { // copy from _Right
3464  _Pos = _Right._Pos;
3465  _Cur = _Right._Cur;
3466  _Suffix = _Right._Suffix;
3467  _Subs = _Right._Subs;
3468  if (_Right._Res == 0)
3469  _Res = 0;
3470  else if (_Right._Res == &_Right._Suffix)
3471  _Res = &_Suffix;
3472  else
3473  _Res = _Current();
3474  }
3475  return (*this);
3476  }
_STD_BEGIN constexpr _Ty * addressof(_Ty &_Val) _NOEXCEPT
Definition: xstddef:628
const value_type * _Res
Definition: regex:3564
_Position _Pos
Definition: regex:3563
value_type _Suffix
Definition: regex:3565
const value_type * _Current() const
Definition: regex:3590
size_t _Cur
Definition: regex:3566
vector< int > _Subs
Definition: regex:3567
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
3479  { // test for equality
3480  if (_Res == 0 || _Right._Res == 0)
3481  return (_Res == _Right._Res);
3482  else if (*_Res == *_Right._Res
3483  && _Pos == _Right._Pos
3484  && _Subs == _Right._Subs)
3485  return (true);
3486  else
3487  return (false);
3488  }
const value_type * _Res
Definition: regex:3564
_Position _Pos
Definition: regex:3563
vector< int > _Subs
Definition: regex:3567
constexpr const _Ty &() _Right
Definition: algorithm:3723

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: