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

ZipArchiveLib::CBaseLibCompressor Class Reference

#include <BaseLibCompressor.h>

Inheritance diagram for ZipArchiveLib::CBaseLibCompressor:

List of all members.


Public Member Functions

 CBaseLibCompressor (CZipStorage *pStorage)
void InitDecompression (CZipFileHeader *pFile, CZipCryptograph *pCryptograph)

Protected Member Functions

void CheckForError (int iErr)
void EmptyPtrList ()
virtual bool IsCodeErrorOK (int iErr) const =0
void SetOpaque (void **opaque, const COptions *pOptions)

Static Protected Member Functions

static void * _zipalloc (void *opaque, UINT items, UINT size)
static void _zipfree (void *opaque, void *address)

Protected Attributes

bool m_bDecompressionDone

Classes

struct  COptions

Detailed Description

A base class for compressors that use external libraries, such as zlib or bzip2.

Constructor & Destructor Documentation

ZipArchiveLib::CBaseLibCompressor::CBaseLibCompressor ( CZipStorage pStorage  )  [inline]

Initializes a new instance of the CBaseLibCompressor class.

Parameters:
pStorage The current storage object.


Member Function Documentation

static void* ZipArchiveLib::CBaseLibCompressor::_zipalloc ( void *  opaque,
UINT  items,
UINT  size 
) [inline, static, protected]

A memory allocation method called by an external library.

Parameters:
opaque Internal data.
items The number of blocks to allocate.
size The size of each block to allocate.
Returns:
The address of a newly allocated memory.

static void ZipArchiveLib::CBaseLibCompressor::_zipfree ( void *  opaque,
void *  address 
) [inline, static, protected]

A memory deallocation method called by an external library.

Parameters:
opaque Internal data.
address Memory address to free.

void ZipArchiveLib::CBaseLibCompressor::CheckForError ( int  iErr  )  [inline, protected]

Checks, if iErr value is an error code and throws an exception, if it is.

Parameters:
iErr The error code.
Note:
Throws exceptions.

void ZipArchiveLib::CBaseLibCompressor::EmptyPtrList (  )  [protected]

Frees the memory allocated by an external library that hasn't been freed due to an error in the library (usually never happens).

void ZipArchiveLib::CBaseLibCompressor::InitDecompression ( CZipFileHeader pFile,
CZipCryptograph pCryptograph 
) [inline, virtual]

The method called when a new file is opened for extraction.

Parameters:
pFile The file being extracted.
pCryptograph The current CZipCryptograph. Can be NULL, if no decryption is used.
See also:
Decompress

FinishDecompression

Reimplemented from CZipCompressor.

Reimplemented in ZipArchiveLib::CDeflateCompressor, and ZipArchiveLib::CBzip2Compressor.

virtual bool ZipArchiveLib::CBaseLibCompressor::IsCodeErrorOK ( int  iErr  )  const [protected, pure virtual]

Checks, if iErr value is an error code.

Parameters:
iErr The code to check.
Returns:
true, if iErr is an error code; false otherwise.

Implemented in ZipArchiveLib::CDeflateCompressor, and ZipArchiveLib::CBzip2Compressor.

void ZipArchiveLib::CBaseLibCompressor::SetOpaque ( void **  opaque,
const COptions pOptions 
) [protected]

Sets an address of internal data used in ZipArchive Library memory allocation and deallocation methods.

Parameters:
opaque Receives an address on the internal data.
pOptions The current decompressor options.


Member Data Documentation

Signalizes, that the decompression process reached the end of the compressed data. It is internally set by derived classes.


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