Input parameters to function ScanFiles.
Definition at line 22 of file fscanner.hpp.
#include <fscanner.hpp>
Public Type Index: | |
enum class | SymbolicLinks { DONT_RESOLVE = 0 , RESOLVE_BUT_DONT_FOLLOW = 1 , RECURSIVE = 2 } |
Public Static Field Index: | |
static constexpr unsigned int | InfiniteRecursion = (std::numeric_limits<unsigned int>::max)() |
Public Field Index: | |
bool | CrossFileSystems = true |
SPFileFilter | DirectoryFilterPostRecursion |
SPFileFilter | DirectoryFilterPreRecursion |
SPFileFilter | FileFilter |
bool | IncludeArtificialFS = false |
SymbolicLinks | LinkTreatment = SymbolicLinks::RECURSIVE |
unsigned int | MaxDepth = InfiniteRecursion |
bool | RemoveEmptyDirectories |
PathString | StartPath |
Public Method Index: | |
ScanParameters (const String &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 25 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 51 of file fscanner.hpp.
SPFileFilter DirectoryFilterPostRecursion |
If set (not containing nullptr
), this filter is invoked after to 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 90 of file fscanner.hpp.
SPFileFilter DirectoryFilterPreRecursion |
Same as DirectoryFilterPostRecursion but is used prior to 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 102 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 70 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 56 of file fscanner.hpp.
|
staticconstexpr |
Denotes 'infinite' recursion if set to field MaxDepth.
Definition at line 37 of file fscanner.hpp.
SymbolicLinks LinkTreatment = SymbolicLinks::RECURSIVE |
Denotes how symbolic links are treated.
Definition at line 43 of file fscanner.hpp.
unsigned int MaxDepth = InfiniteRecursion |
The maximum recursion depth. Defaults to InfiniteRecursion.
Definition at line 46 of file fscanner.hpp.
bool RemoveEmptyDirectories |
If false
, empty directories remain in the result tree. Otherwise they are deleted and do not appear in the tree.
Definition at line 60 of file fscanner.hpp.
PathString StartPath |
The path to be scanned.
Definition at line 40 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 112 of file fscanner.hpp.