Library: Foundation
Package: Filesystem
Header: Poco/RecursiveDirectoryIterator.h
The RecursiveDirectoryIterator class is used to enumerate all files in a directory and its subdirectories.
RecursiveDirectoryIterator has some limitations:
The class can follow different traversal strategies:
The stategies are set by template parameter. There are two corresponding typedefs:
The depth of traversal can be limited by constructor parameter maxDepth (which sets the infinite depth by default).
Member Functions: depth, maxDepth, name, operator !=, operator *, operator ++, operator =, operator ==, operator->, path
typedef RecursiveDirectoryIterator < TTravStr > MyType;
D_INFINITE = 0
Constant for infinite traverse depth.
Creates the end iterator.
RecursiveDirectoryIterator(
const MyType & iterator
);
Creates a copy of another recursive directory iterator.
RecursiveDirectoryIterator(
const std::string & path,
UInt16 maxDepth = D_INFINITE
);
Creates a recursive directory iterator for the given path.
RecursiveDirectoryIterator(
const DirectoryIterator & iterator,
UInt16 maxDepth = D_INFINITE
);
Creates a recursive directory iterator for the path of non-recursive directory iterator.
RecursiveDirectoryIterator(
const File & file,
UInt16 maxDepth = D_INFINITE
);
Creates a recursive directory iterator for the given path.
RecursiveDirectoryIterator(
const Path & path,
UInt16 maxDepth = D_INFINITE
);
Creates a recursive directory iterator for the given path.
~RecursiveDirectoryIterator();
Destroys the DirectoryIterator.
UInt16 depth() const;
Depth of recursion (counting from 1).
UInt16 maxDepth() const;
Max depth of recursion (counting from 1).
const std::string & name() const;
Returns the current filename.
template < class T1, class T2 > friend inline bool operator != (
const RecursiveDirectoryIterator < T1 > & a,
const RecursiveDirectoryIterator < T2 > & b
);
const File & operator * () const;
File & operator * ();
MyType & operator ++ ();
MyType & operator = (
const MyType & it
);
MyType & operator = (
const File & file
);
MyType & operator = (
const Path & path
);
MyType & operator = (
const std::string & path
);
template < class T1, class T2 > friend inline bool operator == (
const RecursiveDirectoryIterator < T1 > & a,
const RecursiveDirectoryIterator < T2 > & b
);
const File * operator-> () const;
File * operator-> ();
const Poco::Path & path() const;
Returns the current path.