ZipException.h
Go to the documentation of this file.
1 
2 // This source file is part of the ZipArchive library source distribution and
3 // is Copyrighted 2000 - 2013 by Artpol Software - Tadeusz Dracz
4 //
5 // This program is free software; you can redistribute it and/or
6 // modify it under the terms of the GNU General Public License
7 // as published by the Free Software Foundation; either version 2
8 // of the License, or (at your option) any later version.
9 //
10 // For the licensing details refer to the License.txt file.
11 //
12 // Web Site: http://www.artpol-software.com
14 
21 #if !defined(ZIPARCHIVE_ZIPEXCEPTION_DOT_H)
22 #define ZIPARCHIVE_ZIPEXCEPTION_DOT_H
23 
24 #if _MSC_VER > 1000
25 #pragma once
26 #pragma warning( push )
27 #pragma warning (disable:4702) // disable "Unreachable code" warning in Throw function in the Release mode
28  #if defined ZIP_HAS_DLL
29  #pragma warning( disable : 4251 ) // needs to have dll-interface to be used by clients of class
30  #pragma warning( disable : 4275 ) // non dll-interface used as base for dll-interface class
31  #endif
32 #endif
33 
34 
35 #include "ZipString.h"
36 #include "ZipBaseException.h"
37 #include "ZipExport.h"
38 
45 class ZIP_API CZipException : public CZipBaseException
46 {
47 public:
48 
64  static void Throw(int iCause = CZipException::genericError, LPCTSTR lpszZipName = NULL)
65  {
66  #ifdef _ZIP_IMPL_MFC
67  throw new CZipException(iCause, lpszZipName);
68  #else
69  CZipException e(iCause, lpszZipName);
70  throw e;
71  #endif
72  }
73 
84  CZipException(int iCause = genericError, LPCTSTR lpszZipName = NULL);
85 
87  {
88  m_szFileName = e.m_szFileName;
89  m_iCause = e.m_iCause;
90  m_iSystemError = e.m_iSystemError;
91  }
92 
93 #ifdef _ZIP_ENABLE_ERROR_DESCRIPTION
94 
101  CZipString GetErrorDescription();
102 
103 
122  ZBOOL GetErrorMessage(LPTSTR lpszError, UINT nMaxError, UINT* = NULL);
123 
124 #endif //_ZIP_ENABLE_ERROR_DESCRIPTION
125 
129  CZipString m_szFileName;
130 
135  {
137 // 1 - 199 reserved for errno (from STL) values - used only in non-MFC versions
138  genericError = 200,
162 #ifdef _ZIP_IMPL_STL
164 #endif
165 #ifdef _ZIP_USE_LOCKING
166  mutexError,
167 #endif
168  streamEnd = 500,
176  };
177 
181  int m_iCause;
186  ZIP_SYSTEM_ERROR_TYPE m_iSystemError;
187  virtual ~CZipException() throw();
188 
189 protected:
190 
191 #ifdef _ZIP_ENABLE_ERROR_DESCRIPTION
192 
205  CZipString GetInternalErrorDescription(int iCause, bool bNoLoop = false);
206 
207 
214  CZipString GetSystemErrorDescription();
215 
216 
217 #endif //_ZIP_ENABLE_ERROR_DESCRIPTION
218 
219 #if defined _MFC_VER && defined _ZIP_IMPL_MFC
220  DECLARE_DYNAMIC(CZipException)
221 #endif
222 };
223 
224 #if _MSC_VER > 1000
225  #pragma warning( pop )
226 #endif
227 
228 #endif // !defined(ZIPARCHIVE_ZIPEXCEPTION_DOT_H)
229 
230 

The ZipArchive Library Copyright © 2000 - 2013 Artpol Software - Tadeusz Dracz. Generated at Fri Dec 13 2013 00:05:37.