84 readType( dir , std::string() ) ;
94 for(
unsigned int i = 0U ; iter.
more() && !iter.
error() ; ++i )
98 if( limit == 0U || m_path.size() < limit )
100 m_is_dir.push_back( iter.
isDir() ) ;
101 m_path.push_back( iter.
filePath() ) ;
102 m_name.push_back( iter.
fileName() ) ;
104 if( m_path.size() == limit )
116 more = ! m_is_dir.empty() ;
121 more = m_index < m_is_dir.size() ;
128 return !! m_is_dir[m_index] ;
133 return m_path[m_index] ;
138 return m_name[m_index] ;
std::string str() const
Returns the path string.
bool more()
Returns true if more and advances by one.
static bool tailMatch(const std::string &in, const std::string &ending)
Returns true if the given string has the given ending.
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.
Path path() const
Returns the directory's path.
Directory()
Default constructor for the current directory.
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.
bool more()
Returns true if more and advances by one.
bool isDir() const
Returns true if the current item is a directory.
G::Path fileName() const
Returns the current filename.
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.