Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages | Examples

ZipFileDescriptor.h

Go to the documentation of this file.
00001 //
00002 //  Copyright (c) 2003-2005 by Autodesk, Inc.
00003 //
00004 //  By using this code, you are agreeing to the terms and conditions of
00005 //  the License Agreement included in the documentation for this code.
00006 //
00007 //  AUTODESK MAKES NO WARRANTIES, EXPRESS OR IMPLIED,
00008 //  AS TO THE CORRECTNESS OF THIS CODE OR ANY DERIVATIVE
00009 //  WORKS WHICH INCORPORATE IT.
00010 //
00011 //  AUTODESK PROVIDES THE CODE ON AN "AS-IS" BASIS
00012 //  AND EXPLICITLY DISCLAIMS ANY LIABILITY, INCLUDING
00013 //  CONSEQUENTIAL AND INCIDENTAL DAMAGES FOR ERRORS,
00014 //  OMISSIONS, AND OTHER PROBLEMS IN THE CODE.
00015 //
00016 //  Use, duplication, or disclosure by the U.S. Government is subject to
00017 //  restrictions set forth in FAR 52.227-19 (Commercial Computer Software
00018 //  Restricted Rights) and DFAR 252.227-7013(c)(1)(ii) (Rights in Technical
00019 //  Data and Computer Software), as applicable.
00020 //
00021 
00022 
00023 #ifndef _DWFCORE_ZIP_FILE_DESCRIPTOR_H
00024 #define _DWFCORE_ZIP_FILE_DESCRIPTOR_H
00025 
00026 
00031 
00032 #include "dwfcore/String.h"
00033 #include "dwfcore/InputStream.h"
00034 #include "dwfcore/OutputStream.h"
00035 #include "dwfcore/FileDescriptor.h"
00036 #include "dwfcore/zip/zip.h"
00037 #include "dwfcore/zip/unzip.h"
00038 
00039 
00040 
00041 namespace DWFCore
00042 {
00043 
00044 
00053 class DWFZipFileDescriptor : public DWFCoreMemory
00054                            , public DWFFileDescriptor
00055 {
00056 
00057 public:
00058 
00071     typedef enum
00072     {
00076         eUnzip              = -2,
00077 
00082         eZip                = -1,
00083         
00087         eZipNone            = 0,
00088 
00093         eZipFastest         = 1,
00094 
00100         eZipFast            = 3,
00101 
00107         eZipBlendFaster     = 5,
00108 
00114         eZipBlendSmaller    = 7,
00115 
00121         eZipSmaller         = 8,
00122 
00128         eZipSmallest        = 9
00129 
00130     } teFileMode;
00131 
00136     typedef enum
00137     {
00141         eEncrypted,
00142 
00146         eNotEncrypted,
00147 
00152         eEncryptionUnknown
00153     } teEncryption;
00154 
00155 public:
00156 
00168     _DWFCORE_API 
00169     DWFZipFileDescriptor( const DWFFile& rFile,
00170                           teFileMode     eMode )
00171         throw();
00172 
00187     _DWFCORE_API 
00188     DWFZipFileDescriptor( DWFInputStream&  rStream )
00189         throw();
00190 
00196     _DWFCORE_API 
00197     virtual ~DWFZipFileDescriptor()
00198         throw();
00199 
00206     _DWFCORE_API 
00207     virtual void open()
00208         throw( DWFException );
00209 
00215     _DWFCORE_API 
00216     void close()
00217         throw( DWFException );
00218 
00225     _DWFCORE_API 
00226     size_t size()
00227         throw( DWFException );
00228 
00245     _DWFCORE_API 
00246     size_t read( void* pBuffer, size_t nBytesToRead )
00247         throw( DWFException );
00248 
00257     _DWFCORE_API 
00258     off_t seek( int eOrigin, off_t nOffset )
00259         throw( DWFException );
00260 
00271     _DWFCORE_API 
00272     bool locate( const DWFString& rArchivedFile )
00273         throw( DWFException );
00274 
00288     _DWFCORE_API 
00289     DWFInputStream* unzip( const DWFString& zArchivedFile,
00290                            const DWFString& zPassword = L"" )
00291         throw( DWFException );
00292 
00306     _DWFCORE_API 
00307     DWFOutputStream* zip( const DWFString& zArchiveFile,
00308                           const DWFString& zPassword = L"" )
00309         throw( DWFException );
00310 
00320     _DWFCORE_API 
00321     teEncryption encryption()
00322         throw( DWFException );
00323 
00324 protected:
00325 
00329     teFileMode      _eMode;
00330 
00334     teEncryption    _eEncryption; 
00335 
00339     zipFile         _pZipStream;
00340 
00344     unzFile         _pUnzipStream;
00345 
00349     DWFInputStream* _pInputStream;
00350 
00351 private:
00352 
00353     //
00354     // Not Implemented
00355     //
00356     DWFZipFileDescriptor();
00357     DWFZipFileDescriptor( const DWFZipFileDescriptor& );
00358     DWFZipFileDescriptor& operator=( const DWFZipFileDescriptor& );
00359 };
00360 
00361 }
00362 
00363 
00364 #endif

Generated on Tue May 17 12:05:10 2005 for Autodesk DWF Core Library by  doxygen 1.4.1