CZipException Class Reference

#include <ZipException.h>

List of all members.

Public Types

enum  ZipErrors {
  noError, genericError = 100, badZipFile, badCrc,
  noCallback, noVolumeSize, aborted, abortedAction,
  abortedSafely, nonRemovable, tooManyVolumes, tooManyFiles,
  tooLongData, tooBigSize, badPassword, dirWithSize,
  internalError, fileError, notRemoved, notRenamed,
  platfNotSupp, cdirNotFound, noZip64, noAES,
  outOfBounds, streamEnd = 500, needDict, errNo,
  streamError, dataError, memError, bufError,
  versionError
}

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
ZIP_SYSTEM_ERROR_TYPE m_iSystemError
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

Definition at line 45 of file ZipException.h.


Member Enumeration Documentation

The codes of errors thrown by the ZipArchive Library.

Enumerator:
noError  No error.
genericError  An unspecified error.
badZipFile  Damaged or not a zip file.
badCrc  Crc is mismatched.
noCallback  There is no spanned archive callback object set.
noVolumeSize  The volume size was not defined for a split archive.
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 number of volumes has been reached.
tooManyFiles  The limit of the maximum number of files in an archive has been reached.
tooLongData  The filename, the comment or 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.
fileError  A file error occurred. Examine m_iSystemError for more information.
notRemoved  Error while removing a file. Examine m_iSystemError for more information.
notRenamed  Error while renaming a file. Examine m_iSystemError for more information.
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).
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.
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.

Definition at line 134 of file ZipException.h.


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 (  ) 

Returns the error description.

Returns:
The error description.

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

Returns 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]

Returns 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]

Returns 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. It 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

Definition at line 64 of file ZipException.h.


Member Data Documentation

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

Definition at line 181 of file ZipException.h.

ZIP_SYSTEM_ERROR_TYPE CZipException::m_iSystemError

An error code reported by the system during the recent operation. It is set to GetLastError value on Windows and to errno on other platforms.

Definition at line 186 of file ZipException.h.

The name of the archive for which the error occurred.

Definition at line 129 of file ZipException.h.


The documentation for this class was generated from the following file:

The ZipArchive Library Copyright © 2000 - 2009 Artpol Software - Tadeusz Dracz. Generated at Fri Apr 24 16:46:35 2009.