Public Member Functions | Protected Member Functions | List of all members
ZipArchiveLib::CDirEnumerator Class Referenceabstract

#include <DirEnumerator.h>

Inheritance diagram for ZipArchiveLib::CDirEnumerator:
Inheritance graph

Public Member Functions

LPCTSTR GetCurrentDirectory () const
 
LPCTSTR GetDirectory () const
 
bool IsRecursive () const
 
bool Start (CFileFilter &filter)
 

Protected Member Functions

 CDirEnumerator (LPCTSTR lpszDirectory, bool bRecursive=true)
 
virtual void EnterDirectory ()
 
virtual void ExitDirectory ()
 
virtual void OnEnumerationBegin ()
 
virtual void OnEnumerationEnd (bool bResult)
 
virtual bool Process (LPCTSTR lpszPath, const CFileInfo &info)=0
 

Detailed Description

A base class for processing multiple files in a directory. It provides a directory enumeration functionality.

Definition at line 46 of file DirEnumerator.h.

Constructor & Destructor Documentation

ZipArchiveLib::CDirEnumerator::CDirEnumerator ( LPCTSTR  lpszDirectory,
bool  bRecursive = true 
)
inlineprotected

Initializes a new CDirEnumerator object.

Parameters
lpszDirectoryA directory to process.
bRecursiveThe value indicating whether the subfolders of lpszDirectory should be processed recursively.
See Also
GetDirectory
IsRecursive

Definition at line 68 of file DirEnumerator.h.

Member Function Documentation

virtual void ZipArchiveLib::CDirEnumerator::EnterDirectory ( )
inlineprotectedvirtual

This method is called when an enumeration process enters a new directory.

See Also
GetCurrentDirectory
ExitDirectory

Definition at line 127 of file DirEnumerator.h.

virtual void ZipArchiveLib::CDirEnumerator::ExitDirectory ( )
inlineprotectedvirtual

This method is called when an enumeration process exits a directory.

See Also
GetCurrentDirectory
EnterDirectory

Definition at line 137 of file DirEnumerator.h.

LPCTSTR ZipArchiveLib::CDirEnumerator::GetCurrentDirectory ( ) const
inline

Returns the directory being currently processed.

Returns
The directory being currently processed.

Definition at line 170 of file DirEnumerator.h.

LPCTSTR ZipArchiveLib::CDirEnumerator::GetDirectory ( ) const
inline

Returns the directory being enumerated.

Returns
The directory being enumerated (root).
See Also
CDirEnumerator::CDirEnumerator

Definition at line 150 of file DirEnumerator.h.

bool ZipArchiveLib::CDirEnumerator::IsRecursive ( ) const
inline

Returns the value indicating whether the subfolders of the root directory are processed recursively.

Returns
true, if the enumeration process is recursive; false otherwise.
See Also
CDirEnumerator::CDirEnumerator

Definition at line 162 of file DirEnumerator.h.

virtual void ZipArchiveLib::CDirEnumerator::OnEnumerationBegin ( )
inlineprotectedvirtual

This method is called at the beginning of the enumeration process.

See Also
OnEnumerationEnd

Definition at line 105 of file DirEnumerator.h.

virtual void ZipArchiveLib::CDirEnumerator::OnEnumerationEnd ( bool  bResult)
inlineprotectedvirtual

This method is called at the end of the enumeration process.

Parameters
bResultIt is set to false, if the Process method returned false (the enumeration was aborted). Otherwise, it is set to true.
See Also
OnEnumerationBegin

Definition at line 117 of file DirEnumerator.h.

virtual bool ZipArchiveLib::CDirEnumerator::Process ( LPCTSTR  lpszPath,
const CFileInfo info 
)
protectedpure virtual

Override this method to perform file processing while enumerating directories. This method is not called for directories, but for files only.

Parameters
lpszPathThe full path to the current file.
infoA structure containing an information about the current file.
Returns
Return true to continue the enumeration. When you return false, the enumeration is aborted.
See Also
CFileFilter::Evaluate

Implemented in CZipAddFilesEnumerator.

bool ZipArchiveLib::CDirEnumerator::Start ( CFileFilter filter)

Starts the enumeration process. Calls CFileFilter::Evaluate method for every file or directory found. If CFileFilter::Evaluate returns true, the file is processed by the Process method.

Parameters
filterA filter that decides which directories and/or files should be processed and which should not.
Returns
false, if the process was aborted (the Process method returned false); true otherwise.
See Also
CFileFilter::Evaluate

The documentation for this class was generated from the following file:

The ZipArchive Library Copyright © 2000 - 2022 Artpol Software - Tadeusz Dracz. Generated at Sat Dec 17 2022 19:57:04.