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

ZipArchiveLib::CGroupFileFilter Class Reference

#include <FileFilter.h>

Inheritance diagram for ZipArchiveLib::CGroupFileFilter:

List of all members.


Public Types

enum  GroupType { And, Or }

Public Member Functions

void Add (CFileFilter *pFilter)
 CGroupFileFilter (GroupType groupType=CGroupFileFilter::And, bool bAutoDelete=true, bool bInverted=false)
void Clear ()
const CFileFilterGetAt (ZIP_ARRAY_SIZE_TYPE uIndex) const
CFileFilterGetAt (ZIP_ARRAY_SIZE_TYPE uIndex)
ZIP_ARRAY_SIZE_TYPE GetSize ()
GroupType GetType () const
bool HandlesFile (const CFileInfo &info)
bool IsAutoDelete () const
CFileFilteroperator[] (ZIP_ARRAY_SIZE_TYPE uIndex)
const CFileFilteroperator[] (ZIP_ARRAY_SIZE_TYPE uIndex) const
void RemoveAt (ZIP_ARRAY_SIZE_TYPE uIndex)
void SetAutoDelete (bool bAutoDelete)
void SetType (GroupType iType)

Protected Member Functions

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

Protected Attributes

bool m_bAutoDelete
 Set with the SetAutoDelete or in constructor.
GroupType m_iType
 Set with the SetType method or in constructor.

Detailed Description

A filter that allows grouping of other filters.

See also:
Compressing Data

CDirEnumerator::Start


Member Enumeration Documentation

The grouping type.

Enumerator:
And  Logical AND. All the grouped filters must accept a file for the file to be processed.
Or  Logical OR. At least one of the grouped filters must accept a file for the file to be processed.


Constructor & Destructor Documentation

ZipArchiveLib::CGroupFileFilter::CGroupFileFilter ( GroupType  groupType = CGroupFileFilter::And,
bool  bAutoDelete = true,
bool  bInverted = false 
) [inline]

Initializes a new instance of the CGroupFileFilter class.

Parameters:
groupType The grouping type. Should be one of the GroupType values.
bAutoDelete true, if the grouped filters should be automatically destroyed by this filter; false otherwise.
bInverted Set to true to invert the behavior of the filter or to false for the normal behavior. This filter handles the inversion mode internally.
See also:
Compressing Data

SetType

SetAutoDelete

SetInverted

HandlesInversion


Member Function Documentation

virtual bool ZipArchiveLib::CGroupFileFilter::Accept ( LPCTSTR  lpszParentDir,
LPCTSTR  lpszName,
const CFileInfo info 
) [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:
lpszParentDir The parent directory containing the file to accept.
lpszName The name of the file to accept (without a path).
info A 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.

void ZipArchiveLib::CGroupFileFilter::Add ( CFileFilter pFilter  )  [inline]

Add pFilter to the filter's group.

Parameters:
pFilter The filter to add.

void ZipArchiveLib::CGroupFileFilter::Clear (  )  [inline]

Removes all contained filters from the collection.

The removed filters are deleted from memory, if the CGroupFileFilter object is in the auto-delete mode.

See also:
SetAutoDelete

const CFileFilter* ZipArchiveLib::CGroupFileFilter::GetAt ( ZIP_ARRAY_SIZE_TYPE  uIndex  )  const [inline]

Returns the filter at the given position.

Parameters:
uIndex The index of the filter to return.

CFileFilter* ZipArchiveLib::CGroupFileFilter::GetAt ( ZIP_ARRAY_SIZE_TYPE  uIndex  )  [inline]

Returns the filter at the given position.

Parameters:
uIndex The index of the filter to return.

ZIP_ARRAY_SIZE_TYPE ZipArchiveLib::CGroupFileFilter::GetSize (  )  [inline]

Returns the number of grouped filters.

Returns:
The number of grouped filters.

GroupType ZipArchiveLib::CGroupFileFilter::GetType (  )  const [inline]

Returns the type of grouping.

Returns:
The type of groupgroupeding. Can be one of the GroupType values.
See also:
SetType

bool ZipArchiveLib::CGroupFileFilter::HandlesFile ( const CFileInfo info  )  [inline, virtual]

Returns the value indicating whether the filter can decide about processing of the info file. The CGroupFileFilter returns the value depending on the value returned by the grouped filters.

Parameters:
info A structure containing the information about the file.
Returns:
true, if any of the grouped filters accepts info; false otherwise.

Reimplemented from ZipArchiveLib::CFileFilter.

bool ZipArchiveLib::CGroupFileFilter::HandlesInversion (  )  const [inline, protected, virtual]

This filter handles inversion internally.

Returns:
This method returns true for this class.
See also:
CFileFilter::HandlesInversion

Reimplemented from ZipArchiveLib::CFileFilter.

bool ZipArchiveLib::CGroupFileFilter::IsAutoDelete (  )  const [inline]

Return the value indicating whether the auto-deletion is enabled or not.

Returns:
true, if the auto-deletion is enabled; false otherwise.
See also:
SetAutoDelete

CFileFilter* ZipArchiveLib::CGroupFileFilter::operator[] ( ZIP_ARRAY_SIZE_TYPE  uIndex  )  [inline]

Returns the filter at the given position.

Parameters:
uIndex The index of the filter to return.

const CFileFilter* ZipArchiveLib::CGroupFileFilter::operator[] ( ZIP_ARRAY_SIZE_TYPE  uIndex  )  const [inline]

Returns the filter at the given position.

Parameters:
uIndex The index of the filter to return.

void ZipArchiveLib::CGroupFileFilter::RemoveAt ( ZIP_ARRAY_SIZE_TYPE  uIndex  )  [inline]

Remove the filter at the given position. The removed filter is deleted from memory, if the CGroupFileFilter object is in the auto-delete mode.

Parameters:
uIndex The index of the filter to remove.
See also:
SetAutoDelete

void ZipArchiveLib::CGroupFileFilter::SetAutoDelete ( bool  bAutoDelete  )  [inline]

Enable or disable auto-deletion of grouped filters. If auto-deletion is enabled, the grouped filters are released from memory when they are removed from the group or when the CGroupFileFilter object is destroyed.

Parameters:
bAutoDelete true, to enable auto-deletion; false to disable.
See also:
IsAutoDelete

void ZipArchiveLib::CGroupFileFilter::SetType ( GroupType  iType  )  [inline]

Sets the type of grouping.

Parameters:
iType The type of grouping. Should be one of the GroupType values.
See also:
GetType


Member Data Documentation

Set with the SetAutoDelete or in constructor.

Set with the SetType method or in constructor.


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