21 #ifndef G_DIRECTORY_TREE__H
22 #define G_DIRECTORY_TREE__H
33 class DirectoryTreeCallback ;
73 size_t depth()
const ;
76 bool down(
const std::string & name ,
bool at_or_after =
false ) ;
108 void reverse(
bool in_reverse =
true ) ;
116 typedef std::vector<FileItem> FileList ;
120 FileList::iterator m_p ;
121 FileList::iterator m_end ;
123 typedef std::list<Context> Stack ;
126 static bool isDir(
const Path & ) ;
127 FileList readFileList()
const ;
128 void filter( FileList & ,
size_t )
const ;
129 bool ignore(
const FileItem & ,
size_t )
const ;
void reverse(bool in_reverse=true)
Changes the reversal state, returning the previous value.
DirectoryTree & operator++()
Pre-increment operator. Moves to the next file or directory.
A directory-entry item for G::DirectoryList.
A directory tree iterator for sorted, depth-first traversal of files and directories.
bool operator==(const DirectoryTree &) const
Comparison operator.
bool operator!=(const DirectoryTree &) const
Comparison operator.
DirectoryTree()
Default contructor for an off-the-end iterator.
const DirectoryList::Item & operator*() const
Dereference operator yielding a G::DirectoryList::Item.
virtual bool directoryTreeIgnore(const G::DirectoryList::Item &, size_t depth)=0
Returns true if the file should be ignored.
DirectoryTree & operator=(const DirectoryTree &)
Assignment operator.
void swap(DirectoryTree &other)
Swaps this and other.
bool down(const std::string &name, bool at_or_after=false)
Moves deeper into the directory tree, with a precondition that the iterator currently points to a dir...
bool reversed() const
Returns the current reversal state.
size_t depth() const
Returns the nesting depth compared to the root.
A callback interface to allow G::DirectoryTree to ignore paths.
A Path object represents a file system path.
void up()
Moves up to the parent directory.