summaryrefslogtreecommitdiff
path: root/zip/ZipArchive/ZipFile_mfc.h
diff options
context:
space:
mode:
authorTomas Bzatek <tbzatek@users.sourceforge.net>2008-06-08 11:04:43 +0200
committerTomas Bzatek <tbzatek@users.sourceforge.net>2008-06-08 11:04:43 +0200
commit16f738ecee689c6feb2acb7e4ef4d9bb4144ae7d (patch)
tree3d22f54f7298f81b18ed66d05a62fa8bfab359ab /zip/ZipArchive/ZipFile_mfc.h
downloadtuxcmd-modules-release-0.6.36-dev.tar.xz
Diffstat (limited to 'zip/ZipArchive/ZipFile_mfc.h')
-rw-r--r--zip/ZipArchive/ZipFile_mfc.h87
1 files changed, 87 insertions, 0 deletions
diff --git a/zip/ZipArchive/ZipFile_mfc.h b/zip/ZipArchive/ZipFile_mfc.h
new file mode 100644
index 0000000..2688143
--- /dev/null
+++ b/zip/ZipArchive/ZipFile_mfc.h
@@ -0,0 +1,87 @@
+////////////////////////////////////////////////////////////////////////////////
+// This source file is part of the ZipArchive library source distribution and
+// is Copyrighted 2000 - 2007 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
+// as published by the Free Software Foundation; either version 2
+// of the License, or (at your option) any later version.
+//
+// For the licensing details refer to the License.txt file.
+//
+// Web Site: http://www.artpol-software.com
+////////////////////////////////////////////////////////////////////////////////
+
+#ifndef ZIPARCHIVE_ZIPFILE_DOT_H
+ #error Do not include this file directly. Include ZipFile.h instead
+#endif
+
+#if _MSC_VER > 1000 && defined ZIP_HAS_DLL
+ #pragma warning (push)
+ #pragma warning( disable : 4275 ) // non dll-interface used as base for dll-interface class
+#endif
+
+#include "ZipAbstractFile.h"
+#include "ZipExport.h"
+
+class ZIP_API CZipFile : public CZipAbstractFile, public CFile
+{
+public:
+ DECLARE_DYNAMIC(CZipFile)
+ void Flush(){CFile::Flush();}
+ CZipString GetFilePath() const
+ {
+ try
+ {
+ // it throws an exception when working on an offline file
+ return CFile::GetFilePath();
+ }
+ catch (CException* e)
+ {
+ e->Delete();
+ return this->m_strFileName;
+ }
+ }
+
+ ZIP_FILE_USIZE GetPosition() const {return CFile::GetPosition() ;}
+ void SetLength(ZIP_FILE_USIZE nNewLen) {CFile::SetLength(nNewLen);}
+ ZIP_FILE_USIZE Seek(ZIP_FILE_SIZE lOff , int nFrom){return CFile::Seek(lOff, nFrom);}
+ ZIP_FILE_USIZE GetLength() const {return CFile::GetLength();}
+
+
+ UINT Read(void *lpBuf, UINT nCount){return CFile::Read(lpBuf, nCount);}
+ void Write(const void* lpBuf, UINT nCount){CFile::Write(lpBuf, nCount);}
+ bool Open( LPCTSTR lpszFileName, UINT nOpenFlags, bool bThrowExc)
+ {
+ CFileException* e = new CFileException;
+ bool bRet = CFile::Open(lpszFileName, nOpenFlags, e) != 0;
+ if (!bRet && bThrowExc)
+ throw e;
+ e->Delete();
+ return bRet;
+ }
+ CZipFile();
+ bool IsClosed() const
+ {
+ return m_hFile == CFile::hFileNull;
+ }
+
+
+ CZipFile( LPCTSTR lpszFileName, UINT nOpenFlags ):CFile(lpszFileName, nOpenFlags)
+ {
+ }
+
+ void Close( )
+ {
+ if (!IsClosed())
+ CFile::Close();
+ }
+ operator HANDLE();
+ virtual ~CZipFile();
+
+};
+
+#if (_MSC_VER > 1000) && (defined ZIP_HAS_DLL)
+ #pragma warning (pop)
+#endif
+