Input parameters to function ScanFiles.
Definition at line 19 of file fscanner.hpp.
#include <fscanner.hpp>
Public Type Index: | |
| enum class | SymbolicLinks { DONT_RESOLVE = 0 , RESOLVE_BUT_DONT_FOLLOW = 1 , RECURSIVE = 2 } |
| Options for processing symbolic links. More... | |
Public Static Field Index: | |
| static constexpr unsigned | InfiniteRecursion = (std::numeric_limits<unsigned>::max)() |
| Denotes 'infinite' recursion if set to field MaxDepth. | |
Public Field Index: | |
| bool | CrossFileSystems = true |
| SPFileFilter | DirectoryFilterPostRecursion |
| SPFileFilter | DirectoryFilterPreRecursion |
| SPFileFilter | FileFilter |
| bool | IncludeArtificialFS = false |
| SymbolicLinks | LinkTreatment =SymbolicLinks::RECURSIVE |
| Denotes how symbolic links are treated. | |
| unsigned | MaxDepth =InfiniteRecursion |
| The maximum recursion depth. Defaults to InfiniteRecursion. | |
| bool | RemoveEmptyDirectories = false |
| Path | StartPath |
| The path to be scanned. | |
Public Method Index: | |
| ScanParameters (const PathString &startPath, SymbolicLinks linkTreatment=SymbolicLinks::RECURSIVE, unsigned maxDepth=InfiniteRecursion, bool crossFileSystems=true, bool includeArtificialFS=false) | |
|
strong |
Options for processing symbolic links.
Definition at line 21 of file fscanner.hpp.
| bool alib::filetree::ScanParameters::CrossFileSystems = true |
If true, the default, scanning does not stop recursion on directories which represent a mounted filesystem. If false, the search is restricted to the device that StartPath resides in.
Definition at line 46 of file fscanner.hpp.
| SPFileFilter alib::filetree::ScanParameters::DirectoryFilterPostRecursion |
If set (not containing nullptr), this filter is invoked after a recursive scan of a directory. If false is returned, the recursion is not performed, but the (empty) directory remains in the result list, if field RemoveEmptyDirectories evaluates to false.
Note that in case field LinkTreatment is set to RECURSIVE, this filter is also applied to symbolic links, which are readable, not broken, and target a directory.
Definition at line 85 of file fscanner.hpp.
| SPFileFilter alib::filetree::ScanParameters::DirectoryFilterPreRecursion |
Same as DirectoryFilterPostRecursion but is used before a recursive scan of a directory. Consequently, this filter leads to much higher scan performance than the alternative version, because huge branches of the file system might be omitted during scan. However, the numbers retrieved with constexpr DirectorySums & Sums() const will all indicate 0, because no information is retrieved.
If a directory is "pruned" due to this filter, the entry still occurs in the FTree, unless field RemoveEmptyDirectories evaluates to true.
Definition at line 97 of file fscanner.hpp.
| SPFileFilter alib::filetree::ScanParameters::FileFilter |
If set (not containing nullptr), files are passed to this filter and removed if false is returned.
The term "files" here means all sorts of files except Directories. Directories are either real directories, or in case the field LinkTreatment is set to RECURSIVE, symbolic links that target a directory.
Definition at line 65 of file fscanner.hpp.
| bool alib::filetree::ScanParameters::IncludeArtificialFS = false |
If false (the default), scanning aborts if 'artificial' filesystems are found. Artificial filesystems under GNU/Linux, are for example: /proc, /dev, /run, /sys, and /temp.
Definition at line 51 of file fscanner.hpp.
|
staticconstexpr |
Denotes 'infinite' recursion if set to field MaxDepth.
Definition at line 32 of file fscanner.hpp.
| SymbolicLinks alib::filetree::ScanParameters::LinkTreatment =SymbolicLinks::RECURSIVE |
Denotes how symbolic links are treated.
Definition at line 38 of file fscanner.hpp.
| unsigned alib::filetree::ScanParameters::MaxDepth =InfiniteRecursion |
The maximum recursion depth. Defaults to InfiniteRecursion.
Definition at line 41 of file fscanner.hpp.
| bool alib::filetree::ScanParameters::RemoveEmptyDirectories = false |
If false, empty directories remain in the result tree. Otherwise, they are deleted and do not appear in the tree.
Definition at line 55 of file fscanner.hpp.
| Path alib::filetree::ScanParameters::StartPath |
The path to be scanned.
Definition at line 35 of file fscanner.hpp.
|
inline |
Constructor accepting all features.
| startPath | Stored in field StartPath. |
| linkTreatment | Stored in field LinkTreatment. Defaults to RECURSIVE. |
| maxDepth | Stored in field MaxDepth. Defaults to +InfiniteRecursion. |
| crossFileSystems | Stored in field CrossFileSystems. Defaults to true. |
| includeArtificialFS | Stored in field IncludeArtificialFS. Defaults to false. |
Definition at line 105 of file fscanner.hpp.