STLdoc
STLdocumentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Public Types | Public Member Functions | Public Attributes | List of all members
_String_const_iterator< _Mystr > Class Template Reference
Inheritance diagram for _String_const_iterator< _Mystr >:
_Iterator012< random_access_iterator_tag, _Mystr::value_type, _Mystr::difference_type, _Mystr::const_pointer, _Mystr::const_reference, _Iterator_base > _Iterator_base0 _String_iterator< _Mystr >

Public Types

typedef _String_const_iterator< _Mystr > _Myiter
 
typedef random_access_iterator_tag iterator_category
 
typedef _Mystr::value_type value_type
 
typedef _Mystr::difference_type difference_type
 
typedef _Mystr::const_pointer pointer
 
typedef _Mystr::const_reference reference
 
typedef pointer _Unchecked_type
 
- Public Types inherited from _Iterator012< random_access_iterator_tag, _Mystr::value_type, _Mystr::difference_type, _Mystr::const_pointer, _Mystr::const_reference, _Iterator_base >
typedef random_access_iterator_tag iterator_category
 
typedef _Mystr::value_type value_type
 
typedef _Mystr::difference_type difference_type
 
typedef _Mystr::const_pointer pointer
 
typedef _Mystr::const_reference reference
 

Public Member Functions

 _String_const_iterator ()
 
 _String_const_iterator (pointer _Parg, const _Container_base *_Pstring)
 
_Myiter_Rechecked (_Unchecked_type _Right)
 
_Unchecked_type _Unchecked () const
 
reference operator* () const
 
pointer operator-> () const
 
_Myiteroperator++ ()
 
_Myiter operator++ (int)
 
_Myiteroperator-- ()
 
_Myiter operator-- (int)
 
_Myiteroperator+= (difference_type _Off)
 
_Myiter operator+ (difference_type _Off) const
 
_Myiteroperator-= (difference_type _Off)
 
_Myiter operator- (difference_type _Off) const
 
difference_type operator- (const _Myiter &_Right) const
 
reference operator[] (difference_type _Off) const
 
bool operator== (const _Myiter &_Right) const
 
bool operator!= (const _Myiter &_Right) const
 
bool operator< (const _Myiter &_Right) const
 
bool operator> (const _Myiter &_Right) const
 
bool operator<= (const _Myiter &_Right) const
 
bool operator>= (const _Myiter &_Right) const
 
void _Compat (const _Myiter &) const
 
- Public Member Functions inherited from _Iterator_base0
void _Adopt (const void *)
 
const _Container_base0_Getcont () const
 

Public Attributes

pointer _Ptr
 

Member Typedef Documentation

template<class _Mystr>
typedef _String_const_iterator<_Mystr> _String_const_iterator< _Mystr >::_Myiter
template<class _Mystr>
typedef pointer _String_const_iterator< _Mystr >::_Unchecked_type
template<class _Mystr>
typedef _Mystr::difference_type _String_const_iterator< _Mystr >::difference_type
template<class _Mystr>
typedef random_access_iterator_tag _String_const_iterator< _Mystr >::iterator_category
template<class _Mystr>
typedef _Mystr::const_pointer _String_const_iterator< _Mystr >::pointer
template<class _Mystr>
typedef _Mystr::const_reference _String_const_iterator< _Mystr >::reference
template<class _Mystr>
typedef _Mystr::value_type _String_const_iterator< _Mystr >::value_type

Constructor & Destructor Documentation

template<class _Mystr>
_String_const_iterator< _Mystr >::_String_const_iterator ( )
inline
43  : _Ptr()
44  { // construct with null pointer
45  }
pointer _Ptr
Definition: xstring:273
template<class _Mystr>
_String_const_iterator< _Mystr >::_String_const_iterator ( pointer  _Parg,
const _Container_base _Pstring 
)
inline
48  : _Ptr(_Parg)
49  { // construct with pointer _Parg
50  this->_Adopt(_Pstring);
51  }
pointer _Ptr
Definition: xstring:273
void _Adopt(const void *)
Definition: xutility:53

Member Function Documentation

template<class _Mystr>
void _String_const_iterator< _Mystr >::_Compat ( const _Myiter ) const
inline
269  { // test for compatible iterator pair
270  }
template<class _Mystr>
_Myiter& _String_const_iterator< _Mystr >::_Rechecked ( _Unchecked_type  _Right)
inline
56  { // reset from unchecked iterator
57  _Ptr = _Right;
58  return (*this);
59  }
pointer _Ptr
Definition: xstring:273
constexpr const _Ty &() _Right
Definition: algorithm:3591
template<class _Mystr>
_Unchecked_type _String_const_iterator< _Mystr >::_Unchecked ( ) const
inline
62  { // make an unchecked iterator
63  return (_Ptr);
64  }
pointer _Ptr
Definition: xstring:273
template<class _Mystr>
bool _String_const_iterator< _Mystr >::operator!= ( const _Myiter _Right) const
inline
226  { // test for iterator inequality
227  return (!(*this == _Right));
228  }
constexpr const _Ty &() _Right
Definition: algorithm:3591
template<class _Mystr>
reference _String_const_iterator< _Mystr >::operator* ( ) const
inline
67  { // return designated object
68  #if _ITERATOR_DEBUG_LEVEL == 2
69  const auto _Mycont = static_cast<const _Mystr *>(this->_Getcont());
70  const auto _Contptr = _Mycont ? _Mycont->_Myptr() : 0;
71  if (_Mycont == 0
72  || _Ptr == nullptr_t{}
73  || _Unfancy(_Ptr) < _Contptr
74  || _Contptr + _Mycont->_Mysize <= _Unfancy(_Ptr))
75  { // report error
76  _DEBUG_ERROR("string iterator not dereferencable");
78  }
79 
80  #elif _ITERATOR_DEBUG_LEVEL == 1
81  _SCL_SECURE_VALIDATE(_Ptr != nullptr_t{});
82  const auto _Mycont = static_cast<const _Mystr *>(this->_Getcont());
83  _SCL_SECURE_VALIDATE(_Mycont != 0);
84  const auto _Contptr = _Mycont->_Myptr();
85  _SCL_SECURE_VALIDATE_RANGE(_Contptr <= _Unfancy(_Ptr) && _Unfancy(_Ptr) < _Contptr + _Mycont->_Mysize);
86  #endif /* _ITERATOR_DEBUG_LEVEL */
87 
88  _Analysis_assume_(_Ptr != nullptr_t{});
89 
90  return (*_Ptr);
91  }
const _Container_base0 * _Getcont() const
Definition: xutility:57
#define _SCL_SECURE_OUT_OF_RANGE
Definition: yvals.h:396
#define _Analysis_assume_(expr)
Definition: sal.h:2896
pointer _Ptr
Definition: xstring:273
#define _SCL_SECURE_VALIDATE_RANGE(cond)
Definition: yvals.h:392
#define _DEBUG_ERROR(mesg)
Definition: xutility:32
auto _Unfancy(_Ptrty _Ptr)
Definition: xstddef:732
#define _SCL_SECURE_VALIDATE(cond)
Definition: yvals.h:391
template<class _Mystr>
_Myiter _String_const_iterator< _Mystr >::operator+ ( difference_type  _Off) const
inline
192  { // return this + integer
193  _Myiter _Tmp = *this;
194  return (_Tmp += _Off);
195  }
_String_const_iterator< _Mystr > _Myiter
Definition: xstring:34
template<class _Mystr>
_Myiter& _String_const_iterator< _Mystr >::operator++ ( )
inline
99  { // preincrement
100  #if _ITERATOR_DEBUG_LEVEL == 2
101  const auto _Mycont = static_cast<const _Mystr *>(this->_Getcont());
102  if (_Mycont == 0
103  || _Ptr == nullptr_t{}
104  || _Mycont->_Myptr() + _Mycont->_Mysize <= _Unfancy(_Ptr))
105  { // report error
106  _DEBUG_ERROR("string iterator not incrementable");
108  }
109 
110  #elif _ITERATOR_DEBUG_LEVEL == 1
111  _SCL_SECURE_VALIDATE(_Ptr != nullptr_t{});
112  const auto _Mycont = static_cast<const _Mystr *>(this->_Getcont());
113  _SCL_SECURE_VALIDATE(_Mycont != 0);
114  _SCL_SECURE_VALIDATE_RANGE(_Unfancy(_Ptr) < _Mycont->_Myptr() + _Mycont->_Mysize);
115  #endif /* _ITERATOR_DEBUG_LEVEL */
116 
117  ++_Ptr;
118  return (*this);
119  }
const _Container_base0 * _Getcont() const
Definition: xutility:57
#define _SCL_SECURE_OUT_OF_RANGE
Definition: yvals.h:396
pointer _Ptr
Definition: xstring:273
#define _SCL_SECURE_VALIDATE_RANGE(cond)
Definition: yvals.h:392
#define _DEBUG_ERROR(mesg)
Definition: xutility:32
auto _Unfancy(_Ptrty _Ptr)
Definition: xstddef:732
#define _SCL_SECURE_VALIDATE(cond)
Definition: yvals.h:391
template<class _Mystr>
_Myiter _String_const_iterator< _Mystr >::operator++ ( int  )
inline
122  { // postincrement
123  _Myiter _Tmp = *this;
124  ++*this;
125  return (_Tmp);
126  }
_String_const_iterator< _Mystr > _Myiter
Definition: xstring:34
template<class _Mystr>
_Myiter& _String_const_iterator< _Mystr >::operator+= ( difference_type  _Off)
inline
159  { // increment by integer
160  #if _ITERATOR_DEBUG_LEVEL == 2
161  if (_Off != 0)
162  {
163  const auto _Mycont = static_cast<const _Mystr *>(this->_Getcont());
164  const auto _Contptr = _Mycont ? _Mycont->_Myptr() : 0;
165  if (_Mycont == 0
166  || _Ptr == nullptr_t{}
167  || _Unfancy(_Ptr) + _Off < _Contptr
168  || _Contptr + _Mycont->_Mysize < _Unfancy(_Ptr) + _Off)
169  {
170  _DEBUG_ERROR("string iterator + offset out of range");
172  }
173  }
174 
175  #elif _ITERATOR_DEBUG_LEVEL == 1
176  if (_Off != 0)
177  {
178  _SCL_SECURE_VALIDATE(_Ptr != nullptr_t{});
179  const auto _Mycont = static_cast<const _Mystr *>(this->_Getcont());
180  _SCL_SECURE_VALIDATE(_Mycont != 0);
181  const auto _Contptr = _Mycont->_Myptr();
182  _SCL_SECURE_VALIDATE_RANGE(_Contptr <= _Unfancy(_Ptr) + _Off
183  && _Unfancy(_Ptr) + _Off <= _Contptr + _Mycont->_Mysize);
184  }
185  #endif /* _ITERATOR_DEBUG_LEVEL */
186 
187  _Ptr += _Off;
188  return (*this);
189  }
const _Container_base0 * _Getcont() const
Definition: xutility:57
#define _SCL_SECURE_OUT_OF_RANGE
Definition: yvals.h:396
pointer _Ptr
Definition: xstring:273
#define _SCL_SECURE_VALIDATE_RANGE(cond)
Definition: yvals.h:392
#define _DEBUG_ERROR(mesg)
Definition: xutility:32
auto _Unfancy(_Ptrty _Ptr)
Definition: xstddef:732
#define _SCL_SECURE_VALIDATE(cond)
Definition: yvals.h:391
template<class _Mystr>
_Myiter _String_const_iterator< _Mystr >::operator- ( difference_type  _Off) const
inline
203  { // return this - integer
204  _Myiter _Tmp = *this;
205  return (_Tmp -= _Off);
206  }
_String_const_iterator< _Mystr > _Myiter
Definition: xstring:34
template<class _Mystr>
difference_type _String_const_iterator< _Mystr >::operator- ( const _Myiter _Right) const
inline
209  { // return difference of iterators
210  _Compat(_Right);
211  return (_Ptr - _Right._Ptr);
212  }
void _Compat(const _Myiter &) const
Definition: xstring:268
pointer _Ptr
Definition: xstring:273
constexpr const _Ty &() _Right
Definition: algorithm:3591
template<class _Mystr>
_Myiter& _String_const_iterator< _Mystr >::operator-- ( )
inline
129  { // predecrement
130  #if _ITERATOR_DEBUG_LEVEL == 2
131  const auto _Mycont = static_cast<const _Mystr *>(this->_Getcont());
132  if (_Mycont == 0
133  || _Ptr == nullptr_t{}
134  || _Unfancy(_Ptr) <= _Mycont->_Myptr())
135  { // report error
136  _DEBUG_ERROR("string iterator not decrementable");
138  }
139 
140  #elif _ITERATOR_DEBUG_LEVEL == 1
141  _SCL_SECURE_VALIDATE(_Ptr != nullptr_t{});
142  const auto _Mycont = static_cast<const _Mystr *>(this->_Getcont());
143  _SCL_SECURE_VALIDATE(_Mycont != 0);
144  _SCL_SECURE_VALIDATE_RANGE(_Mycont->_Myptr() < _Unfancy(_Ptr));
145  #endif /* _ITERATOR_DEBUG_LEVEL */
146 
147  --_Ptr;
148  return (*this);
149  }
const _Container_base0 * _Getcont() const
Definition: xutility:57
#define _SCL_SECURE_OUT_OF_RANGE
Definition: yvals.h:396
pointer _Ptr
Definition: xstring:273
#define _SCL_SECURE_VALIDATE_RANGE(cond)
Definition: yvals.h:392
#define _DEBUG_ERROR(mesg)
Definition: xutility:32
auto _Unfancy(_Ptrty _Ptr)
Definition: xstddef:732
#define _SCL_SECURE_VALIDATE(cond)
Definition: yvals.h:391
template<class _Mystr>
_Myiter _String_const_iterator< _Mystr >::operator-- ( int  )
inline
152  { // postdecrement
153  _Myiter _Tmp = *this;
154  --*this;
155  return (_Tmp);
156  }
_String_const_iterator< _Mystr > _Myiter
Definition: xstring:34
template<class _Mystr>
_Myiter& _String_const_iterator< _Mystr >::operator-= ( difference_type  _Off)
inline
198  { // decrement by integer
199  return (*this += -_Off);
200  }
template<class _Mystr>
pointer _String_const_iterator< _Mystr >::operator-> ( ) const
inline
94  { // return pointer to class object
95  return (pointer_traits<pointer>::pointer_to(**this));
96  }
Definition: xmemory0:244
template<class _Mystr>
bool _String_const_iterator< _Mystr >::operator< ( const _Myiter _Right) const
inline
231  { // test if this < _Right
232  _Compat(_Right);
233  return (_Ptr < _Right._Ptr);
234  }
void _Compat(const _Myiter &) const
Definition: xstring:268
pointer _Ptr
Definition: xstring:273
constexpr const _Ty &() _Right
Definition: algorithm:3591
template<class _Mystr>
bool _String_const_iterator< _Mystr >::operator<= ( const _Myiter _Right) const
inline
242  { // test if this <= _Right
243  return (!(_Right < *this));
244  }
constexpr const _Ty &() _Right
Definition: algorithm:3591
template<class _Mystr>
bool _String_const_iterator< _Mystr >::operator== ( const _Myiter _Right) const
inline
220  { // test for iterator equality
221  _Compat(_Right);
222  return (_Ptr == _Right._Ptr);
223  }
void _Compat(const _Myiter &) const
Definition: xstring:268
pointer _Ptr
Definition: xstring:273
constexpr const _Ty &() _Right
Definition: algorithm:3591
template<class _Mystr>
bool _String_const_iterator< _Mystr >::operator> ( const _Myiter _Right) const
inline
237  { // test if this > _Right
238  return (_Right < *this);
239  }
constexpr const _Ty &() _Right
Definition: algorithm:3591
template<class _Mystr>
bool _String_const_iterator< _Mystr >::operator>= ( const _Myiter _Right) const
inline
247  { // test if this >= _Right
248  return (!(*this < _Right));
249  }
constexpr const _Ty &() _Right
Definition: algorithm:3591
template<class _Mystr>
reference _String_const_iterator< _Mystr >::operator[] ( difference_type  _Off) const
inline
215  { // subscript
216  return (*(*this + _Off));
217  }

Member Data Documentation

template<class _Mystr>
pointer _String_const_iterator< _Mystr >::_Ptr

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