STLdoc
STLdocumentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Public Types | Public Member Functions | Private Attributes | List of all members
regex_iterator< _BidIt, _Elem, _RxTraits > Class Template Reference
Inheritance diagram for regex_iterator< _BidIt, _Elem, _RxTraits >:
_Iterator012< forward_iterator_tag, match_results< _BidIt >, ptrdiff_t, match_results< _BidIt > *, match_results< _BidIt > &, _Iterator_base > _Iterator_base0

Public Types

typedef regex_iterator< _BidIt, _Elem, _RxTraits > _Myt
 
typedef basic_regex< _Elem, _RxTraits > regex_type
 
typedef match_results< _BidIt > value_type
 
typedef ptrdiff_t difference_type
 
typedef const value_typepointer
 
typedef const value_typereference
 
typedef forward_iterator_tag iterator_category
 
- Public Types inherited from _Iterator012< forward_iterator_tag, match_results< _BidIt >, ptrdiff_t, match_results< _BidIt > *, match_results< _BidIt > &, _Iterator_base >
typedef forward_iterator_tag iterator_category
 
typedef match_results< _BidIt > value_type
 
typedef ptrdiff_t difference_type
 
typedef ptrdiff_t distance_type
 
typedef match_results< _BidIt > * pointer
 
typedef match_results< _BidIt > & reference
 

Public Member Functions

 regex_iterator ()
 
 regex_iterator (_BidIt _First, _BidIt _Last, const regex_type &_Re, regex_constants::match_flag_type _Fl=regex_constants::match_default)
 
bool operator== (const _Myt &_Right) const
 
bool operator!= (const _Myt &_Right) const
 
const value_typeoperator* () const
 
pointer operator-> () const
 
_Mytoperator++ ()
 
_Myt operator++ (int)
 
bool _Atend () const
 
- Public Member Functions inherited from _Iterator_base0
void _Adopt (const void *)
 
const _Container_base0_Getcont () const
 

Private Attributes

_BidIt _Begin
 
_BidIt _End
 
const regex_type_MyRe
 
regex_constants::match_flag_type _Flags
 
match_results< _BidIt > _MyVal
 

Member Typedef Documentation

template<class _BidIt , class _Elem = _REGEX_VALT(_BidIt), class _RxTraits = regex_traits<_Elem>>
typedef regex_iterator<_BidIt, _Elem, _RxTraits> regex_iterator< _BidIt, _Elem, _RxTraits >::_Myt
template<class _BidIt , class _Elem = _REGEX_VALT(_BidIt), class _RxTraits = regex_traits<_Elem>>
typedef ptrdiff_t regex_iterator< _BidIt, _Elem, _RxTraits >::difference_type
template<class _BidIt , class _Elem = _REGEX_VALT(_BidIt), class _RxTraits = regex_traits<_Elem>>
typedef forward_iterator_tag regex_iterator< _BidIt, _Elem, _RxTraits >::iterator_category
template<class _BidIt , class _Elem = _REGEX_VALT(_BidIt), class _RxTraits = regex_traits<_Elem>>
typedef const value_type* regex_iterator< _BidIt, _Elem, _RxTraits >::pointer
template<class _BidIt , class _Elem = _REGEX_VALT(_BidIt), class _RxTraits = regex_traits<_Elem>>
typedef const value_type& regex_iterator< _BidIt, _Elem, _RxTraits >::reference
template<class _BidIt , class _Elem = _REGEX_VALT(_BidIt), class _RxTraits = regex_traits<_Elem>>
typedef basic_regex<_Elem, _RxTraits> regex_iterator< _BidIt, _Elem, _RxTraits >::regex_type
template<class _BidIt , class _Elem = _REGEX_VALT(_BidIt), class _RxTraits = regex_traits<_Elem>>
typedef match_results<_BidIt> regex_iterator< _BidIt, _Elem, _RxTraits >::value_type

Constructor & Destructor Documentation

template<class _BidIt , class _Elem = _REGEX_VALT(_BidIt), class _RxTraits = regex_traits<_Elem>>
regex_iterator< _BidIt, _Elem, _RxTraits >::regex_iterator ( )
inline
3161  : _MyRe(0)
3162  { // construct end of sequence iterator
3163  }
const regex_type * _MyRe
Definition: regex:3287
template<class _BidIt , class _Elem = _REGEX_VALT(_BidIt), class _RxTraits = regex_traits<_Elem>>
regex_iterator< _BidIt, _Elem, _RxTraits >::regex_iterator ( _BidIt  _First,
_BidIt  _Last,
const regex_type _Re,
regex_constants::match_flag_type  _Fl = regex_constants::match_default 
)
inline
3169  : _Begin(_First), _End(_Last), _MyRe(&_Re), _Flags(_Fl)
3170  { // construct from regular expression and target text
3172  _MyRe = 0;
3173  else
3174  this->_Adopt(_MyRe);
3175  }
const regex_type * _MyRe
Definition: regex:3287
match_results< _BidIt > _MyVal
Definition: regex:3289
regex_constants::match_flag_type _Flags
Definition: regex:3288
bool _Regex_search(_It _First, _It _Last, match_results< _BidIt, _Alloc > *_Matches, const basic_regex< _Elem, _RxTraits > &_Re, regex_constants::match_flag_type _Flgs, _It _Org)
Definition: regex:2781
_BidIt _End
Definition: regex:3286
_BidIt _Begin
Definition: regex:3286
void _Adopt(const void *)
Definition: xutility:53
_FwdIt _Last
Definition: algorithm:1936

Member Function Documentation

template<class _BidIt , class _Elem = _REGEX_VALT(_BidIt), class _RxTraits = regex_traits<_Elem>>
bool regex_iterator< _BidIt, _Elem, _RxTraits >::_Atend ( ) const
inline
3281  { // test for end iterator
3282  return (_MyRe == 0);
3283  }
const regex_type * _MyRe
Definition: regex:3287
template<class _BidIt , class _Elem = _REGEX_VALT(_BidIt), class _RxTraits = regex_traits<_Elem>>
bool regex_iterator< _BidIt, _Elem, _RxTraits >::operator!= ( const _Myt _Right) const
inline
3190  { // test for inequality
3191  return (!(*this == _Right));
3192  }
const _Ty & _Right
Definition: algorithm:4087
template<class _BidIt , class _Elem = _REGEX_VALT(_BidIt), class _RxTraits = regex_traits<_Elem>>
const value_type& regex_iterator< _BidIt, _Elem, _RxTraits >::operator* ( ) const
inline
3195  { // return designated match
3196  #if _ITERATOR_DEBUG_LEVEL == 2
3197  if (_MyRe == 0)
3198  { // report error
3199  _DEBUG_ERROR("regex_iterator not dereferencable");
3201  }
3202 
3203  #elif _ITERATOR_DEBUG_LEVEL == 1
3205  #endif /* _ITERATOR_DEBUG_LEVEL */
3206 
3207  return (_MyVal);
3208  }
const regex_type * _MyRe
Definition: regex:3287
match_results< _BidIt > _MyVal
Definition: regex:3289
#define _SCL_SECURE_OUT_OF_RANGE
Definition: yvals.h:351
#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_iterator< _BidIt, _Elem, _RxTraits >::operator++ ( )
inline
3216  { // preincrement
3217  #if _ITERATOR_DEBUG_LEVEL == 2
3218  if (_MyRe == 0)
3219  { // report error
3220  _DEBUG_ERROR("regex_iterator not incrementable");
3222  }
3223 
3224  #elif _ITERATOR_DEBUG_LEVEL == 1
3226  #endif /* _ITERATOR_DEBUG_LEVEL */
3227 
3228  if (_MyRe == 0)
3229  return (*this);
3230 
3231  _BidIt _Start = _MyVal._At(0).second;
3232 
3233  #if _ITERATOR_DEBUG_LEVEL == 2
3234  if (this->_Getcont() == 0)
3235  { // report error
3236  _DEBUG_ERROR("regex_iterator orphaned");
3238  }
3239 
3240  #elif _ITERATOR_DEBUG_LEVEL == 1
3241  _SCL_SECURE_VALIDATE(this->_Getcont() != 0);
3242  #endif /* _ITERATOR_DEBUG_LEVEL */
3243 
3244  if (_MyVal._At(0).first == _MyVal._At(0).second)
3245  { // handle zero-length match
3246  if (_Start == _End)
3247  { // store end-of-sequence iterator
3248  _MyRe = 0;
3249 
3250  #if _ITERATOR_DEBUG_LEVEL == 2
3251  this->_Orphan_me();
3252  #endif /* _ITERATOR_DEBUG_LEVEL */
3253 
3254  return (*this);
3255  }
3256  if (_Regex_search(_Start, _End, &_MyVal, *_MyRe,
3259  _Begin))
3260  return (*this);
3261  ++_Start;
3262  }
3264  if (_Regex_search(_Start, _End, &_MyVal, *_MyRe, _Flags, _Begin))
3265  return (*this);
3266  else
3267  { // mark at end of sequence
3268  _MyRe = 0;
3269  return (*this);
3270  }
3271  }
const regex_type * _MyRe
Definition: regex:3287
const _Container_base0 * _Getcont() const
Definition: xutility:57
#define _SCL_SECURE_INVALID_ARGUMENT
Definition: yvals.h:350
Definition: regex:160
match_results< _BidIt > _MyVal
Definition: regex:3289
_Ty1 first
Definition: utility:198
_Elem & _At(unsigned int _Sub)
Definition: regex:1407
#define _SCL_SECURE_OUT_OF_RANGE
Definition: yvals.h:351
regex_constants::match_flag_type _Flags
Definition: regex:3288
bool _Regex_search(_It _First, _It _Last, match_results< _BidIt, _Alloc > *_Matches, const basic_regex< _Elem, _RxTraits > &_Re, regex_constants::match_flag_type _Flgs, _It _Org)
Definition: regex:2781
#define _SCL_SECURE_VALIDATE_RANGE(cond)
Definition: yvals.h:347
#define _DEBUG_ERROR(mesg)
Definition: xutility:32
_BidIt _End
Definition: regex:3286
_BidIt _Begin
Definition: regex:3286
second
Definition: utility:167
#define _SCL_SECURE_VALIDATE(cond)
Definition: yvals.h:346
template<class _BidIt , class _Elem = _REGEX_VALT(_BidIt), class _RxTraits = regex_traits<_Elem>>
_Myt regex_iterator< _BidIt, _Elem, _RxTraits >::operator++ ( int  )
inline
3274  { // postincrement
3275  _Myt _Tmp = *this;
3276  ++*this;
3277  return (_Tmp);
3278  }
regex_iterator< _BidIt, _Elem, _RxTraits > _Myt
Definition: regex:3152
template<class _BidIt , class _Elem = _REGEX_VALT(_BidIt), class _RxTraits = regex_traits<_Elem>>
pointer regex_iterator< _BidIt, _Elem, _RxTraits >::operator-> ( ) const
inline
3211  { // return pointer to designated match
3212  return (_STD pointer_traits<pointer>::pointer_to(**this));
3213  }
Definition: xmemory0:198
template<class _BidIt , class _Elem = _REGEX_VALT(_BidIt), class _RxTraits = regex_traits<_Elem>>
bool regex_iterator< _BidIt, _Elem, _RxTraits >::operator== ( const _Myt _Right) const
inline
3178  { // test for equality
3179  if (_MyRe != _Right._MyRe)
3180  return (false);
3181  else if (_MyRe == 0)
3182  return (true);
3183  return (_Begin == _Right._Begin
3184  && _End == _Right._End
3185  && _Flags == _Right._Flags
3186  && _MyVal._At(0) == _Right._MyVal._At(0));
3187  }
const regex_type * _MyRe
Definition: regex:3287
match_results< _BidIt > _MyVal
Definition: regex:3289
_Elem & _At(unsigned int _Sub)
Definition: regex:1407
regex_constants::match_flag_type _Flags
Definition: regex:3288
_BidIt _End
Definition: regex:3286
_BidIt _Begin
Definition: regex:3286
const _Ty & _Right
Definition: algorithm:4087

Member Data Documentation

template<class _BidIt , class _Elem = _REGEX_VALT(_BidIt), class _RxTraits = regex_traits<_Elem>>
_BidIt regex_iterator< _BidIt, _Elem, _RxTraits >::_Begin
private
template<class _BidIt , class _Elem = _REGEX_VALT(_BidIt), class _RxTraits = regex_traits<_Elem>>
_BidIt regex_iterator< _BidIt, _Elem, _RxTraits >::_End
private
template<class _BidIt , class _Elem = _REGEX_VALT(_BidIt), class _RxTraits = regex_traits<_Elem>>
regex_constants::match_flag_type regex_iterator< _BidIt, _Elem, _RxTraits >::_Flags
private
template<class _BidIt , class _Elem = _REGEX_VALT(_BidIt), class _RxTraits = regex_traits<_Elem>>
const regex_type* regex_iterator< _BidIt, _Elem, _RxTraits >::_MyRe
private
template<class _BidIt , class _Elem = _REGEX_VALT(_BidIt), class _RxTraits = regex_traits<_Elem>>
match_results<_BidIt> regex_iterator< _BidIt, _Elem, _RxTraits >::_MyVal
private

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