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
tr2::sys::_Path_iterator< _Path > Class Template Reference
Inheritance diagram for tr2::sys::_Path_iterator< _Path >:
iterator< bidirectional_iterator_tag, _Path::string_type, ptrdiff_t, _Path::string_type *, _Path::string_type & >

Public Types

typedef _Path_iterator< _Path > _Myt
 
typedef _Path path_type
 
typedef _Path::string_type string_type
 
typedef const _Path::string_type * pointer
 
typedef const _Path::string_type & reference
 
- Public Types inherited from iterator< bidirectional_iterator_tag, _Path::string_type, ptrdiff_t, _Path::string_type *, _Path::string_type & >
typedef bidirectional_iterator_tag iterator_category
 
typedef _Path::string_type value_type
 
typedef ptrdiff_t difference_type
 
typedef ptrdiff_t distance_type
 
typedef _Path::string_type * pointer
 
typedef _Path::string_type & reference
 

Public Member Functions

 _Path_iterator ()
 
 _Path_iterator (const path_type &_Pval, size_t _Off)
 
 _Path_iterator (const _Path_iterator &_Right)
 
_Path_iteratoroperator= (const _Path_iterator &_Right)
 
 _Path_iterator (_Path_iterator &&_Right)
 
_Path_iteratoroperator= (_Path_iterator &&_Right)
 
reference operator* () const
 
pointer operator-> () const
 
_Mytoperator++ ()
 
_Myt operator++ (int)
 
_Mytoperator-- ()
 
_Myt operator-- (int)
 
bool operator== (const _Myt &_Right) const
 
bool operator!= (const _Myt &_Right) const
 

Private Member Functions

void _Getval ()
 

Private Attributes

const path_type_Myptr
 
string_type _Myelem
 
size_t _Myoff
 

Member Typedef Documentation

template<class _Path >
typedef _Path_iterator<_Path> tr2::sys::_Path_iterator< _Path >::_Myt
template<class _Path >
typedef _Path tr2::sys::_Path_iterator< _Path >::path_type
template<class _Path >
typedef const _Path::string_type* tr2::sys::_Path_iterator< _Path >::pointer
template<class _Path >
typedef const _Path::string_type& tr2::sys::_Path_iterator< _Path >::reference
template<class _Path >
typedef _Path::string_type tr2::sys::_Path_iterator< _Path >::string_type

Constructor & Destructor Documentation

template<class _Path >
tr2::sys::_Path_iterator< _Path >::_Path_iterator ( )
inline
88  : _Myptr(0), _Myoff(0)
89  { // construct singular iterator
90  }
size_t _Myoff
Definition: filesystem:267
const path_type * _Myptr
Definition: filesystem:265
template<class _Path >
tr2::sys::_Path_iterator< _Path >::_Path_iterator ( const path_type _Pval,
size_t  _Off 
)
inline
93  : _Myptr(&_Pval), _Myoff(_Off)
94  { // construct iterator
95  _Getval();
96  }
void _Getval()
Definition: filesystem:231
size_t _Myoff
Definition: filesystem:267
const path_type * _Myptr
Definition: filesystem:265
template<class _Path >
tr2::sys::_Path_iterator< _Path >::_Path_iterator ( const _Path_iterator< _Path > &  _Right)
inline
99  : _Myptr(_Right._Myptr),
100  _Myelem(_Right._Myelem),
101  _Myoff(_Right._Myoff)
102  { // copy construct
103  }
string_type _Myelem
Definition: filesystem:266
size_t _Myoff
Definition: filesystem:267
const _Ty & _Right
Definition: algorithm:4087
const path_type * _Myptr
Definition: filesystem:265
template<class _Path >
tr2::sys::_Path_iterator< _Path >::_Path_iterator ( _Path_iterator< _Path > &&  _Right)
inline
114  : _Myptr(_Right._Myptr),
115  _Myelem(_STD move(_Right._Myelem)),
116  _Myoff(_Right._Myoff)
117  { // move construct
118  }
_OutIt move(_InIt _First, _InIt _Last, _OutIt _Dest)
Definition: xutility:2447
string_type _Myelem
Definition: filesystem:266
size_t _Myoff
Definition: filesystem:267
const _Ty & _Right
Definition: algorithm:4087
const path_type * _Myptr
Definition: filesystem:265

Member Function Documentation

template<class _Path >
void tr2::sys::_Path_iterator< _Path >::_Getval ( )
inlineprivate
232  { // determine _Myelem
233  size_t _Pend = _Myptr->_Prefix_end();
234  size_t _Size = _Myptr->_Mystr.size();
235 
236  _Myelem.clear();
237  if (_Size <= _Myoff)
238  ; // off end, no field
239  else if (_Myoff < _Pend)
240  _Myelem = _Myptr->_Mystr.substr(0, _Pend); // get "x:"
241  else if (_Myoff == _Pend && _Pend < _Size
242  && _Myptr->_Mystr[_Pend] == slash<path_type>::value)
243  _Myelem = slash<path_type>::value; // get "/"
244  else
245  { // determine next field as slashes followed by stuff
246  size_t _Nslash = 0;
247  size_t _Nstuff = 0;
248 
249  for (; _Myoff + _Nslash < _Size; ++_Nslash)
250  if (_Myptr->_Mystr[_Myoff + _Nslash]
251  != slash<path_type>::value)
252  break;
253  for (; _Myoff + _Nslash + _Nstuff < _Size; ++_Nstuff)
254  if (_Myptr->_Mystr[_Myoff + _Nslash + _Nstuff]
255  == slash<path_type>::value)
256  break;
257  if (0 < _Nstuff)
258  _Myelem = _Myptr->_Mystr.substr(_Myoff + _Nslash,
259  _Nstuff); // get "stuff"
260  else if (0 < _Nslash)
261  _Myelem = dot<path_type>::value; // get "."
262  }
263  }
string_type _Myelem
Definition: filesystem:266
size_t _Myoff
Definition: filesystem:267
_Check_return_ _In_ long _Size
Definition: io.h:325
const path_type * _Myptr
Definition: filesystem:265
template<class _Path >
bool tr2::sys::_Path_iterator< _Path >::operator!= ( const _Myt _Right) const
inline
226  { // test for iterator inequality
227  return (!(*this == _Right));
228  }
const _Ty & _Right
Definition: algorithm:4087
template<class _Path >
reference tr2::sys::_Path_iterator< _Path >::operator* ( ) const
inline
129  { // return designated value
130  return (_Myelem);
131  }
string_type _Myelem
Definition: filesystem:266
template<class _Path >
_Myt& tr2::sys::_Path_iterator< _Path >::operator++ ( )
inline
139  { // preincrement
140  #pragma warning(push)
141  #pragma warning(disable: 6011) /* quiet analyze noise */
142 
143  #if _ITERATOR_DEBUG_LEVEL == 2
144  if (_Myptr == 0 || _Myptr->_Mystr.size() <= _Myoff)
145  _DEBUG_ERROR(
146  "basic_path<T>::iterator is not incrementable");
147 
148  #elif _ITERATOR_DEBUG_LEVEL == 1
149  _SCL_SECURE_VALIDATE(_Myptr != 0 && _Myoff < _Myptr->_Mystr.size());
150  #endif /* _ITERATOR_DEBUG_LEVEL */
151 
152  size_t _Pend = _Myptr->_Prefix_end();
153  size_t _Size = _Myptr->_Mystr.size();
154 
155  if (_Myoff < _Pend)
156  _Myoff = _Pend; // point past "x:"
157  else if (_Myoff == _Pend && _Pend < _Size
158  && _Myptr->_Mystr[_Pend] == slash<path_type>::value)
159  { // point past root "/" and following slashes
160  for (++_Myoff; _Myoff < _Size; ++_Myoff)
161  if (_Myptr->_Mystr[_Myoff]
162  != slash<path_type>::value)
163  break;
164  }
165  else
166  { // point past slashes followed by stuff
167  for (; _Myoff < _Size; ++_Myoff)
168  if (_Myptr->_Mystr[_Myoff]
169  != slash<path_type>::value)
170  break;
171  for (; _Myoff < _Size; ++_Myoff)
172  if (_Myptr->_Mystr[_Myoff]
173  == slash<path_type>::value)
174  break;
175  }
176  _Getval();
177  return (*this);
178 
179  #pragma warning(pop)
180  }
void _Getval()
Definition: filesystem:231
#define _DEBUG_ERROR(mesg)
Definition: xutility:32
size_t _Myoff
Definition: filesystem:267
_Check_return_ _In_ long _Size
Definition: io.h:325
#define _SCL_SECURE_VALIDATE(cond)
Definition: yvals.h:346
const path_type * _Myptr
Definition: filesystem:265
template<class _Path >
_Myt tr2::sys::_Path_iterator< _Path >::operator++ ( int  )
inline
183  { // postincrement
184  _Myt _Tmp = *this;
185  ++*this;
186  return (_Tmp);
187  }
_Path_iterator< _Path > _Myt
Definition: filesystem:81
template<class _Path >
_Myt& tr2::sys::_Path_iterator< _Path >::operator-- ( )
inline
190  { // predecrement
191  #if _ITERATOR_DEBUG_LEVEL == 2
192  if (_Myptr == 0 || _Myoff == 0)
193  _DEBUG_ERROR(
194  "basic_path<T>::iterator is not decrementable");
195 
196  #elif _ITERATOR_DEBUG_LEVEL == 1
197  _SCL_SECURE_VALIDATE(_Myptr != 0 && _Myoff != 0);
198  #endif /* _ITERATOR_DEBUG_LEVEL */
199 
200  size_t _Myoff_sav = _Myoff;
201  size_t _Off_back = 0;
202  _Myoff = 0;
203  do
204  { // scan down to previous
205  _Off_back = _Myoff;
206  ++*this;
207  } while (_Myoff < _Myoff_sav);
208  _Myoff = _Off_back;
209  _Getval();
210  return (*this);
211  }
void _Getval()
Definition: filesystem:231
#define _DEBUG_ERROR(mesg)
Definition: xutility:32
size_t _Myoff
Definition: filesystem:267
#define _SCL_SECURE_VALIDATE(cond)
Definition: yvals.h:346
const path_type * _Myptr
Definition: filesystem:265
template<class _Path >
_Myt tr2::sys::_Path_iterator< _Path >::operator-- ( int  )
inline
214  { // postdecrement
215  _Myt _Tmp = *this;
216  --*this;
217  return (_Tmp);
218  }
_Path_iterator< _Path > _Myt
Definition: filesystem:81
template<class _Path >
pointer tr2::sys::_Path_iterator< _Path >::operator-> ( ) const
inline
134  { // return pointer to class object
135  return (_STD pointer_traits<pointer>::pointer_to(**this));
136  }
Definition: xmemory0:198
template<class _Path >
_Path_iterator& tr2::sys::_Path_iterator< _Path >::operator= ( const _Path_iterator< _Path > &  _Right)
inline
106  { // copy assign
107  _Myptr = _Right._Myptr;
108  _Myelem = _Right._Myelem;
109  _Myoff = _Right._Myoff;
110  return (*this);
111  }
string_type _Myelem
Definition: filesystem:266
size_t _Myoff
Definition: filesystem:267
const _Ty & _Right
Definition: algorithm:4087
const path_type * _Myptr
Definition: filesystem:265
template<class _Path >
_Path_iterator& tr2::sys::_Path_iterator< _Path >::operator= ( _Path_iterator< _Path > &&  _Right)
inline
121  { // move assign
122  _Myptr = _Right._Myptr;
123  _Myelem = _STD move(_Right._Myelem);
124  _Myoff = _Right._Myoff;
125  return (*this);
126  }
_OutIt move(_InIt _First, _InIt _Last, _OutIt _Dest)
Definition: xutility:2447
string_type _Myelem
Definition: filesystem:266
size_t _Myoff
Definition: filesystem:267
const _Ty & _Right
Definition: algorithm:4087
const path_type * _Myptr
Definition: filesystem:265
template<class _Path >
bool tr2::sys::_Path_iterator< _Path >::operator== ( const _Myt _Right) const
inline
221  { // test for iterator equality
222  return (_Myptr == _Right._Myptr && _Myoff == _Right._Myoff);
223  }
size_t _Myoff
Definition: filesystem:267
const _Ty & _Right
Definition: algorithm:4087
const path_type * _Myptr
Definition: filesystem:265

Member Data Documentation

template<class _Path >
string_type tr2::sys::_Path_iterator< _Path >::_Myelem
private
template<class _Path >
size_t tr2::sys::_Path_iterator< _Path >::_Myoff
private
template<class _Path >
const path_type* tr2::sys::_Path_iterator< _Path >::_Myptr
private

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