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

Public Types

typedef basic_directory_iterator< _Path, _Prefix_directory > _Myt
 
typedef basic_directory_entry< _Path > value_type
 
typedef _Path::string_type string_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_directory_iterator ()
 
 basic_directory_iterator (const _Myt &_Right)
 
 basic_directory_iterator (const _Path &_Pval)
 
 basic_directory_iterator (const _Path &_Pval, error_code &_Code)
 
 ~basic_directory_iterator () _NOEXCEPT
 
 basic_directory_iterator (_Myt &&_Right)
 
_Mytoperator= (_Myt &&_Right)
 
_Mytoperator= (const _Myt &_Right)
 
const value_typeoperator* () const
 
pointer operator-> () const
 
_Mytoperator++ ()
 
_Myt operator++ (int)
 
bool _Equal (const _Myt &_Right) const
 

Private Member Functions

void _Get ()
 
void _Form_name (typename string_type::value_type *_Filename, file_type _Ftype, true_type)
 
void _Form_name (typename string_type::value_type *_Filename, file_type _Ftype, false_type)
 

Static Private Member Functions

static void _Delptr (void **_Ptr)
 

Private Attributes

shared_ptr< void * > _Mypdir
 
_Path _Mydirpath
 
value_type _Myentry
 

Member Typedef Documentation

template<class _Path , class _Prefix_directory = true_type>
typedef basic_directory_iterator<_Path, _Prefix_directory> tr2::sys::basic_directory_iterator< _Path, _Prefix_directory >::_Myt
template<class _Path , class _Prefix_directory = true_type>
typedef _Path tr2::sys::basic_directory_iterator< _Path, _Prefix_directory >::path_type
template<class _Path , class _Prefix_directory = true_type>
typedef const value_type* tr2::sys::basic_directory_iterator< _Path, _Prefix_directory >::pointer
template<class _Path , class _Prefix_directory = true_type>
typedef _Path::string_type tr2::sys::basic_directory_iterator< _Path, _Prefix_directory >::string_type
template<class _Path , class _Prefix_directory = true_type>
typedef basic_directory_entry<_Path> tr2::sys::basic_directory_iterator< _Path, _Prefix_directory >::value_type

Constructor & Destructor Documentation

template<class _Path , class _Prefix_directory = true_type>
tr2::sys::basic_directory_iterator< _Path, _Prefix_directory >::basic_directory_iterator ( )
inline
1229  : _Mypdir(new void *(0), &_Delptr)
1230  { // default construct
1231  }
shared_ptr< void * > _Mypdir
Definition: filesystem:1385
static void _Delptr(void **_Ptr)
Definition: filesystem:1349
template<class _Path , class _Prefix_directory = true_type>
tr2::sys::basic_directory_iterator< _Path, _Prefix_directory >::basic_directory_iterator ( const _Myt _Right)
inline
1234  : _Mypdir(_Right._Mypdir),
1235  _Mydirpath(_Right._Mydirpath),
1236  _Myentry(_Right._Myentry)
1237  { // copy construct
1238  }
value_type _Myentry
Definition: filesystem:1387
shared_ptr< void * > _Mypdir
Definition: filesystem:1385
_Path _Mydirpath
Definition: filesystem:1386
const _Ty & _Right
Definition: algorithm:4087
template<class _Path , class _Prefix_directory = true_type>
tr2::sys::basic_directory_iterator< _Path, _Prefix_directory >::basic_directory_iterator ( const _Path &  _Pval)
inline
1241  : _Mypdir(new void *(0), &_Delptr),
1242  _Mydirpath(_Pval)
1243  { // construct from _Pval
1244  typename string_type::value_type _Dest[_MAX_FILESYS_NAME];
1245  int _Errno = 0;
1246  file_type _Ftype;
1247 
1248  *_Mypdir = _Open_dir(_Dest, _Pval._Ptr(), _Errno, _Ftype);
1249  if (*_Mypdir != 0)
1250  _Form_name(_Dest, _Ftype, _Prefix_directory());
1251  }
_FS_DLL void *__CLRCALL_PURE_OR_CDECL _Open_dir(char(&)[_MAX_FILESYS_NAME], const char *, int &, file_type &)
shared_ptr< void * > _Mypdir
Definition: filesystem:1385
void _Form_name(typename string_type::value_type *_Filename, file_type _Ftype, true_type)
Definition: filesystem:1372
file_type
Definition: filesystem:33
static void _Delptr(void **_Ptr)
Definition: filesystem:1349
#define _MAX_FILESYS_NAME
Definition: filesystem:998
_Path _Mydirpath
Definition: filesystem:1386
template<class _Path , class _Prefix_directory = true_type>
tr2::sys::basic_directory_iterator< _Path, _Prefix_directory >::basic_directory_iterator ( const _Path &  _Pval,
error_code _Code 
)
inline
1254  : _Mypdir(new void *(0), &_Delptr),
1255  _Mydirpath(_Pval)
1256  { // construct from _Pval, errors to _Code
1257  typename string_type::value_type _Dest[_MAX_FILESYS_NAME];
1258  int _Errno = 0;
1259  file_type _Ftype;
1260 
1261  *_Mypdir = _Open_dir(_Dest, _Pval._Ptr(), _Errno, _Ftype);
1262  if (*_Mypdir != 0)
1263  _Form_name(_Dest, _Ftype, _Prefix_directory());
1264  _Code = error_code(_Errno, _STD system_category());
1265  }
_FS_DLL void *__CLRCALL_PURE_OR_CDECL _Open_dir(char(&)[_MAX_FILESYS_NAME], const char *, int &, file_type &)
const error_category & system_category() _NOEXCEPT
Definition: system_error:651
shared_ptr< void * > _Mypdir
Definition: filesystem:1385
void _Form_name(typename string_type::value_type *_Filename, file_type _Ftype, true_type)
Definition: filesystem:1372
file_type
Definition: filesystem:33
Definition: system_error:195
static void _Delptr(void **_Ptr)
Definition: filesystem:1349
#define _MAX_FILESYS_NAME
Definition: filesystem:998
_Path _Mydirpath
Definition: filesystem:1386
template<class _Path , class _Prefix_directory = true_type>
tr2::sys::basic_directory_iterator< _Path, _Prefix_directory >::~basic_directory_iterator ( )
inline
1268  { // destroy the object
1269  }
template<class _Path , class _Prefix_directory = true_type>
tr2::sys::basic_directory_iterator< _Path, _Prefix_directory >::basic_directory_iterator ( _Myt &&  _Right)
inline
1272  : _Mypdir(_STD move(_Right._Mypdir)),
1273  _Mydirpath(_STD move(_Right._Mydirpath)),
1274  _Myentry(_STD move(_Right._Myentry))
1275  { // move construct
1276  }
value_type _Myentry
Definition: filesystem:1387
shared_ptr< void * > _Mypdir
Definition: filesystem:1385
_OutIt move(_InIt _First, _InIt _Last, _OutIt _Dest)
Definition: xutility:2447
_Path _Mydirpath
Definition: filesystem:1386
const _Ty & _Right
Definition: algorithm:4087

Member Function Documentation

template<class _Path , class _Prefix_directory = true_type>
static void tr2::sys::basic_directory_iterator< _Path, _Prefix_directory >::_Delptr ( void **  _Ptr)
inlinestaticprivate
1350  { // close directory and delete pointer
1351  if (_Ptr != 0 && *_Ptr != 0)
1352  _Close_dir(*_Ptr);
1353  delete _Ptr;
1354  }
_FS_DLL void __CLRCALL_PURE_OR_CDECL _Close_dir(void *)
template<class _Path , class _Prefix_directory = true_type>
bool tr2::sys::basic_directory_iterator< _Path, _Prefix_directory >::_Equal ( const _Myt _Right) const
inline
1342  { // test for equality
1343  return (_Mypdir.get() != 0 && _Right._Mypdir.get() != 0
1344  ? *_Mypdir == *_Right._Mypdir
1345  : _Mypdir.get() == 0 && _Right._Mypdir.get() == 0);
1346  }
shared_ptr< void * > _Mypdir
Definition: filesystem:1385
_Ty * get() const _NOEXCEPT
Definition: memory:664
const _Ty & _Right
Definition: algorithm:4087
template<class _Path , class _Prefix_directory = true_type>
void tr2::sys::basic_directory_iterator< _Path, _Prefix_directory >::_Form_name ( typename string_type::value_type *  _Filename,
file_type  _Ftype,
true_type   
)
inlineprivate
1374  { // set entry to _Mydirpath/_Filename
1376  file_status(_Ftype));
1377  }
value_type _Myentry
Definition: filesystem:1387
void assign(const path_type &_Pval, file_status _Statarg=file_status(), file_status _Symstatarg=file_status())
Definition: filesystem:1106
_Path _Mydirpath
Definition: filesystem:1386
_In_z_ const char * _Filename
Definition: process.h:211
template<class _Path , class _Prefix_directory = true_type>
void tr2::sys::basic_directory_iterator< _Path, _Prefix_directory >::_Form_name ( typename string_type::value_type *  _Filename,
file_type  _Ftype,
false_type   
)
inlineprivate
1381  { // set entry to _Filename
1382  _Myentry.assign(_Path(_Filename), file_status(_Ftype));
1383  }
value_type _Myentry
Definition: filesystem:1387
void assign(const path_type &_Pval, file_status _Statarg=file_status(), file_status _Symstatarg=file_status())
Definition: filesystem:1106
_In_z_ const char * _Filename
Definition: process.h:211
template<class _Path , class _Prefix_directory = true_type>
void tr2::sys::basic_directory_iterator< _Path, _Prefix_directory >::_Get ( )
inlineprivate
1357  { // peek at next input element
1358  if (*_Mypdir != 0)
1359  { // read a directory entry
1360  typename string_type::value_type _Dest[_MAX_FILESYS_NAME];
1361  file_type _Ftype;
1362  if (_Read_dir(_Dest, *_Mypdir, _Ftype)[0] == 0)
1363  { // end of directory, close it
1364  _Close_dir(*_Mypdir);
1365  *_Mypdir = 0; // end of directory
1366  }
1367  else
1368  _Form_name(_Dest, _Ftype, _Prefix_directory());
1369  }
1370  }
shared_ptr< void * > _Mypdir
Definition: filesystem:1385
void _Form_name(typename string_type::value_type *_Filename, file_type _Ftype, true_type)
Definition: filesystem:1372
file_type
Definition: filesystem:33
_FS_DLL char *__CLRCALL_PURE_OR_CDECL _Read_dir(char(&)[_MAX_FILESYS_NAME], void *, file_type &)
_FS_DLL void __CLRCALL_PURE_OR_CDECL _Close_dir(void *)
#define _MAX_FILESYS_NAME
Definition: filesystem:998
template<class _Path , class _Prefix_directory = true_type>
const value_type& tr2::sys::basic_directory_iterator< _Path, _Prefix_directory >::operator* ( ) const
inline
1301  { // return designated value
1302  #if _ITERATOR_DEBUG_LEVEL == 2
1303  if (*_Mypdir == 0)
1304  _DEBUG_ERROR(
1305  "basic_directory_iterator is not dereferencable");
1306 
1307  #elif _ITERATOR_DEBUG_LEVEL == 1
1309  #endif /* _ITERATOR_DEBUG_LEVEL */
1310 
1311  return (_Myentry);
1312  }
value_type _Myentry
Definition: filesystem:1387
shared_ptr< void * > _Mypdir
Definition: filesystem:1385
#define _DEBUG_ERROR(mesg)
Definition: xutility:32
#define _SCL_SECURE_VALIDATE(cond)
Definition: yvals.h:346
template<class _Path , class _Prefix_directory = true_type>
_Myt& tr2::sys::basic_directory_iterator< _Path, _Prefix_directory >::operator++ ( )
inline
1320  { // preincrement
1321  #if _ITERATOR_DEBUG_LEVEL == 2
1322  if (*_Mypdir == 0)
1323  _DEBUG_ERROR(
1324  "basic_directory_iterator is not incrementable");
1325 
1326  #elif _ITERATOR_DEBUG_LEVEL == 1
1328  #endif /* _ITERATOR_DEBUG_LEVEL */
1329 
1330  _Get();
1331  return (*this);
1332  }
shared_ptr< void * > _Mypdir
Definition: filesystem:1385
void _Get()
Definition: filesystem:1356
#define _DEBUG_ERROR(mesg)
Definition: xutility:32
#define _SCL_SECURE_VALIDATE(cond)
Definition: yvals.h:346
template<class _Path , class _Prefix_directory = true_type>
_Myt tr2::sys::basic_directory_iterator< _Path, _Prefix_directory >::operator++ ( int  )
inline
1335  { // postincrement
1336  _Myt _Tmp = *this;
1337  ++*this;
1338  return (_Tmp);
1339  }
basic_directory_iterator< _Path, _Prefix_directory > _Myt
Definition: filesystem:1222
template<class _Path , class _Prefix_directory = true_type>
pointer tr2::sys::basic_directory_iterator< _Path, _Prefix_directory >::operator-> ( ) const
inline
1315  { // return pointer to class object
1316  return (_STD pointer_traits<pointer>::pointer_to(**this));
1317  }
Definition: xmemory0:198
template<class _Path , class _Prefix_directory = true_type>
_Myt& tr2::sys::basic_directory_iterator< _Path, _Prefix_directory >::operator= ( _Myt &&  _Right)
inline
1279  { // move assign
1280  if (this != &_Right)
1281  { // different, move
1282  _Mypdir = _STD move(_Right._Mypdir);
1283  _Mydirpath = _STD move(_Right._Mydirpath);
1284  _Myentry = _STD move(_Right._Myentry);
1285  }
1286  return (*this);
1287  }
value_type _Myentry
Definition: filesystem:1387
shared_ptr< void * > _Mypdir
Definition: filesystem:1385
_OutIt move(_InIt _First, _InIt _Last, _OutIt _Dest)
Definition: xutility:2447
_Path _Mydirpath
Definition: filesystem:1386
const _Ty & _Right
Definition: algorithm:4087
template<class _Path , class _Prefix_directory = true_type>
_Myt& tr2::sys::basic_directory_iterator< _Path, _Prefix_directory >::operator= ( const _Myt _Right)
inline
1290  { // copy assign
1291  if (this != &_Right)
1292  { // different, copy
1293  _Mypdir = _Right._Mypdir;
1294  _Mydirpath = _Right._Mydirpath;
1295  _Myentry = _Right._Myentry;
1296  }
1297  return (*this);
1298  }
value_type _Myentry
Definition: filesystem:1387
shared_ptr< void * > _Mypdir
Definition: filesystem:1385
_Path _Mydirpath
Definition: filesystem:1386
const _Ty & _Right
Definition: algorithm:4087

Member Data Documentation

template<class _Path , class _Prefix_directory = true_type>
_Path tr2::sys::basic_directory_iterator< _Path, _Prefix_directory >::_Mydirpath
private
template<class _Path , class _Prefix_directory = true_type>
value_type tr2::sys::basic_directory_iterator< _Path, _Prefix_directory >::_Myentry
private
template<class _Path , class _Prefix_directory = true_type>
shared_ptr<void *> tr2::sys::basic_directory_iterator< _Path, _Prefix_directory >::_Mypdir
private

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