UnzippingInputStream.h

Go to the documentation of this file.
00001 //
00002 //  Copyright (c) 2003-2006 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_UNZIPPING_INPUT_STREAM_H
00024 #define _DWFCORE_UNZIPPING_INPUT_STREAM_H
00025 
00030 
00031 
00032 #include "dwfcore/String.h"
00033 #include "dwfcore/InputStream.h"
00034 #include "dwfcore/ZipFileDescriptor.h"
00035 #include "dwfcore/zip/unzip.h"
00036 #include "dwfcore/Owner.h"
00037 
00038 
00039 namespace DWFCore
00040 {
00041 
00042 
00048 class DWFUnzippingInputStream : virtual public DWFCoreMemory
00049                               , public DWFInputStream
00050                               , public DWFOwner
00051 {
00052 
00053 public:
00054 
00062     _DWFCORE_API 
00063     DWFUnzippingInputStream( unzFile pUnzipStream )
00064         throw();
00065 
00071     _DWFCORE_API 
00072     virtual ~DWFUnzippingInputStream()
00073         throw();
00074 
00082     _DWFCORE_API 
00083     void open( const DWFString& zArchivedFile,
00084                const DWFString& zPassword = "" )
00085         throw( DWFException );
00086 
00091     _DWFCORE_API 
00092     size_t available() const
00093         throw( DWFException );
00094 
00098     _DWFCORE_API 
00099     size_t read( void*  pBuffer, size_t nBytesToRead )
00100         throw( DWFException );
00101 
00105     _DWFCORE_API 
00106     off_t seek( int eOrigin, off_t nOffset )
00107         throw( DWFException );
00108 
00109     _DWFCORE_API
00110     void attach( DWFZipFileDescriptor* pFileDescriptor, bool bOwnDescriptor )
00111         throw();
00112 
00116     _DWFCORE_API
00117     virtual void notifyOwnerChanged( DWFOwnable& rOwnable )
00118         throw( DWFException );
00119 
00123     _DWFCORE_API
00124     virtual void notifyOwnableDeletion( DWFOwnable& rOwnable )
00125         throw( DWFException );
00126 private:
00127 
00128     bool    _bFileOpen;
00129     size_t  _nFileBytesRemaining;
00130     unzFile _pUnzipStream;
00131     DWFZipFileDescriptor*   _pDescriptor;
00132     bool                    _bOwnDescriptor;
00133 
00134 private:
00135 
00136     //
00137     // Unimplemented methods
00138     //
00139 
00140     DWFUnzippingInputStream( const DWFUnzippingInputStream& );
00141     DWFUnzippingInputStream& operator=( const DWFUnzippingInputStream& );
00142 };
00143 
00144 }
00145 
00146 
00147 
00148 #endif

Generated on Tue Jan 6 22:39:29 2009 for Autodesk DWF Core Library by  doxygen 1.4.5