CZipCallback Struct Reference

A base class for callback objects that are notified when various actions take place. More...

#include <ZipStorage.h>

Inheritance diagram for CZipCallback:

Inheritance graph
[legend]
List of all members.

Public Member Functions

virtual bool Callback (int iProgress)=0
 Method called as a callback.

Public Attributes

CZipString m_szExternalFile
 if the action (adding, extracting or disk-spanning) uses an external file, its filename is stored here

Detailed Description

A base class for callback objects that are notified when various actions take place.

You need to derive your own class and overload Callback method to use it. Do not derive from CZipCallback directly but from CZipSpanCallback (as a callback when there is a need for a disk change in a disk-spanning archive) or from CZipActionCallback for other actions.

Definition at line 44 of file ZipStorage.h.


Member Function Documentation

virtual bool CZipCallback::Callback int  iProgress  )  [pure virtual]
 

Method called as a callback.

Return false from inside the method to abort the current operation. If it is a span callback object, a CZipException with CZipException::aborted code will be thrown, otherwise the code will be CZipException::abortedAction or CZipException::abortedSafely. The following actions can be safely aborted (without having the archive corrupted):

  • counting bytes before deleting files
  • testing
  • saving central directory on non-disk-spanning archive (saved data is removed in case of break and you can save it again); if the archive is disk-spanning and if saving is aborted, the archive will not be damaged, but saved part of the central directory will be not removed and the new central directory will have to be saved after it

Note:
Overrride this method in the derived class. If you define this method inside the class declaration, it should be inlined by the compiler making the action progress faster.

Referenced by CZipActionCallback::operator()().


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