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

CZipException Class Reference

#include <ZipException.h>

List of all members.


Public Types

enum  ZipErrors {
  noError, genericError = 100, badZipFile, badCrc,
  noCallback, aborted, abortedAction, abortedSafely,
  nonRemovable, tooManyVolumes, tooManyFiles, tooLongData,
  tooBigSize, badPassword, dirWithSize, internalError,
  notRemoved, notRenamed, platfNotSupp, cdirNotFound,
  cdir64NotFound, noBBZInZip64, badAesAuthCode, noZip64,
  noAES, outOfBounds, mutexError, streamEnd = 500,
  needDict, errNo, streamError, dataError,
  memError, bufError, versionError, bzSequenceError = 600,
  bzParamError, bzMemError, bzDataError, bzDataErrorMagic,
  bzIoError, bzUnexpectedEof, bzOutbuffFull, bzConfigError,
  bzInternalError
}

Public Member Functions

 CZipException (CZipException &e)
 CZipException (int iCause=genericError, LPCTSTR lpszZipName=NULL)
CZipString GetErrorDescription ()
ZBOOL GetErrorMessage (LPTSTR lpszError, UINT nMaxError, UINT *=NULL)

Static Public Member Functions

static void Throw (int iCause=CZipException::genericError, LPCTSTR lpszZipName=NULL)

Public Attributes

int m_iCause
CZipString m_szFileName

Protected Member Functions

CZipString GetInternalErrorDescription (int iCause, bool bNoLoop=false)
CZipString GetSystemErrorDescription ()

Detailed Description

Represents exceptions specific to the ZipArchive Library.

See also:
Exceptions Handling

Member Enumeration Documentation

The codes of errors thrown by the ZipArchive Library.

Enumerator:
noError  No error.
genericError  An unknown error.
badZipFile  Damaged or not a zip file.
badCrc  Crc is mismatched.
noCallback  There is no spanned archive callback object set.
aborted  The volume change callback in a segmented archive method returned false.
abortedAction  The action callback method returned false.
abortedSafely  The action callback method returned false, but the data is not corrupted.
nonRemovable  The device selected for the spanned archive is not removable.
tooManyVolumes  The limit of the maximum volumes reached.
tooManyFiles  The limit of the maximum files in an archive reached.
tooLongData  The filename, the comment or the local or central extra field of the file added to the archive is too long.
tooBigSize  The file size is too large to be supported.
badPassword  An incorrect password set for the file being decrypted.
dirWithSize  The directory with a non-zero size found while testing.
internalError  An internal error.
notRemoved  Error while removing a file (under Windows call GetLastError() to find out more).
notRenamed  Error while renaming a file (under Windows call GetLastError() to find out more).
platfNotSupp  Cannot create a file for the specified platform.
cdirNotFound  The central directory was not found in the archive (or you were trying to open not the last disk of a segmented archive).
cdir64NotFound  The Zip64 central directory signature was not found in the archive where expected.
noBBZInZip64  The number of bytes before a zip archive must be zero in the Zip64 format.
badAesAuthCode  Mismatched authentication code in WinZip AEC decrypted data.
noZip64  The Zip64 format has not been enabled for the library, but is required to use the archive.
noAES  WinZip AES encryption has not been enabled for the library, but is required to decompress the archive.
outOfBounds  The collection is empty and the bounds do not exist.
mutexError  Locking or unlocking resources access was unsuccessful.
streamEnd  Zlib library error.
needDict  Zlib library error.
errNo  Zlib library error.
streamError  Zlib library error.
dataError  Zlib library error.
memError  Zlib library or CZipMemFile error.
bufError  Zlib library error.
versionError  Zlib library error.
bzSequenceError  Bzlib library error.
bzParamError  Bzlib library error.
bzMemError  Bzlib library error.
bzDataError  Bzlib library error.
bzDataErrorMagic  Bzlib library error.
bzIoError  Bzlib library error.
bzUnexpectedEof  Bzlib library error.
bzOutbuffFull  Bzlib library error.
bzConfigError  Bzlib library error.
bzInternalError  Internal Bzlib library error.


Constructor & Destructor Documentation

CZipException::CZipException ( int  iCause = genericError,
LPCTSTR  lpszZipName = NULL 
)

Initializes a new instance of the CZipException class.

Parameters:
iCause The error cause. Takes one of the ZipErrors values.
lpszZipName The name of the file where the error occurred (if applicable). May be NULL.


Member Function Documentation

CZipString CZipException::GetErrorDescription (  ) 

Gets the error description.

Returns:
The error description.

ZBOOL CZipException::GetErrorMessage ( LPTSTR  lpszError,
UINT  nMaxError,
UINT *  = NULL 
)

Gets the error description. This method is provided for compatibility with the MFC version (CException::GetErrorMessage).

Parameters:
lpszError The buffer to receive the error message.
nMaxError The maximum number of characters lpszError can hold, including the ending NULL character.
Returns:
TRUE if the error string was successfully copied to lpszError; FALSE otherwise.
Note:
The method will not copy more than nMaxError - 1 characters to the buffer, and it always appends a NULL character. If lpszError is too small, the error message will be truncated.

CZipString CZipException::GetInternalErrorDescription ( int  iCause,
bool  bNoLoop = false 
) [protected]

Gets the error description.

Parameters:
iCause The error cause. Takes one of the ZipErrors values.
bNoLoop If true, does not search for en error description, it the error code is genericError.
Returns:
The error description.

CZipString CZipException::GetSystemErrorDescription (  )  [protected]

Gets the error description based on system variables.

Returns:
The error description.

static void CZipException::Throw ( int  iCause = CZipException::genericError,
LPCTSTR  lpszZipName = NULL 
) [inline, static]

Throws an exception. Whether it throws an object or a pointer to it, depends on the current version (STL or MFC correspondingly).

Parameters:
iCause The error cause. Takes one of the ZipErrors values.
lpszZipName The name of the file where the error occurred (if applicable). May be NULL.
See also:
Exceptions Handling


Member Data Documentation

The error code - takes one of the CZipException::ZipErrors values.

The name of the zip file where the error occurred.


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