CZipActionCallback Struct Reference

Derive from this a class to be used as a callback object when adding, extracting, deleting, testing a file or saving central directory. More...

#include <ZipStorage.h>

Inheritance diagram for CZipActionCallback:

Inheritance graph
[legend]
List of all members.

Public Member Functions

 CZipActionCallback ()
virtual void Init (LPCTSTR lpszFileInZip=NULL, LPCTSTR lpszExternalFile=NULL)
 Used by the ZipArchive library to init the callback function with the filenames.
virtual void SetTotal (DWORD uTotalToDo)
 Called by the ZipArchive functions that use the callback feature after calculating total data to process.
DWORD LeftToDo ()
virtual void CallbackEnd ()
 Called after the action finishes (it is not called in case of an exception, but it is called before throwing CZipException::abortedAction or CZipException::abortedSafely).
virtual bool operator() (int iProgress)
 Used internally to call Callback and increase m_uTotalSoFar by iProgress.
int GetStep ()
 Used internally to return m_iStep value but not 0 (return 1 in this case).

Public Attributes

int m_iType
 The type of the callback.
DWORD m_uTotalToDo
 Total number of data to process.
DWORD m_uTotalSoFar
 total number of bytes processed so far
CZipString m_szFileInZip
 file in zip archive being currently processed

Static Public Attributes

static int m_iStep
 Used only when creating map before deletion (see CZipArchive::cbDeleteCnt) or saving the central directory record.

Detailed Description

Derive from this a class to be used as a callback object when adding, extracting, deleting, testing a file or saving central directory.

You need to override member function CZipCallback::Callback. The meaning of iProgress parameter is the count of data just processed. It is a smallest number of bytes after which the callback method is called and it depends on the value of nBufSize in the CZipArchive methods that uses the callback feature. In case of saving the central directory action it is the count of file headers just written (see CZipArchive::cbSave)

See also:
CZipCallback::Callback

CZipArchive::SetCallback

Definition at line 101 of file ZipStorage.h.


Member Function Documentation

virtual void CZipActionCallback::Init LPCTSTR  lpszFileInZip = NULL,
LPCTSTR  lpszExternalFile = NULL
[inline, virtual]
 

Used by the ZipArchive library to init the callback function with the filenames.

Resets m_uTotalToDo and m_uTotalSoFar variables to 0. m_iType variable is already set to the proper value. Called at the beginning of the action.

Definition at line 120 of file ZipStorage.h.

DWORD CZipActionCallback::LeftToDo  )  [inline]
 

Returns:
the number of bytes left to process

Definition at line 159 of file ZipStorage.h.

virtual void CZipActionCallback::SetTotal DWORD  uTotalToDo  )  [inline, virtual]
 

Called by the ZipArchive functions that use the callback feature after calculating total data to process.

Parameters:
uTotalToDo total data to process; set m_uTotalToDo to this value

Definition at line 133 of file ZipStorage.h.


Member Data Documentation

int CZipActionCallback::m_iStep [static]
 

Used only when creating map before deletion (see CZipArchive::cbDeleteCnt) or saving the central directory record.

You'll be notified every nth step (n is m_iStep value) with iProgress set to m_iStep . Do not set it to low values or you can have a long waiting on archives with huge number of files.

Default: 256.

Definition at line 188 of file ZipStorage.h.

int CZipActionCallback::m_iType
 

The type of the callback.

It is set to one of CZipArchive::CallbackType values when the action begins. It's useful if you have more than one callback assigned to the same callback object.

Definition at line 114 of file ZipStorage.h.

Referenced by CZipArchive::CZipClbckStrg::Get().

DWORD CZipActionCallback::m_uTotalToDo
 

Total number of data to process.

The value of this variable is set after calling by the library SetTotal method (it is 0 before). Depending on the action it is set then to:

Definition at line 151 of file ZipStorage.h.


The documentation for this struct was generated from the following file:
ZipArchive Copyright © 2000 - 2006 Tadeusz Dracz . Generated at Fri Apr 7 13:55:24 2006.