STLdoc
STLdocumentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Public Types | Public Member Functions | Private Attributes | List of all members
tr2::sys::basic_recursive_directory_iterator< _Path > Class Template Reference
Inheritance diagram for tr2::sys::basic_recursive_directory_iterator< _Path >:
iterator< input_iterator_tag, basic_directory_entry< _Path > >

Public Types

typedef basic_recursive_directory_iterator< _Path > _Myt
 
typedef basic_directory_iterator< _Path, false_type_Myiter
 
typedef pair< _Myiter, _Path > _Mypair
 
typedef basic_directory_entry< _Path > value_type
 
typedef _Path::string_type string_type
 
typedef string_type::value_type char_type
 
typedef _Path path_type
 
typedef const value_typepointer
 
- Public Types inherited from iterator< input_iterator_tag, basic_directory_entry< _Path > >
typedef input_iterator_tag iterator_category
 
typedef basic_directory_entry< _Path > value_type
 
typedef _Diff difference_type
 
typedef _Diff distance_type
 
typedef _Pointer pointer
 
typedef _Reference reference
 

Public Member Functions

 basic_recursive_directory_iterator ()
 
 basic_recursive_directory_iterator (const _Myt &_Right)
 
 basic_recursive_directory_iterator (const _Path &_Pval)
 
 ~basic_recursive_directory_iterator () _NOEXCEPT
 
 basic_recursive_directory_iterator (_Myt &&_Right)
 
_Mytoperator= (_Myt &&_Right)
 
_Mytoperator= (const _Myt &_Right)
 
int level () const
 
void pop ()
 
void no_push ()
 
const value_typeoperator* () const
 
pointer operator-> () const
 
_Mytoperator++ ()
 
_Myt operator++ (int)
 
bool _Pop ()
 
bool _Equal (const _Myt &_Right) const
 
void _Get ()
 

Private Attributes

list< _Mypair_Mylist
 
value_type _Myentry
 
bool _No_push
 

Member Typedef Documentation

template<class _Path >
typedef pair<_Myiter, _Path> tr2::sys::basic_recursive_directory_iterator< _Path >::_Mypair
template<class _Path >
typedef string_type::value_type tr2::sys::basic_recursive_directory_iterator< _Path >::char_type
template<class _Path >
typedef _Path tr2::sys::basic_recursive_directory_iterator< _Path >::path_type
template<class _Path >
typedef const value_type* tr2::sys::basic_recursive_directory_iterator< _Path >::pointer
template<class _Path >
typedef _Path::string_type tr2::sys::basic_recursive_directory_iterator< _Path >::string_type
template<class _Path >
typedef basic_directory_entry<_Path> tr2::sys::basic_recursive_directory_iterator< _Path >::value_type

Constructor & Destructor Documentation

1428  : _Mylist(1, _Mypair()),
1429  _Myentry(),
1430  _No_push(false)
1431  { // default construct
1432  }
bool _No_push
Definition: filesystem:1578
list< _Mypair > _Mylist
Definition: filesystem:1576
value_type _Myentry
Definition: filesystem:1577
pair< _Myiter, _Path > _Mypair
Definition: filesystem:1419
template<class _Path >
tr2::sys::basic_recursive_directory_iterator< _Path >::basic_recursive_directory_iterator ( const _Myt _Right)
inline
1435  : _Mylist(_Right._Mylist),
1436  _Myentry(_Right._Myentry),
1437  _No_push(_Right._No_push)
1438  { // copy construct
1439  }
bool _No_push
Definition: filesystem:1578
list< _Mypair > _Mylist
Definition: filesystem:1576
value_type _Myentry
Definition: filesystem:1577
const _Ty & _Right
Definition: algorithm:4087
template<class _Path >
tr2::sys::basic_recursive_directory_iterator< _Path >::basic_recursive_directory_iterator ( const _Path &  _Pval)
inline
1442  : _Mylist(1, _Mypair(_Myiter(_Pval), _Pval)),
1443  _Myentry(),
1444  _No_push(false)
1445  { // construct from _Pval
1446  _Get();
1447  }
bool _No_push
Definition: filesystem:1578
list< _Mypair > _Mylist
Definition: filesystem:1576
basic_directory_iterator< _Path, false_type > _Myiter
Definition: filesystem:1418
void _Get()
Definition: filesystem:1565
value_type _Myentry
Definition: filesystem:1577
pair< _Myiter, _Path > _Mypair
Definition: filesystem:1419
1450  { // destroy the object
1451  }
template<class _Path >
tr2::sys::basic_recursive_directory_iterator< _Path >::basic_recursive_directory_iterator ( _Myt &&  _Right)
inline
1454  : _Mylist(_STD move(_Right._Mylist)),
1455  _Myentry(_STD move(_Right._Myentry)),
1456  _No_push(_Right._No_push)
1457  { // move construct
1458  }
bool _No_push
Definition: filesystem:1578
list< _Mypair > _Mylist
Definition: filesystem:1576
_OutIt move(_InIt _First, _InIt _Last, _OutIt _Dest)
Definition: xutility:2447
value_type _Myentry
Definition: filesystem:1577
const _Ty & _Right
Definition: algorithm:4087

Member Function Documentation

template<class _Path >
bool tr2::sys::basic_recursive_directory_iterator< _Path >::_Equal ( const _Myt _Right) const
inline
1561  { // test for equality
1562  return (_Mylist.front().first == _Right._Mylist.front().first);
1563  }
list< _Mypair > _Mylist
Definition: filesystem:1576
const _Ty & _Right
Definition: algorithm:4087
template<class _Path >
void tr2::sys::basic_recursive_directory_iterator< _Path >::_Get ( )
inline
1566  { // prime _Myentry for future gets
1567  if (_Mylist.front().first != _Myiter())
1568  { // item present, get it
1569  value_type _Dentry = *_Mylist.front().first;
1570  _Myentry.assign(_Mylist.front().second / _Dentry.path(),
1571  _Dentry.status(), _Dentry.symlink_status());
1572  }
1573  }
list< _Mypair > _Mylist
Definition: filesystem:1576
basic_directory_iterator< _Path, false_type > _Myiter
Definition: filesystem:1418
void assign(const path_type &_Pval, file_status _Statarg=file_status(), file_status _Symstatarg=file_status())
Definition: filesystem:1106
basic_directory_entry< _Path > value_type
Definition: filesystem:1421
value_type _Myentry
Definition: filesystem:1577
template<class _Path >
bool tr2::sys::basic_recursive_directory_iterator< _Path >::_Pop ( )
inline
1550  { // pop a directory level
1551  if (1 < _Mylist.size())
1552  { // something to pop, do it
1553  _Mylist.pop_front();
1554  return (true);
1555  }
1556  else
1557  return (false);
1558  }
list< _Mypair > _Mylist
Definition: filesystem:1576
template<class _Path >
int tr2::sys::basic_recursive_directory_iterator< _Path >::level ( ) const
inline
1483  { // get recursion depth
1484  return (static_cast<int>(_Mylist.size()) - 1);
1485  }
list< _Mypair > _Mylist
Definition: filesystem:1576
template<class _Path >
void tr2::sys::basic_recursive_directory_iterator< _Path >::no_push ( )
inline
1493  { // disable directory recursion
1494  _No_push = true;
1495  }
bool _No_push
Definition: filesystem:1578
template<class _Path >
const value_type& tr2::sys::basic_recursive_directory_iterator< _Path >::operator* ( ) const
inline
1498  { // return designated value
1499  #if _ITERATOR_DEBUG_LEVEL == 2
1500  if (_Mylist.front().first == _Myiter())
1501  _DEBUG_ERROR(
1502  "basic_recursive_directory_iterator is not dereferencable");
1503 
1504  #elif _ITERATOR_DEBUG_LEVEL == 1
1505  _SCL_SECURE_VALIDATE(_Mylist.front().first != _Myiter());
1506  #endif /* _ITERATOR_DEBUG_LEVEL */
1507 
1508  return (_Myentry);
1509  }
list< _Mypair > _Mylist
Definition: filesystem:1576
basic_directory_iterator< _Path, false_type > _Myiter
Definition: filesystem:1418
value_type _Myentry
Definition: filesystem:1577
#define _DEBUG_ERROR(mesg)
Definition: xutility:32
#define _SCL_SECURE_VALIDATE(cond)
Definition: yvals.h:346
template<class _Path >
_Myt& tr2::sys::basic_recursive_directory_iterator< _Path >::operator++ ( )
inline
1517  { // preincrement
1518  #if _ITERATOR_DEBUG_LEVEL == 2
1519  if (_Mylist.front().first == _Myiter())
1520  _DEBUG_ERROR(
1521  "basic_recursive_directory_iterator is not incrementable");
1522 
1523  #elif _ITERATOR_DEBUG_LEVEL == 1
1524  _SCL_SECURE_VALIDATE(_Mylist.front().first != _Myiter());
1525  #endif /* _ITERATOR_DEBUG_LEVEL */
1526 
1527  if (_No_push || !is_directory(_Mylist.front().first->status()))
1528  ++_Mylist.front().first;
1529  else
1530  { // push down a subdirectory
1531  path_type _Newpath = _Mylist.front().second
1532  / _Mylist.front().first->path();
1533  ++_Mylist.front().first;
1534  _Mylist.push_front(_Mypair(_Myiter(_Newpath), _Newpath));
1535  }
1536  while (1 < _Mylist.size() && _Mylist.front().first == _Myiter())
1537  _Pop();
1538  _Get();
1539  return (*this);
1540  }
bool is_directory(file_status _Stat)
Definition: filesystem:1662
bool _No_push
Definition: filesystem:1578
list< _Mypair > _Mylist
Definition: filesystem:1576
basic_directory_iterator< _Path, false_type > _Myiter
Definition: filesystem:1418
void _Get()
Definition: filesystem:1565
_Path path_type
Definition: filesystem:1424
bool _Pop()
Definition: filesystem:1549
#define _DEBUG_ERROR(mesg)
Definition: xutility:32
#define _SCL_SECURE_VALIDATE(cond)
Definition: yvals.h:346
pair< _Myiter, _Path > _Mypair
Definition: filesystem:1419
template<class _Path >
_Myt tr2::sys::basic_recursive_directory_iterator< _Path >::operator++ ( int  )
inline
1543  { // postincrement
1544  _Myt _Tmp = *this;
1545  ++*this;
1546  return (_Tmp);
1547  }
basic_recursive_directory_iterator< _Path > _Myt
Definition: filesystem:1417
template<class _Path >
pointer tr2::sys::basic_recursive_directory_iterator< _Path >::operator-> ( ) const
inline
1512  { // return pointer to class object
1513  return (_STD pointer_traits<pointer>::pointer_to(**this));
1514  }
Definition: xmemory0:198
template<class _Path >
_Myt& tr2::sys::basic_recursive_directory_iterator< _Path >::operator= ( _Myt &&  _Right)
inline
1461  { // move assign
1462  if (this != &_Right)
1463  { // move fields
1464  _Mylist = _STD move(_Right._Mylist);
1465  _Myentry = _STD move(_Right._Myentry);
1466  _No_push = _Right._No_push;
1467  }
1468  return (*this);
1469  }
bool _No_push
Definition: filesystem:1578
list< _Mypair > _Mylist
Definition: filesystem:1576
_OutIt move(_InIt _First, _InIt _Last, _OutIt _Dest)
Definition: xutility:2447
value_type _Myentry
Definition: filesystem:1577
const _Ty & _Right
Definition: algorithm:4087
template<class _Path >
_Myt& tr2::sys::basic_recursive_directory_iterator< _Path >::operator= ( const _Myt _Right)
inline
1472  { // copy assign
1473  if (this != &_Right)
1474  { // copy fields
1475  _Mylist = _Right._Mylist;
1476  _Myentry = _Right._Myentry;
1477  _No_push = _Right._No_push;
1478  }
1479  return (*this);
1480  }
bool _No_push
Definition: filesystem:1578
list< _Mypair > _Mylist
Definition: filesystem:1576
value_type _Myentry
Definition: filesystem:1577
const _Ty & _Right
Definition: algorithm:4087
template<class _Path >
void tr2::sys::basic_recursive_directory_iterator< _Path >::pop ( )
inline
1488  { // pop a level
1489  _Pop();
1490  }
bool _Pop()
Definition: filesystem:1549

Member Data Documentation

template<class _Path >
value_type tr2::sys::basic_recursive_directory_iterator< _Path >::_Myentry
private
template<class _Path >
list<_Mypair> tr2::sys::basic_recursive_directory_iterator< _Path >::_Mylist
private
template<class _Path >
bool tr2::sys::basic_recursive_directory_iterator< _Path >::_No_push
private

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