#include <ZipException.h>
Public Types | |
enum | ZipErrors { noError, genericError = 200, badZipFile, badCrc, noCallback, noVolumeSize, aborted, abortedAction, abortedSafely, nonRemovable, tooManyVolumes, tooManyFiles, tooLongData, tooBigSize, badPassword, dirWithSize, internalError, fileError, notFound, notRemoved, notRenamed, platfNotSupp, cdirNotFound, noZip64, noAES, outOfBounds, streamEnd = 500, needDict, errNo, streamError, dataError, memError, bufError, versionError } |
Public Member Functions | |
CZipException (int iCause=genericError, LPCTSTR lpszZipName=NULL) | |
CZipException (CZipException &e) | |
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 () |
Represents exceptions specific to the ZipArchive Library.
Definition at line 45 of file ZipException.h.
The codes of errors thrown by the ZipArchive Library.
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 |
abortedAction |
The action callback method returned |
abortedSafely |
The action callback method returned |
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. |
notFound |
A file was not found. |
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 |
bufError |
Zlib library error. |
versionError |
Zlib library error. |
Definition at line 136 of file ZipException.h.
CZipException::CZipException | ( | int | iCause = genericError , |
LPCTSTR | lpszZipName = NULL |
||
) |
Initializes a new instance of the CZipException class.
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 . |
CZipString CZipException::GetErrorDescription | ( | ) |
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
).
lpszError | The buffer to receive the error message. |
nMaxError | The maximum number of characters lpszError can hold, including the ending NULL character. |
TRUE
if the error string was successfully copied to lpszError; FALSE
otherwise.nMaxError
- 1 characters to the buffer, and it always appends a NULL
character. If lpszError is too small, the error message will be truncated.
|
protected |
Returns the error description.
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. |
|
protected |
Returns the error description based on system variables.
|
inlinestatic |
Throws an exception. Whether it throws an object or a pointer to it, depends on the current version (STL or MFC correspondingly).
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 . |
Definition at line 64 of file ZipException.h.
int CZipException::m_iCause |
The error code. It takes one of the CZipException::ZipErrors values.
Definition at line 183 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
value on Windows and to GetLastError()
errno
on other platforms.
Definition at line 188 of file ZipException.h.
CZipString CZipException::m_szFileName |
The name of the archive for which the error occurred.
Definition at line 131 of file ZipException.h.