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
666  : _Myptr(0), _Myoff(0)
667  { // construct singular iterator
668  }
const path_type * _Myptr
Definition: filesystem:839
size_t _Myoff
Definition: filesystem:841
template<class _Path_type >
experimental::filesystem::v1::_Path_iterator< _Path_type >::_Path_iterator ( const path_type _Path,
size_t  _Off 
)
inline
671  : _Myptr(&_Path), _Myoff(_Off)
672  { // construct iterator
673  _Getval();
674  }
const path_type * _Myptr
Definition: filesystem:839
size_t _Myoff
Definition: filesystem:841
void _Getval()
Definition: filesystem:806
template<class _Path_type >
experimental::filesystem::v1::_Path_iterator< _Path_type >::_Path_iterator ( const _Path_iterator< _Path_type > &  _Right)
inline
677  : _Myptr(_Right._Myptr),
678  _Myelem(_Right._Myelem),
679  _Myoff(_Right._Myoff)
680  { // copy construct
681  }
path_type _Myelem
Definition: filesystem:840
const path_type * _Myptr
Definition: filesystem:839
size_t _Myoff
Definition: filesystem:841
constexpr const _Ty &() _Right
Definition: algorithm:3591
template<class _Path_type >
experimental::filesystem::v1::_Path_iterator< _Path_type >::_Path_iterator ( _Path_iterator< _Path_type > &&  _Right)
inline
692  : _Myptr(_Right._Myptr),
693  _Myelem(_STD move(_Right._Myelem)),
694  _Myoff(_Right._Myoff)
695  { // move construct
696  }
path_type _Myelem
Definition: filesystem:840
const path_type * _Myptr
Definition: filesystem:839
size_t _Myoff
Definition: filesystem:841
constexpr remove_reference< _Ty >::type && move(_Ty &&_Arg) _NOEXCEPT
Definition: type_traits:1290
constexpr const _Ty &() _Right
Definition: algorithm:3591

Member Function Documentation

template<class _Path_type >
void experimental::filesystem::v1::_Path_iterator< _Path_type >::_Getval ( )
inlineprivate
807  { // determine _Myelem
808  string_type _Str;
809  size_t _Pend = _Myptr->_Prefix_end();
810  size_t _Size = _Myptr->_Mystr.size();
811 
812  if (_Size <= _Myoff)
813  ; // off end, no field
814  else if (_Myoff < _Pend)
815  _Str = _Myptr->_Mystr.substr(0, _Pend); // get "x:"
816  else if (_Myoff == _Pend && _Pend < _Size
817  && _FS_ISSEP(_Myptr->_Mystr[_Pend]))
818  _Str = _FS_PREF; // get "/"
819  else
820  { // determine next field as slashes followed by stuff
821  size_t _Nslash = 0;
822  size_t _Nstuff = 0;
823 
824  for (; _Myoff + _Nslash < _Size; ++_Nslash)
825  if (!_FS_ISSEP(_Myptr->_Mystr[_Myoff + _Nslash]))
826  break;
827  for (; _Myoff + _Nslash + _Nstuff < _Size; ++_Nstuff)
828  if (_FS_ISSEP(_Myptr->_Mystr[_Myoff + _Nslash + _Nstuff]))
829  break;
830  if (0 < _Nstuff)
831  _Str = _Myptr->_Mystr.substr(_Myoff + _Nslash,
832  _Nstuff); // get "stuff"
833  else if (0 < _Nslash)
834  _Str = _FS_PERIOD; // get "."
835  }
836  _Myelem = _Str;
837  }
#define _FS_ISSEP(x)
Definition: filesystem:32
_Path_type::string_type string_type
Definition: filesystem:657
path_type _Myelem
Definition: filesystem:840
const path_type * _Myptr
Definition: filesystem:839
size_t _Myoff
Definition: filesystem:841
#define _FS_PERIOD
Definition: filesystem:36
#define _FS_PREF
Definition: filesystem:33
_Size
Definition: vcruntime_string.h:36
template<class _Path_type >
bool experimental::filesystem::v1::_Path_iterator< _Path_type >::operator!= ( const _Myt _Right) const
inline
801  { // test for iterator inequality
802  return (!(*this == _Right));
803  }
constexpr const _Ty &() _Right
Definition: algorithm:3591
template<class _Path_type >
reference experimental::filesystem::v1::_Path_iterator< _Path_type >::operator* ( ) const
inline
707  { // return designated value
708  return (_Myelem);
709  }
path_type _Myelem
Definition: filesystem:840
template<class _Path_type >
_Myt& experimental::filesystem::v1::_Path_iterator< _Path_type >::operator++ ( )
inline
717  { // preincrement
718  #pragma warning(push)
719  #pragma warning(disable: 6011) /* quiet analyze noise */
720 
721  #if _ITERATOR_DEBUG_LEVEL == 2
722  if (_Myptr == 0 || _Myptr->_Mystr.size() <= _Myoff)
723  _DEBUG_ERROR(
724  "path::iterator is not incrementable");
725 
726  #elif _ITERATOR_DEBUG_LEVEL == 1
727  _SCL_SECURE_VALIDATE(_Myptr != 0 && _Myoff < _Myptr->_Mystr.size());
728  #endif /* _ITERATOR_DEBUG_LEVEL */
729 
730  size_t _Pend = _Myptr->_Prefix_end();
731  size_t _Size = _Myptr->_Mystr.size();
732 
733  if (_Myoff < _Pend)
734  _Myoff = _Pend; // point past "x:"
735  else if (_Myoff == _Pend && _Pend < _Size
736  && _FS_ISSEP(_Myptr->_Mystr[_Pend]))
737  { // point past root "/" and following slashes
738  for (++_Myoff; _Myoff < _Size; ++_Myoff)
739  if (!_FS_ISSEP(_Myptr->_Mystr[_Myoff]))
740  break;
741  }
742  else
743  { // point past slashes followed by stuff
744  for (; _Myoff < _Size; ++_Myoff)
745  if (!_FS_ISSEP(_Myptr->_Mystr[_Myoff]))
746  break;
747  for (; _Myoff < _Size; ++_Myoff)
748  if (_FS_ISSEP(_Myptr->_Mystr[_Myoff]))
749  break;
750  }
751  _Getval();
752  return (*this);
753 
754  #pragma warning(pop)
755  }
#define _FS_ISSEP(x)
Definition: filesystem:32
const path_type * _Myptr
Definition: filesystem:839
size_t _Myoff
Definition: filesystem:841
#define _DEBUG_ERROR(mesg)
Definition: xutility:32
void _Getval()
Definition: filesystem:806
_Size
Definition: vcruntime_string.h:36
#define _SCL_SECURE_VALIDATE(cond)
Definition: yvals.h:391
template<class _Path_type >
_Myt experimental::filesystem::v1::_Path_iterator< _Path_type >::operator++ ( int  )
inline
758  { // postincrement
759  _Myt _Tmp = *this;
760  ++*this;
761  return (_Tmp);
762  }
_Path_iterator< _Path_type > _Myt
Definition: filesystem:655
template<class _Path_type >
_Myt& experimental::filesystem::v1::_Path_iterator< _Path_type >::operator-- ( )
inline
765  { // predecrement
766  #if _ITERATOR_DEBUG_LEVEL == 2
767  if (_Myptr == 0 || _Myoff == 0)
768  _DEBUG_ERROR(
769  "path::iterator is not decrementable");
770 
771  #elif _ITERATOR_DEBUG_LEVEL == 1
772  _SCL_SECURE_VALIDATE(_Myptr != 0 && _Myoff != 0);
773  #endif /* _ITERATOR_DEBUG_LEVEL */
774 
775  size_t _Myoff_sav = _Myoff;
776  size_t _Off_back = 0;
777  _Myoff = 0;
778  do
779  { // scan down to previous
780  _Off_back = _Myoff;
781  ++*this;
782  } while (_Myoff < _Myoff_sav);
783  _Myoff = _Off_back;
784  _Getval();
785  return (*this);
786  }
const path_type * _Myptr
Definition: filesystem:839
size_t _Myoff
Definition: filesystem:841
#define _DEBUG_ERROR(mesg)
Definition: xutility:32
void _Getval()
Definition: filesystem:806
#define _SCL_SECURE_VALIDATE(cond)
Definition: yvals.h:391
template<class _Path_type >
_Myt experimental::filesystem::v1::_Path_iterator< _Path_type >::operator-- ( int  )
inline
789  { // postdecrement
790  _Myt _Tmp = *this;
791  --*this;
792  return (_Tmp);
793  }
_Path_iterator< _Path_type > _Myt
Definition: filesystem:655
template<class _Path_type >
pointer experimental::filesystem::v1::_Path_iterator< _Path_type >::operator-> ( ) const
inline
712  { // return pointer to class object
713  return (pointer_traits<pointer>::pointer_to(**this));
714  }
Definition: xmemory0:244
template<class _Path_type >
_Path_iterator& experimental::filesystem::v1::_Path_iterator< _Path_type >::operator= ( const _Path_iterator< _Path_type > &  _Right)
inline
684  { // copy assign
685  _Myptr = _Right._Myptr;
686  _Myelem = _Right._Myelem;
687  _Myoff = _Right._Myoff;
688  return (*this);
689  }
path_type _Myelem
Definition: filesystem:840
const path_type * _Myptr
Definition: filesystem:839
size_t _Myoff
Definition: filesystem:841
constexpr const _Ty &() _Right
Definition: algorithm:3591
template<class _Path_type >
_Path_iterator& experimental::filesystem::v1::_Path_iterator< _Path_type >::operator= ( _Path_iterator< _Path_type > &&  _Right)
inline
699  { // move assign
700  _Myptr = _Right._Myptr;
701  _Myelem = _STD move(_Right._Myelem);
702  _Myoff = _Right._Myoff;
703  return (*this);
704  }
path_type _Myelem
Definition: filesystem:840
const path_type * _Myptr
Definition: filesystem:839
size_t _Myoff
Definition: filesystem:841
constexpr remove_reference< _Ty >::type && move(_Ty &&_Arg) _NOEXCEPT
Definition: type_traits:1290
constexpr const _Ty &() _Right
Definition: algorithm:3591
template<class _Path_type >
bool experimental::filesystem::v1::_Path_iterator< _Path_type >::operator== ( const _Myt _Right) const
inline
796  { // test for iterator equality
797  return (_Myptr == _Right._Myptr && _Myoff == _Right._Myoff);
798  }
const path_type * _Myptr
Definition: filesystem:839
size_t _Myoff
Definition: filesystem:841
constexpr const _Ty &() _Right
Definition: algorithm:3591

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: