coan
6.0.1
A C/C++ Configuration Analyzer
|
Encapsulates a set of directory/file trees. More...
#include <file_tree.h>
Classes | |
struct | no_filter |
Type representing the null filter for selecting files. More... | |
struct | node |
Type of a node in a file_tree . More... | |
struct | traverser |
A base for classes employed to traverse a file_tree . More... | |
Public Types | |
using | child_list = node::child_list |
Type of a sequence of sibling nodes in a file_tree | |
using | node_ptr = node::node_ptr |
Type of a pointer to a node | |
using | entry = node::entry |
Type of an element in a child_list . | |
Public Member Functions | |
file_tree () | |
Default constructor. | |
unsigned | files () const |
Get the number of files in the file_tree | |
void | traverse (traverser &action) |
Traverse the file_tree . More... | |
template<typename Filter = file_tree::no_filter> | |
void | add (std::string const &path, Filter &filter) |
Add files from a path to the file_tree . More... | |
template<class InIter , class Filter = file_tree::no_filter> | |
void | add (InIter start, InIter end, Filter &filter) |
Add files from a path to the file_tree . More... | |
Private Attributes | |
node | _root |
The root node of the file_tree . More... | |
unsigned | _files = 0 |
The number of files in the file_tree . More... | |
Encapsulates a set of directory/file trees.
struct file_tree
encapsulates a set of directory/file trees, notionally united at a root node that does not represent any file-system object, but just affords entry to the set.
Definition at line 55 of file file_tree.h.
|
inline |
Add files from a path to the file_tree
.
path | The path from files are to be added. |
filter | An optional filter for selecting the files to be added. |
Files within path
that satisfy filter
are recursively added to the file_tree
. filter
defaults to no_filter
, which is satisfied by any file.
Definition at line 357 of file file_tree.h.
|
inline |
Add files from a path to the file_tree
.
InIter | An input iterator type. |
start | An iterator to the start of a seqence of file or directory names. |
end | The end of the sequence commencing at start . |
filter | An optional filter for selecting the files to be added. |
All selected files within the members of the argument sequence are added to the file_tree
.
Definition at line 379 of file file_tree.h.
|
inline |
Traverse the file_tree
.
action | A traverser to be applied to each node in the file_tree . |
Definition at line 343 of file file_tree.h.
|
private |
The number of files in the file_tree
.
This data member is updated by adding files to the tree so that the population of the tree may be queried without calculation.
Definition at line 396 of file file_tree.h.
|
private |
The root node of the file_tree
.
The root node does not represent any filesystem object; it simply unites all the top-level filesystem objects that are represented.
Definition at line 390 of file file_tree.h.