This is a straight forward simple abstract class with just one interface method which has to return true
if an file is included (not filtered) or false
if it is not included and thus to be filtered out.
Instead of the provision of an FInfo object, a cursor of an FTree is provided. This allows more detailed inspection of parent directories, if needed. In addition the full path string (the real path, all symbolic links translated) is provided. While this could be assembled from the given cursor node, the provision is made to allow highest execution performance, as the string is available during the scan process anyhow.
Instances of derived (non abstract) implementations, can optionally be attached to fields FileFilter, DirectoryFilterPreRecursion, and DirectoryFilterPostRecursion of class ScanParameters to filter files during the scan process.
Users of the API might also create code that uses this interface type for post-scan filtering, but in this case may of course also rely on own implementations/mechanics.
Definition at line 34 of file ffilter.hpp.
#include <ffilter.hpp>
Public Method Index: | |
virtual | ~FFilter ()=default |
Destructor. | |
virtual bool | Includes (const File &file, const lang::system::PathString &parentPath)=0 |
|
pure virtual |
Abstract virtual method to evaluate the inclusion of the given FInfo object.
file | The node in the file-tree to examine. |
parentPath | The absolute path to the parent directory that the file resides in. |
true
means "passed" and false
means "filtered out". Implemented in FileExpressions::Filter.