Go to the documentation of this file.00001 #ifndef __ZIP_ABSTRACTION_H__
00002 #define __ZIP_ABSTRACTION_H__
00003
00004 #include <string>
00005
00006 #include <utilities/binary_data.h>
00007
00008 #if !defined( WIN32_PLATFORM ) && !defined( NIX_PLATFORM ) && !defined( MINGW_PLATFORM ) && !defined( CYGWIN_PLATFORM )
00009 #define WIN32_PLATFORM
00010 #endif
00011
00012 #ifdef ZIP_ABSTRACTION
00013 #if defined( WIN32_PLATFORM ) || defined( MINGW_PLATFORM ) || defined( CYGWIN_PLATFORM )
00014 #define ZIP_ABSTRACTION_DLL_ENTITY __declspec( dllexport )
00015 #endif
00016
00017 #if defined( NIX_PLATFORM )
00018 #define ZIP_ABSTRACTION_DLL_ENTITY
00019 #endif
00020 #else
00021 #if defined( WIN32_PLATFORM )
00022 #define ZIP_ABSTRACTION_DLL_ENTITY __declspec( dllimport )
00023 #pragma comment( lib , "zip_abstraction.lib" )
00024 #endif
00025
00026 #if defined( CYGWIN_PLATFORM ) || defined( MINGW_PLATFORM )
00027 #define ZIP_ABSTRACTION_DLL_ENTITY __declspec( dllimport )
00028 #endif
00029
00030 #if defined( NIX_PLATFORM )
00031 #define ZIP_ABSTRACTION_DLL_ENTITY
00032 #endif
00033 #endif
00034
00035 namespace nitro
00036 {
00049 class ZIP_ABSTRACTION_DLL_ENTITY ZIPAbstraction
00050 {
00051 public:
00052
00067 ZIPAbstraction( void );
00068
00087 ZIPAbstraction( const std::string & FilePath );
00088
00107 void Open( const std::string & FilePath );
00108
00135 void AddFile( const std::string & FilePath , const nitro::BinaryData & LoadedFile , const std::string & RelFolderPath = "" );
00136
00159 void AddFile( const std::string & FilePath , const std::string & RelFolderPath = "" );
00160
00179 void Close( void );
00180
00191 virtual ~ZIPAbstraction();
00192
00193 private:
00194
00205 void * File;
00206
00221 ZIPAbstraction( const ZIPAbstraction & ){}
00222
00241 ZIPAbstraction operator=( const ZIPAbstraction & ){return( *this );}
00242 };
00243
00256 class ZIP_ABSTRACTION_DLL_ENTITY UnZIPAbstraction
00257 {
00258 public:
00259
00274 UnZIPAbstraction( void );
00275
00294 UnZIPAbstraction( const std::string & FilePath );
00295
00314 void Open( const std::string & FilePath );
00315
00334 void Close( void );
00335
00354 std::size_t GetCountOfFiles( void ) const;
00355
00382 void UnZIPFile( const std::size_t FileCursor , const std::string & Folder , bool IgnoreFilePath = true );
00383
00394 virtual ~UnZIPAbstraction();
00395
00396 public:
00397
00408 void * File;
00409
00420 std::size_t CurrentCursorPosition;
00421
00436 UnZIPAbstraction( const UnZIPAbstraction & ){}
00437
00456 UnZIPAbstraction operator=( const UnZIPAbstraction & ){return( *this );}
00457
00480 void GotoFile( const std::size_t FileCursor );
00481
00500 void GotoFirstFile( void );
00501
00520 void GotoNextFile( void );
00521
00548 void UnZIPFile( const std::string & Folder , bool IgnoreFilePath );
00549
00550 };
00551 }
00552
00553 #endif