29 #include <sys/types.h>
34 class DirectoryIteratorImp ;
36 class DirectoryIterator ;
58 explicit Directory(
const std::string & path ) ;
64 bool valid(
bool for_creating_files =
false )
const ;
74 bool writeable( std::string probe_filename =
tmp() )
const ;
92 static std::string
tmp() ;
176 void readType(
const Path & dir ,
const std::string & suffix ,
unsigned int limit = 0U ) ;
199 unsigned int m_index ;
200 std::vector<int> m_is_dir ;
201 std::vector<G::Path> m_path ;
202 std::vector<G::Path> m_name ;
std::string sizeString() const
Returns the file size as a decimal string.
bool more()
Returns true if more and advances by one.
Path filePath() const
Returns the path of the current item.
G::Path filePath() const
Returns the current path.
void readAll(const Path &dir)
An initialiser that is to be used after default construction.
DirectoryIterator(const Directory &dir, const std::string &wc)
Constructor taking a directory reference and a wildcard specification.
Path path() const
Returns the directory's path.
bool valid(bool for_creating_files=false) const
Returns true if the object represents a valid directory.
Directory()
Default constructor for the current directory.
bool writeable(std::string probe_filename=tmp()) const
Tries to create and then delete an empty test file in the directory.
~DirectoryIterator()
Destructor.
void readType(const Path &dir, const std::string &suffix, unsigned int limit=0U)
An initialiser that is to be used after default construction.
An encapsulation of a file system directory which allows for iterating through the set of contained f...
Path fileName() const
Returns the name of the current item.
A Directory iterator that does all file i/o in one go.
static std::string tmp()
A convenience function for constructing a filename for writeable().
bool more()
Returns true if more and advances by one.
bool isDir() const
Returns true if the current item is a directory.
std::string modificationTimeString() const
Returns the last-modified time for the file in an undefined format – used for comparison.
G::Path fileName() const
Returns the current filename.
A pimple-pattern implementation class for DirectoryIterator.
static Directory root()
Returns a root directory object.
bool isDir() const
Returns true if the current item is a directory.
Directory & operator=(const Directory &)
Assignment operator.
bool error() const
Returns true on error. The caller should stop the iteration.
A Path object represents a file system path.
DirectoryList()
Default constructor for an empty list.