Skip Navigation Links
Skip Navigation LinksHome > ZipArchive > How to Use > API Documentation

ZipArchiveLib::CNameFileFilter Class Reference

#include <FileFilter.h>

Inheritance diagram for ZipArchiveLib::CNameFileFilter:

List of all members.

Public Types

enum  AppliesToTypes { toFile = 0x1, toDirectory = 0x2, toAll = toFile | toDirectory }

Public Member Functions

bool AppliesToType (int iType)
 CNameFileFilter (LPCTSTR lpszPattern=_T("*"), bool bInverted=false, int iAppliesToTypes=toFile, bool bCaseSensitive=ZipPlatform::GetSystemCaseSensitivity())
int GetAppliesToTypes ()
bool HandlesFile (const CFileInfo &info)
void SetAppliesToTypes (int iType)

Protected Member Functions

virtual bool Accept (LPCTSTR, LPCTSTR lpszName, const CFileInfo &info)

Detailed Description

A filter that allows filtering files by a filename mask while an enumeration process.

See also:
Compressing Data
Searching in Archive
CDirEnumerator::Start

Member Enumeration Documentation

The file type to which the CNameFileFilter filter can be applied. You can use the logical OR to combine them.

See also:
SetAppliesToTypes
GetAppliesToTypes
Enumerator:
toFile 

Regular files only.

toDirectory 

Directories only.

toAll 

Both regular files and directories.


Constructor & Destructor Documentation

ZipArchiveLib::CNameFileFilter::CNameFileFilter ( LPCTSTR  lpszPattern = _T("*"),
bool  bInverted = false,
int  iAppliesToTypes = toFile,
bool  bCaseSensitive = ZipPlatform::GetSystemCaseSensitivity() 
) [inline]

Initializes a new instance of the CNameFileFilter class.

Parameters:
lpszPatternA mask to match against a filename. This filter uses the CWildcard functionality for this purpose.
iAppliesToTypesThe file type to which this filter applies. It an be one or more of the AppliesToTypes values.
bInvertedSet to true to invert the behavior of the filter or to false for the normal behavior.
bCaseSensitivetrue, if the matching process is case-sensitive; false otherwise. By default, a system case-sensitivity setting is used.
See also:
Compressing Data
Searching in Archive
SetInverted
SetAppliesToTypes
CWildcard
ZipPlatform::GetSystemCaseSensitivity

Member Function Documentation

virtual bool ZipArchiveLib::CNameFileFilter::Accept ( LPCTSTR  lpszParentDir,
LPCTSTR  lpszName,
const CFileInfo info 
) [inline, protected, virtual]

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.

Parameters:
lpszParentDirThe parent directory containing the file to accept.
lpszNameThe name of the file to accept (without a path).
infoThe structure containing the information about the current file.
Returns:
true, if the file is accepted; false otherwise.
See also:
Evaluate
HandlesInversion
CDirEnumerator::Start
CDirEnumerator::Process

Reimplemented from ZipArchiveLib::CFileFilter.

bool ZipArchiveLib::CNameFileFilter::AppliesToType ( int  iType ) [inline]

Returns the value indicating whether the filter can be applied to the given iType type.

Parameters:
iTypeIt can be one or more of the AppliesToTypes values.
Returns:
true, if the filter can be applied to iType type; false otherwise.
See also:
SetAppliesToTypes
GetAppliesToTypes
int ZipArchiveLib::CNameFileFilter::GetAppliesToTypes (  ) [inline]

Returns the file type to which this filter applies.

Returns:
The file type to which this filter applies. It can be one or more of the AppliesToTypes values.
See also:
SetAppliesToTypes
bool ZipArchiveLib::CNameFileFilter::HandlesFile ( const CFileInfo info ) [inline, virtual]

Returns the value indicating whether the filter can decide about processing of the info file. The CNameFileFilter returns the value depending on the GetAppliesToTypes value.

Parameters:
infoThe structure containing the information about the file.
Returns:
true, if the info file will be evaluated by the Evaluate method; false otherwise.
See also:
GetAppliesToTypes
SetAppliesToTypes

Reimplemented from ZipArchiveLib::CFileFilter.

void ZipArchiveLib::CNameFileFilter::SetAppliesToTypes ( int  iType ) [inline]

Sets the file type to which this filter applies.

Parameters:
iTypeThe file type to which this filter applies. It can be one or more of the AppliesToTypes values.
See also:
GetAppliesToTypes

The documentation for this class was generated from the following file:
Back To Top Up