summaryrefslogtreecommitdiff
path: root/zip/ZipArchive/ZipException.h
diff options
context:
space:
mode:
Diffstat (limited to 'zip/ZipArchive/ZipException.h')
-rw-r--r--zip/ZipArchive/ZipException.h69
1 files changed, 39 insertions, 30 deletions
diff --git a/zip/ZipArchive/ZipException.h b/zip/ZipArchive/ZipException.h
index ecebe3b..239d58c 100644
--- a/zip/ZipArchive/ZipException.h
+++ b/zip/ZipArchive/ZipException.h
@@ -1,6 +1,6 @@
////////////////////////////////////////////////////////////////////////////////
-// This source file is part of the ZipArchive library source distribution and
-// is Copyrighted 2000 - 2007 by Artpol Software - Tadeusz Dracz
+// This source file is part of the ZipArchive Library Open Source distribution
+// and is Copyrighted 2000 - 2022 by Artpol Software - Tadeusz Dracz
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
@@ -9,7 +9,7 @@
//
// For the licensing details refer to the License.txt file.
//
-// Web Site: http://www.artpol-software.com
+// Web Site: https://www.artpol-software.com
////////////////////////////////////////////////////////////////////////////////
/**
@@ -52,7 +52,7 @@ public:
on the current version (STL or MFC correspondingly).
\param iCause
- The error cause. Takes one of the #ZipErrors values.
+ The error cause. It takes one of the #ZipErrors values.
\param lpszZipName
The name of the file where the error occurred (if applicable).
@@ -63,7 +63,7 @@ public:
*/
static void Throw(int iCause = CZipException::genericError, LPCTSTR lpszZipName = NULL)
{
- #ifdef ZIP_ARCHIVE_MFC
+ #ifdef _ZIP_IMPL_MFC
throw new CZipException(iCause, lpszZipName);
#else
CZipException e(iCause, lpszZipName);
@@ -82,17 +82,20 @@ public:
May be \c NULL.
*/
CZipException(int iCause = genericError, LPCTSTR lpszZipName = NULL);
-
+#if _MSC_VER > 1000
+#pragma warning (disable : 26432)
+#endif
CZipException(CZipException& e)
{
m_szFileName = e.m_szFileName;
m_iCause = e.m_iCause;
+ m_iSystemError = e.m_iSystemError;
}
-#ifdef ZIP_ENABLE_ERROR_DESCRIPTION
+#ifdef _ZIP_ENABLE_ERROR_DESCRIPTION
/**
- Gets the error description.
+ Returns the error description.
\return
The error description.
@@ -101,7 +104,7 @@ public:
/**
- Gets the error description. This method is provided for compatibility with the MFC version (\c CException::GetErrorMessage).
+ Returns the error description. This method is provided for compatibility with the MFC version (\c CException::GetErrorMessage).
\param lpszError
The buffer to receive the error message.
@@ -120,10 +123,10 @@ public:
*/
ZBOOL GetErrorMessage(LPTSTR lpszError, UINT nMaxError, UINT* = NULL);
-#endif //ZIP_ENABLE_ERROR_DESCRIPTION
+#endif //_ZIP_ENABLE_ERROR_DESCRIPTION
/**
- The name of the zip file where the error occurred.
+ The name of the archive for which the error occurred.
*/
CZipString m_szFileName;
@@ -133,33 +136,35 @@ public:
enum ZipErrors
{
noError, ///< No error.
-// 1 - 42 reserved for errno (from STL) values - used only in non-MFC versions
-// 43 - 99 reserved
- genericError = 100, ///< An unknown error.
+// 1 - 199 reserved for errno (from STL) values - used only in non-MFC versions
+ genericError = 200, ///< 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 \c false.
abortedAction, ///< The action callback method returned \c false.
abortedSafely, ///< The action callback method returned \c 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.
+ 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.
- notRemoved, ///< Error while removing a file (under Windows call \c GetLastError() to find out more).
- notRenamed, ///< Error while renaming a file (under Windows call \c GetLastError() to find out more).
+ 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).
+ 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.
-#ifdef ZIP_ARCHIVE_STL
+#ifdef _ZIP_IMPL_STL
outOfBounds, ///< The collection is empty and the bounds do not exist.
#endif
-#ifdef ZIP_ARCHIVE_USE_LOCKING
+#ifdef _ZIP_USE_LOCKING
mutexError, ///< Locking or unlocking resources access was unsuccessful.
#endif
streamEnd = 500, ///< Zlib library error.
@@ -173,18 +178,22 @@ public:
};
/**
- The error code - takes one of the CZipException::ZipErrors values.
+ The error code. It takes one of the CZipException::ZipErrors values.
*/
int m_iCause;
-
- virtual ~CZipException() throw();
+ /**
+ An error code reported by the system during the recent operation.
+ It is set to \c <code>GetLastError()</code> value on Windows and to \c errno on other platforms.
+ */
+ ZIP_SYSTEM_ERROR_TYPE m_iSystemError;
+ virtual ~CZipException() _NOEXCEPT;
protected:
-#ifdef ZIP_ENABLE_ERROR_DESCRIPTION
+#ifdef _ZIP_ENABLE_ERROR_DESCRIPTION
/**
- Gets the error description.
+ Returns the error description.
\param iCause
The error cause. Takes one of the #ZipErrors values.
@@ -199,7 +208,7 @@ protected:
/**
- Gets the error description based on system variables.
+ Returns the error description based on system variables.
\return
The error description.
@@ -207,9 +216,9 @@ protected:
CZipString GetSystemErrorDescription();
-#endif //ZIP_ENABLE_ERROR_DESCRIPTION
+#endif //_ZIP_ENABLE_ERROR_DESCRIPTION
-#if defined _MFC_VER && defined ZIP_ARCHIVE_MFC
+#if defined _MFC_VER && defined _ZIP_IMPL_MFC
DECLARE_DYNAMIC(CZipException)
#endif
};