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
experimental::filesystem::v1::_Path_iterator< _Path_type > Class Template Reference

Public Types

typedef _Path_iterator< _Path_type > _Myt
 
typedef _Path_type path_type
 
typedef _Path_type::string_type string_type
 
typedef bidirectional_iterator_tag iterator_category
 
typedef path_type value_type
 
typedef ptrdiff_t difference_type
 
typedef const value_typepointer
 
typedef const value_typereference
 

Public Member Functions

 _Path_iterator ()
 
 _Path_iterator (const path_type &_Path, size_t _Off)
 
 _Path_iterator (const _Path_iterator &_Right)
 
_Path_iteratoroperator= (const _Path_iterator &_Right)
 
 _Path_iterator (_Path_iterator &&_Right) _NOEXCEPT
 
_Path_iteratoroperator= (_Path_iterator &&_Right) _NOEXCEPT
 
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
 
path_type _Myelem
 
size_t _Myoff
 

Member Typedef Documentation

template<class _Path_type >
typedef _Path_iterator<_Path_type> experimental::filesystem::v1::_Path_iterator< _Path_type >::_Myt
template<class _Path_type >
typedef ptrdiff_t experimental::filesystem::v1::_Path_iterator< _Path_type >::difference_type
template<class _Path_type >
typedef _Path_type experimental::filesystem::v1::_Path_iterator< _Path_type >::path_type
template<class _Path_type >
typedef const value_type* experimental::filesystem::v1::_Path_iterator< _Path_type >::pointer
template<class _Path_type >
typedef const value_type& experimental::filesystem::v1::_Path_iterator< _Path_type >::reference
template<class _Path_type >
typedef _Path_type::string_type experimental::filesystem::v1::_Path_iterator< _Path_type >::string_type
template<class _Path_type >
typedef path_type experimental::filesystem::v1::_Path_iterator< _Path_type >::value_type

Constructor & Destructor Documentation

template<class _Path_type >
experimental::filesystem::v1::_Path_iterator< _Path_type >::_Path_iterator ( )
inline
664  : _Myptr(0), _Myoff(0)
665  { // construct singular iterator
666  }
const path_type * _Myptr
Definition: filesystem:832
size_t _Myoff
Definition: filesystem:834
template<class _Path_type >
experimental::filesystem::v1::_Path_iterator< _Path_type >::_Path_iterator ( const path_type _Path,
size_t  _Off 
)
inline
669  : _Myptr(&_Path), _Myoff(_Off)
670  { // construct iterator
671  _Getval();
672  }
_In_z_ wchar_t const * _Path
Definition: corecrt_wstdlib.h:337
const path_type * _Myptr
Definition: filesystem:832
size_t _Myoff
Definition: filesystem:834
void _Getval()
Definition: filesystem:799
template<class _Path_type >
experimental::filesystem::v1::_Path_iterator< _Path_type >::_Path_iterator ( const _Path_iterator< _Path_type > &  _Right)
inline
675  : _Myptr(_Right._Myptr),
676  _Myelem(_Right._Myelem),
677  _Myoff(_Right._Myoff)
678  { // copy construct
679  }
path_type _Myelem
Definition: filesystem:833
const path_type * _Myptr
Definition: filesystem:832
size_t _Myoff
Definition: filesystem:834
constexpr const _Ty &() _Right
Definition: algorithm:3723
template<class _Path_type >
experimental::filesystem::v1::_Path_iterator< _Path_type >::_Path_iterator ( _Path_iterator< _Path_type > &&  _Right)
inline
690  : _Myptr(_Right._Myptr),
691  _Myelem(_STD move(_Right._Myelem)),
692  _Myoff(_Right._Myoff)
693  { // move construct
694  }
path_type _Myelem
Definition: filesystem:833
const path_type * _Myptr
Definition: filesystem:832
size_t _Myoff
Definition: filesystem:834
constexpr remove_reference< _Ty >::type && move(_Ty &&_Arg) _NOEXCEPT
Definition: type_traits:1349
constexpr const _Ty &() _Right
Definition: algorithm:3723

Member Function Documentation

template<class _Path_type >
void experimental::filesystem::v1::_Path_iterator< _Path_type >::_Getval ( )
inlineprivate
800  { // determine _Myelem
801  string_type _Str;
802  size_t _Pend = _Myptr->_Prefix_end();
803  size_t _Size = _Myptr->_Mystr.size();
804 
805  if (_Size <= _Myoff)
806  ; // off end, no field
807  else if (_Myoff < _Pend)
808  _Str = _Myptr->_Mystr.substr(0, _Pend); // get "x:"
809  else if (_Myoff == _Pend && _Pend < _Size
810  && _FS_ISSEP(_Myptr->_Mystr[_Pend]))
811  _Str = _FS_PREF; // get "/"
812  else
813  { // determine next field as slashes followed by stuff
814  size_t _Nslash = 0;
815  size_t _Nstuff = 0;
816 
817  for (; _Myoff + _Nslash < _Size; ++_Nslash)
818  if (!_FS_ISSEP(_Myptr->_Mystr[_Myoff + _Nslash]))
819  break;
820  for (; _Myoff + _Nslash + _Nstuff < _Size; ++_Nstuff)
821  if (_FS_ISSEP(_Myptr->_Mystr[_Myoff + _Nslash + _Nstuff]))
822  break;
823  if (0 < _Nstuff)
824  _Str = _Myptr->_Mystr.substr(_Myoff + _Nslash,
825  _Nstuff); // get "stuff"
826  else if (0 < _Nslash)
827  _Str = _FS_PERIOD; // get "."
828  }
829  _Myelem = _Str;
830  }
#define _FS_ISSEP(x)
Definition: filesystem:33
_Path_type::string_type string_type
Definition: filesystem:655
path_type _Myelem
Definition: filesystem:833
_CRT_BEGIN_C_HEADER _Check_return_ _Ret_maybenull_ _In_ size_t _Size
Definition: corecrt_malloc.h:58
const path_type * _Myptr
Definition: filesystem:832
size_t _Myoff
Definition: filesystem:834
#define _FS_PERIOD
Definition: filesystem:37
#define _FS_PREF
Definition: filesystem:34
template<class _Path_type >
bool experimental::filesystem::v1::_Path_iterator< _Path_type >::operator!= ( const _Myt _Right) const
inline
794  { // test for iterator inequality
795  return (!(*this == _Right));
796  }
constexpr const _Ty &() _Right
Definition: algorithm:3723
template<class _Path_type >
reference experimental::filesystem::v1::_Path_iterator< _Path_type >::operator* ( ) const
inline
705  { // return designated value
706  return (_Myelem);
707  }
path_type _Myelem
Definition: filesystem:833
template<class _Path_type >
_Myt& experimental::filesystem::v1::_Path_iterator< _Path_type >::operator++ ( )
inline
715  { // preincrement
716  #if _ITERATOR_DEBUG_LEVEL == 2
717  if (_Myptr == 0 || _Myptr->_Mystr.size() <= _Myoff)
718  {
719  _DEBUG_ERROR("path::iterator is not incrementable");
720  }
721  #elif _ITERATOR_DEBUG_LEVEL == 1
722  _SCL_SECURE_VALIDATE(_Myptr != 0 && _Myoff < _Myptr->_Mystr.size());
723  #endif /* _ITERATOR_DEBUG_LEVEL */
724 
725  size_t _Pend = _Myptr->_Prefix_end();
726  size_t _Size = _Myptr->_Mystr.size();
727 
728  if (_Myoff < _Pend)
729  _Myoff = _Pend; // point past "x:"
730  else if (_Myoff == _Pend && _Pend < _Size
731  && _FS_ISSEP(_Myptr->_Mystr[_Pend]))
732  { // point past root "/" and following slashes
733  for (++_Myoff; _Myoff < _Size; ++_Myoff)
734  if (!_FS_ISSEP(_Myptr->_Mystr[_Myoff]))
735  break;
736  }
737  else
738  { // point past slashes followed by stuff
739  for (; _Myoff < _Size; ++_Myoff)
740  if (!_FS_ISSEP(_Myptr->_Mystr[_Myoff]))
741  break;
742  for (; _Myoff < _Size; ++_Myoff)
743  if (_FS_ISSEP(_Myptr->_Mystr[_Myoff]))
744  break;
745  }
746  _Getval();
747  return (*this);
748  }
#define _FS_ISSEP(x)
Definition: filesystem:33
_CRT_BEGIN_C_HEADER _Check_return_ _Ret_maybenull_ _In_ size_t _Size
Definition: corecrt_malloc.h:58
const path_type * _Myptr
Definition: filesystem:832
size_t _Myoff
Definition: filesystem:834
#define _DEBUG_ERROR(mesg)
Definition: xutility:33
void _Getval()
Definition: filesystem:799
#define _SCL_SECURE_VALIDATE(cond)
Definition: yvals.h:431
template<class _Path_type >
_Myt experimental::filesystem::v1::_Path_iterator< _Path_type >::operator++ ( int  )
inline
751  { // postincrement
752  _Myt _Tmp = *this;
753  ++*this;
754  return (_Tmp);
755  }
_Path_iterator< _Path_type > _Myt
Definition: filesystem:653
template<class _Path_type >
_Myt& experimental::filesystem::v1::_Path_iterator< _Path_type >::operator-- ( )
inline
758  { // predecrement
759  #if _ITERATOR_DEBUG_LEVEL == 2
760  if (_Myptr == 0 || _Myoff == 0)
761  {
762  _DEBUG_ERROR("path::iterator is not decrementable");
763  }
764  #elif _ITERATOR_DEBUG_LEVEL == 1
765  _SCL_SECURE_VALIDATE(_Myptr != 0 && _Myoff != 0);
766  #endif /* _ITERATOR_DEBUG_LEVEL */
767 
768  size_t _Myoff_sav = _Myoff;
769  size_t _Off_back = 0;
770  _Myoff = 0;
771  do
772  { // scan down to previous
773  _Off_back = _Myoff;
774  ++*this;
775  } while (_Myoff < _Myoff_sav);
776  _Myoff = _Off_back;
777  _Getval();
778  return (*this);
779  }
const path_type * _Myptr
Definition: filesystem:832
size_t _Myoff
Definition: filesystem:834
#define _DEBUG_ERROR(mesg)
Definition: xutility:33
void _Getval()
Definition: filesystem:799
#define _SCL_SECURE_VALIDATE(cond)
Definition: yvals.h:431
template<class _Path_type >
_Myt experimental::filesystem::v1::_Path_iterator< _Path_type >::operator-- ( int  )
inline
782  { // postdecrement
783  _Myt _Tmp = *this;
784  --*this;
785  return (_Tmp);
786  }
_Path_iterator< _Path_type > _Myt
Definition: filesystem:653
template<class _Path_type >
pointer experimental::filesystem::v1::_Path_iterator< _Path_type >::operator-> ( ) const
inline
710  { // return pointer to class object
711  return (pointer_traits<pointer>::pointer_to(**this));
712  }
Definition: xmemory0:254
template<class _Path_type >
_Path_iterator& experimental::filesystem::v1::_Path_iterator< _Path_type >::operator= ( const _Path_iterator< _Path_type > &  _Right)
inline
682  { // copy assign
683  _Myptr = _Right._Myptr;
684  _Myelem = _Right._Myelem;
685  _Myoff = _Right._Myoff;
686  return (*this);
687  }
path_type _Myelem
Definition: filesystem:833
const path_type * _Myptr
Definition: filesystem:832
size_t _Myoff
Definition: filesystem:834
constexpr const _Ty &() _Right
Definition: algorithm:3723
template<class _Path_type >
_Path_iterator& experimental::filesystem::v1::_Path_iterator< _Path_type >::operator= ( _Path_iterator< _Path_type > &&  _Right)
inline
697  { // move assign
698  _Myptr = _Right._Myptr;
699  _Myelem = _STD move(_Right._Myelem);
700  _Myoff = _Right._Myoff;
701  return (*this);
702  }
path_type _Myelem
Definition: filesystem:833
const path_type * _Myptr
Definition: filesystem:832
size_t _Myoff
Definition: filesystem:834
constexpr remove_reference< _Ty >::type && move(_Ty &&_Arg) _NOEXCEPT
Definition: type_traits:1349
constexpr const _Ty &() _Right
Definition: algorithm:3723
template<class _Path_type >
bool experimental::filesystem::v1::_Path_iterator< _Path_type >::operator== ( const _Myt _Right) const
inline
789  { // test for iterator equality
790  return (_Myptr == _Right._Myptr && _Myoff == _Right._Myoff);
791  }
const path_type * _Myptr
Definition: filesystem:832
size_t _Myoff
Definition: filesystem:834
constexpr const _Ty &() _Right
Definition: algorithm:3723

Member Data Documentation

template<class _Path_type >
path_type experimental::filesystem::v1::_Path_iterator< _Path_type >::_Myelem
private
template<class _Path_type >
size_t experimental::filesystem::v1::_Path_iterator< _Path_type >::_Myoff
private
template<class _Path_type >
const path_type* experimental::filesystem::v1::_Path_iterator< _Path_type >::_Myptr
private

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