#include <ZipCallback.h>
When you derive from CZipActionCallback, you can use the new class as a callback object when adding, extracting, deleting, testing files or saving the central directory. You need to override the CZipActionCallback::Callback method. The value of the uProgress parameter in the callback method is the amount of data just processed.
Values used for specifying a callback type in the CZipArchive::SetCallback method. You can assign several values to the same callback object (use the logical OR).
OR
Not used. You can use it for your own purposes.
Compressing a file. The callback called when adding a file with one of the CZipArchive::AddNewFile methods.
Moving a file from a temporary archive. The callback called while adding a file (only on a segmented archive) when the smartness level contains CZipArchive::zipsmCheckForEff or CZipArchive::zipsmCheckForEffInMem and if the just compressed file is being moved from a temporary place (file or memory) to the archive.
Storing a file. The callback called while adding a file and if its compressing has proven to be inefficient and it is now being stored (instead of compressed) in the archive. The smartness level must contain CZipArchive::zipsmCheckForEff or CZipArchive::zipsmCheckForEffInMem. The archive can be segmented or not.
Extracting a file. The callback called when extracting a file with one of the CZipArchive::ExtractFile methods.
Counting data to process before deleting. The callback called before the actual deletion takes place and the map of holes and continuous areas is being created. It is safe to abort the operation (by returning false from the callback method).
false
Deleting files. The callback called when moving data while deleting file(s) with the CZipArchive::RemoveFile method or one of the CZipArchive::RemoveFiles methods.
Testing a file. The callback called when testing a file with the CZipArchive::TestFile method.
Saving the central directory. The callback called when saving the central directory with the CZipCentralDir::Write method (usually on close or flush). It is safe to abort the operation on a segmented archive - the saved part of the central directory will be removed from disk.
Getting a file from another archive. The callback called when using one of the CZipArchive::GetFromArchive methods.
Renaming a file. The callback called when committing changes with the CZipArchive::CommitChanges method, if there is a need to adjust space for the new filenames.
Moving data. The callback called when moving data inside the archive. It happens while replacing files to adjust space for the new file or while shifting data with the CZipArchive::ShiftData() method.
The callback called when counting files and bytes to process when performing multiple actions. When this callback is called, CZipActionCallback::m_uTotalToProcess is not set (because it is unknown and that's why the counting is performed), but it allows to abort the counting process.
The callback called when adding multiple files with one of the CZipArchive::AddNewFiles methods. This callback also registers for cbAdd.
The callback called when preparing existing files for encryption.
The callback called in order to report the progress of adjusting space inside the archive before the actual encryption takes place.
The callback called for every file being encrypted.
The callback called when encrypting existing files in the archive. This callback also registers for cbEncryptMoveData and cbEncrypt.
Reserved. You can declare your own callback types above this value. Do not use the numeric value, but the symbol name - the value may change in the future releases of the library.
All sub-actions. Represents the sub-actions callbacks - they are called as a part of bigger actions (cbAddTmp | cbAddStore | cbDeleteCnt | cbMoveData | cbCalculateForMulti | cbEncryptPrepare | cbEncryptMoveData).
Main callbacks. Represents the main action callbacks (cbAdd | cbExtract | cbDelete | cbTest | cbSave | cbGet | cbModify | cbEncrypt).
Multiple action callbacks. Represents the multiple action callbacks.
All values. Use this value to use one callback object for all callback types.
Caches the value returned from the GetStepSize() method. Called in the Init()method.
Called after the operation finishes. It is not called in case of an exception, but it is called before throwing CZipException::abortedAction or CZipException::abortedSafely.
Calls the Callback() method internally, increases CZipActionCallback::m_uProcessed and lets the CZipActionCallback increase its values, if needed.
Returns the current CMultiActionsInfo object in multiple actions operation or NULL, if the current operation is not one of CZipActionCallback::cbMultiActions actions.
NULL
Specifies how often the Callback() method is called. The Callback() method is called every n-th callback request, where n is the value returned from the GetStepSize() method. Override this method to adjust the frequency of calling the callback.
256
1
Called to initialize the callback object. Sets the filenames and resets m_uTotalToProcess and m_uProcessed variables to 0. m_iType variable is already set to the proper value. Called at the beginning of the operation.
0
Returns the amount of data left to process.
Called at the end of the multiple actions operation. Releases multiple actions information (CMultiActionsInfo). Override this method, if you want this information to be persisted after operation finishes. In that case, CMultiActionsInfo will be released on destruction.
Called when a multiple actions operation is about to begin. Initializes CMultiActionsInfo object.
Called when a next action begins in multiple actions processing. This method calls Callback method with uProgress parameter set to 0.
Called by processing classes when data processing progressed.
true
Called by processing classes when data processing is finished to allow calling the Callback() method for the remaining amount of processed data (for which the Callback() has not been called). This usually happens, when GetStepSize() does not return 1.
Initializes the values that depend on the frequency of calling the Callback() method. Called with every call to the Callback() method.
Sets the type of the callback, that will cause the current CMultiActionsInfo object to update its progress.
Called after calculating the total amount of data to process.
The type of the callback. It is set to one of the CallbackType values when an action begins. It's useful, if you have more than one callback assigned to the same callback object.
The name of the file being processed in the archive.
The total amount of data processed so far.
The total amount of data to process. This value is set when the SetTotal method is called.
Depending on the action it is set then to: