#include <FileFilter.h>
Public Member Functions | |
CFileFilter (bool bInverted=false) | |
bool | Evaluate (LPCTSTR lpszParentDir, LPCTSTR lpszName, const CFileInfo &info) |
virtual bool | HandlesFile (const CFileInfo &info) |
bool | IsInverted () const |
void | SetInverted (bool bInverted=true) |
Protected Member Functions | |
virtual bool | Accept (LPCTSTR lpszParentDir, LPCTSTR lpszName, const CFileInfo &info) |
virtual bool | HandlesInversion () const |
Protected Attributes | |
bool | m_bInverted |
A base class for filters used in the directory enumeration process.
Definition at line 48 of file FileFilter.h.
|
inline |
Initializes a new instance of the CFileFilter class.
bInverted | Set to true to invert the behavior of the filter or to false for the normal behavior. |
Definition at line 61 of file FileFilter.h.
|
inlineprotectedvirtual |
This method is directly called by the Evaluate method during an enumeration process.
If this method returns true
, the file will later be processed by the CDirEnumerator::Process method. If this method returns false
for a directory, the directory is not enumerated at all.
The meaning of the return value can be reversed by the SetInverted method. If this filter handles the inversion internally, the return value from this method is not reversed by the Evaluate method.
lpszParentDir | The parent directory containing the file to accept. |
lpszName | The name of the file to accept (without a path). |
info | The structure containing the information about the current file. |
true
, if the file is accepted; false
otherwise.Reimplemented in ZipArchiveLib::CGroupFileFilter, and ZipArchiveLib::CNameFileFilter.
Definition at line 210 of file FileFilter.h.
|
inline |
This method is directly called by the CDirEnumerator::Start for each file or directory that was previously accepted with the HandlesFile method.
It internally calls the Accept method and inverts its result, if the filter is in the inverted mode and does not handle the inversion internally.
true
for a file, then the file is processed (the CDirEnumerator::Process method is called for the file). Otherwise the file is not processed.true
for a directory, then the directory can be traversed for files and subfolders (depending on the CDirEnumerator::IsRecursive() method). Otherwise the directory is not traversed.lpszParentDir | The parent directory containing the file to accept. |
lpszName | The name of the file to accept (without a path). |
info | The structure containing the information about the current file. |
true
, if the file is accepted (taking inversion into account); false
otherwise.Definition at line 106 of file FileFilter.h.
|
inlinevirtual |
Returns the value indicating whether the filter can decide about processing of the info file. If it can, then the Evaluate method will be called for the info file. By default this method returns true
for files and false
for directories. Override this method to change its behavior.
false
, then the file is not processed.false
, then the directory can still be traversed for files and subfolders (depending on the CDirEnumerator::IsRecursive() method).The Evaluate method is not called in both cases.
info | The structure containing the information about the file. |
true
, if the info file should be evaluated by the Evaluate method; false
otherwise.Reimplemented in ZipArchiveLib::CGroupFileFilter, and ZipArchiveLib::CNameFileFilter.
Definition at line 169 of file FileFilter.h.
|
inlineprotectedvirtual |
Returns the value indicating whether the current filter handles the inversion mode internally or not.
true
from the Accept method means that the file should be processed.true
from the Accept method means that the file should not be processed.It may be more efficient to handle the inversion internally in some cases.
true
, if the filter handles the inversion internally; false
otherwise.false
by default. Override this method to change this behavior.Reimplemented in ZipArchiveLib::CGroupFileFilter.
Definition at line 236 of file FileFilter.h.
|
inline |
Returns the value indicating whether the filter operates in an inverted mode or in a normal mode.
true
, if the filter operates in an inverted mode; false
otherwise.Definition at line 143 of file FileFilter.h.
|
inline |
Sets the filter to operate in the inverted or in the normal mode. If the filter operates in an inverted mode, the file that this filer accepts is not processed and vice versa. Normal mode means that a file is processed (the CDirEnumerator::Process method is called for that file), if the filter accepts the file.
bInverted | true to make the filter operate in an inverted mode or false to make the filter operate in a normal mode. |
Definition at line 130 of file FileFilter.h.