BufferInputStream.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_BUFFER_INPUT_STREAM_H
00024 #define _DWFCORE_BUFFER_INPUT_STREAM_H
00025 
00026 
00031 
00032 #include "dwfcore/InputStream.h"
00033 
00034 
00035 namespace DWFCore
00036 {
00037 
00048 class DWFBufferInputStream  : virtual public DWFCoreMemory
00049                             , public DWFInputStream
00050 {
00051 
00052 public:
00053 
00067     _DWFCORE_API
00068     DWFBufferInputStream( const void*   pBuffer,
00069                           size_t        nBufferBytes,
00070                           bool          bOwnBuffer=false)
00071         throw();
00072 
00087     _DWFCORE_API
00088     DWFBufferInputStream( DWFInputStream* pInputStream,
00089                           bool            bOwnStream )
00090        throw();
00091 
00097     _DWFCORE_API
00098     virtual ~DWFBufferInputStream()
00099         throw();
00100 
00108     _DWFCORE_API
00109     virtual size_t available() const
00110         throw( DWFException );
00111 
00126     _DWFCORE_API
00127     virtual size_t read( void*  pBuffer,
00128                          size_t nBytesToRead )
00129         throw( DWFException );
00130 
00142     _DWFCORE_API
00143     virtual off_t seek( int     eOrigin,
00144                         off_t   nOffset )
00145         throw( DWFException );
00146 
00164     _DWFCORE_API
00165     void chainInputStream( DWFInputStream* pInputStream,
00166                            bool            bOwnStream )
00167        throw();
00168 
00169 protected:
00170 
00171     const void*     _pBuffer;
00172     size_t          _iBufferPos;
00173     size_t          _nBufferBytes;
00174     size_t          _nAvailableBytes;
00175 
00176 private:
00177 
00178 
00179     DWFInputStream* _pChainedStream;
00180     bool            _bOwnStream;
00181     bool            _bOwnBuffer;
00182 
00183 private:
00184 
00185     //
00186     // Unimplemented methods
00187     //
00188 
00189     DWFBufferInputStream();
00190     DWFBufferInputStream( const DWFBufferInputStream& );
00191     DWFBufferInputStream& operator=( const DWFBufferInputStream& );
00192 };
00193 
00194 }
00195 
00196 
00197 
00198 #endif

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