Skip Navigation Links
Skip Navigation LinksHome > ZipArchive > How to Use > API Documentation
The ZipArchive Library
ZipArchiveLib::CNameFileFilter Class Reference

#include <FileFilter.h>

Inheritance diagram for ZipArchiveLib::CNameFileFilter:
Inheritance graph

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)
Public Member Functions inherited from ZipArchiveLib::CFileFilter
 CFileFilter (bool bInverted=false)
bool Evaluate (LPCTSTR lpszParentDir, LPCTSTR lpszName, const CFileInfo &info)
bool IsInverted () const
void SetInverted (bool bInverted=true)

Protected Member Functions

virtual bool Accept (LPCTSTR, LPCTSTR lpszName, const CFileInfo &ZIP_UNUSED info)
Protected Member Functions inherited from ZipArchiveLib::CFileFilter
virtual bool Accept (LPCTSTR ZIP_UNUSED lpszParentDir, LPCTSTR ZIP_UNUSED lpszName, const CFileInfo &ZIP_UNUSED info)
virtual bool HandlesInversion () const

Additional Inherited Members

Protected Attributes inherited from ZipArchiveLib::CFileFilter
bool m_bInverted

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

◆ AppliesToTypes

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

◆ CNameFileFilter()

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

◆ Accept()

virtual bool ZipArchiveLib::CNameFileFilter::Accept ( LPCTSTR ,
LPCTSTR lpszName,
const CFileInfo &ZIP_UNUSED info )
inlineprotectedvirtual

Accepts a file based on the filename pattern.

Parameters
lpszNameThe name of the file to accept (without a path).
infoThe structure containing the information about the current file.
Returns
true, if the file matches the pattern; false otherwise.

◆ AppliesToType()

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

◆ 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

◆ HandlesFile()

bool ZipArchiveLib::CNameFileFilter::HandlesFile ( const CFileInfo & info)
inlinevirtual

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.

Note
To keep traversing directories without adding some of them to the archive, return false from this method for the directory that should be traversed, but not added.
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.

◆ SetAppliesToTypes()

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