Input parameters to function ScanFiles.
Definition at line 50 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 int | InfiniteRecursion = (std::numeric_limits<unsigned int>::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 int | MaxDepth = InfiniteRecursion |
The maximum recursion depth. Defaults to InfiniteRecursion. | |
bool | RemoveEmptyDirectories = false |
Path | StartPath |
The path to be scanned. | |
Public Method Index: | |
ScanParameters (const lang::system::PathString &startPath, SymbolicLinks linkTreatment=SymbolicLinks::RECURSIVE, unsigned int maxDepth=InfiniteRecursion, bool crossFileSystems=true, bool includeArtificialFS=false) | |
|
strong |
Options for processing symbolic links.
Enumerator | |
---|---|
DONT_RESOLVE | Demands not to resolve symbolic links in any way. |
RESOLVE_BUT_DONT_FOLLOW | Demands to read symbolic links, but not follow linked directories. FInfo dates, sizes and access rights are set according to the link target. |
RECURSIVE | Read symbolic links and in case they are targeting a directory, recurse into, if this directory meets the other constraints associated with the current scan. |
Definition at line 53 of file fscanner.hpp.
bool 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 79 of file fscanner.hpp.
SPFileFilter 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 SymbolicLinks::RECURSIVE, this filter is also applied to symbolic links, which are readable, not broken and target a directory.
Definition at line 118 of file fscanner.hpp.
SPFileFilter 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 FInfo::Sums 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 130 of file fscanner.hpp.
SPFileFilter FileFilter |
If set (not containing nullptr
), files are passed to this filter and removed if false
is returned.
The term "files" here means all sort of files except Directories. Directories are either real directories, or in case field LinkTreatment is set to SymbolicLinks::RECURSIVE, symbolic links that target a directory.
Definition at line 98 of file fscanner.hpp.
bool 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 84 of file fscanner.hpp.
|
staticconstexpr |
Denotes 'infinite' recursion if set to field MaxDepth.
Definition at line 65 of file fscanner.hpp.
SymbolicLinks LinkTreatment = SymbolicLinks::RECURSIVE |
Denotes how symbolic links are treated.
Definition at line 71 of file fscanner.hpp.
unsigned int MaxDepth = InfiniteRecursion |
The maximum recursion depth. Defaults to InfiniteRecursion.
Definition at line 74 of file fscanner.hpp.
bool 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 88 of file fscanner.hpp.
Path StartPath |
The path to be scanned.
Definition at line 68 of file fscanner.hpp.
|
inline |
Constructor accepting all features.
startPath | Stored in field StartPath. |
linkTreatment | Stored in field LinkTreatment. Defaults to SymbolicLinks::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 138 of file fscanner.hpp.