1
// ZipException.cpp: implementation of the CZipException class.
3
////////////////////////////////////////////////////////////////////////////////
4
// Copyright (C) 2000 Tadeusz Dracz.
5
// For conditions of distribution and use, see copyright notice in ZipArchive.h
6
////////////////////////////////////////////////////////////////////////////////
9
#include "ZipException.h"
11
//////////////////////////////////////////////////////////////////////
12
// Construction/Destruction
13
//////////////////////////////////////////////////////////////////////
14
IMPLEMENT_DYNAMIC( CZipException, CException)
16
CZipException::CZipException(int iCause, LPCTSTR lpszZipName):CException(TRUE)
21
m_szFileName = lpszZipName;
24
CZipException::~CZipException()
29
void AfxThrowZipException(int iZipError, LPCTSTR lpszZipName)
31
throw new CZipException(CZipException::ZipErrToCause(iZipError), lpszZipName);
34
int CZipException::ZipErrToCause(int iZipError)
39
return CZipException::needDict;
40
case 1://Z_STREAM_END:
41
return CZipException::streamEnd;
43
return CZipException::errNo;
44
case -2://Z_STREAM_ERROR:
45
return CZipException::streamError;
46
case -3://Z_DATA_ERROR:
47
return CZipException::dataError;
48
case -4://Z_MEM_ERROR:
49
return CZipException::memError;
50
case -5://Z_BUF_ERROR:
51
return CZipException::bufError;
52
case -6://Z_VERSION_ERROR:
53
return CZipException::versionError;
55
return CZipException::badZipFile;
57
return CZipException::badCrc;
59
return CZipException::aborted;
61
return CZipException::noCallback;
62
case ZIP_NONREMOVABLE:
63
return CZipException::nonRemovable;
64
case ZIP_TOOMANYVOLUMES:
65
return CZipException::tooManyVolumes;
66
case ZIP_TOOLONGFILENAME:
67
return CZipException::tooLongFileName;
69
return CZipException::badPassword;
70
case ZIP_CDIR_NOTFOUND:
71
return CZipException::cdirNotFound;
75
return CZipException::generic;