util/zz_zip.h

Go to the documentation of this file.
00001 /* libzzutil
00002  *
00003  * This program is distributed under the GNU General Public License, version 2.
00004  * A copy of this license is included with this source.
00005  *
00006  * Copyright 2000-2006, Toni Thomsson <toni@tonjac.org> 
00007 */
00008 
00009 #ifndef zz_zip_h
00010 #define zz_zip_h
00011 
00012 #pragma warning(disable:4786)
00013 
00014 extern "C"
00015 {
00016         #include <structs.h>
00017 }
00018 
00019 #include <windows.h>
00020 #include <direct.h>
00021 #include <map>
00022 #include <string>
00023 #include <zz_file.h>
00024 #include <zz_exception.h>
00025 #include <zz_string.h>
00026 
00027 using namespace std;
00028 
00029 extern "C"
00030 {
00031 
00032 // Description: callback, endast internt
00033 typedef int ( __stdcall FUNC_ZPINIT )( ZIPUSERFUNCTIONS* );
00034 
00035 // Description: callback, endast internt
00036 typedef BOOL ( __stdcall FUNC_ZPSETOPTIONS )( ZPOPT );
00037 
00038 // Description: callback, endast internt
00039 typedef int ( __stdcall FUNC_ZPARCHIVE )( ZCL );
00040 
00041 }
00042 
00043 
00044 
00045 /*
00046         Description:
00047         Zip-arkiv
00048 
00049         Remarks:
00050         En "wrapper" kring ZIP-API:et från InfoZip
00051 
00052         Author: 
00053         Toni Thomsson, toni@tonjac.org
00054 
00055         Library:
00056         libzzutil.lib zip32.dll
00057 
00058         Platform:
00059         win32
00060 */
00061 class ZZ_API CzzZip : public CzzFile
00062 {
00063 public:
00064 
00065         /*
00066                 Description:
00067                 Skapar ett ZIP-arkiv
00068                 
00069                 Throws:
00070                 CzzException
00071         */
00072         CzzZip( const char* archive // IN, arkivnamn (sökväg)
00073                                 );
00074 
00075         virtual ~CzzZip();
00076 
00077         /*
00078                 Description:
00079                 Lägger till en fil till arkivet
00080                 
00081                 Throws:
00082                 CzzException
00083         */
00084         void AddFile( const char* file // IN, sökväg till fil som skall arkiveras
00085                                         );
00086 
00087         /*
00088                 Description:
00089                 Komprimerar arkivet
00090                 
00091                 Throws:
00092                 CzzException
00093         */
00094         void Compress( void );
00095 
00096 private:
00097 
00098         void InitOptions( void );
00099 
00100         map<int, string > m_Files;
00101         HINSTANCE m_hDLL;
00102         string m_Name;
00103         ZPOPT m_Options;
00104         ZCL m_Archive;
00105         ZIPUSERFUNCTIONS m_UserFuncs;
00106         FUNC_ZPSETOPTIONS* m_pfZpSetOptions;
00107         FUNC_ZPINIT* m_pfZpInit;
00108         FUNC_ZPARCHIVE* m_pfZpArchive;
00109 };
00110 
00111 #endif // zz_zip_h
00112 

Generated on Thu Sep 21 21:45:42 2006 for tonjac.org MINI/C++ library by  doxygen 1.4.6-NO