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

BufferInputStream.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_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  : public DWFCoreMemory
00049                             , public DWFInputStream
00050 {
00051 
00052 public:
00053 
00063     _DWFCORE_API
00064     DWFBufferInputStream( const void*   pBuffer,
00065                           size_t        nBufferBytes )
00066         throw();
00067 
00082     _DWFCORE_API
00083     DWFBufferInputStream( DWFInputStream* pInputStream,
00084                           bool            bOwnStream )
00085        throw();
00086 
00092     _DWFCORE_API
00093     virtual ~DWFBufferInputStream()
00094         throw();
00095 
00103     _DWFCORE_API
00104     virtual size_t available() const
00105         throw( DWFException );
00106 
00121     _DWFCORE_API
00122     virtual size_t read( void*  pBuffer,
00123                          size_t nBytesToRead )
00124         throw( DWFException );
00125 
00137     _DWFCORE_API
00138     virtual off_t seek( int     eOrigin,
00139                         off_t   nOffset )
00140         throw( DWFException );
00141 
00159     _DWFCORE_API
00160     void chainInputStream( DWFInputStream* pInputStream,
00161                            bool            bOwnStream )
00162        throw();
00163 
00164 private:
00165 
00166     const void*     _pBuffer;
00167     size_t          _iBufferPos;
00168     size_t          _nBufferBytes;
00169     size_t          _nAvailableBytes;
00170 
00171     DWFInputStream* _pChainedStream;
00172     bool            _bOwnStream;
00173 
00174 private:
00175 
00176     //
00177     // Unimplemented methods
00178     //
00179 
00180     DWFBufferInputStream();
00181     DWFBufferInputStream( const DWFBufferInputStream& );
00182     DWFBufferInputStream& operator=( const DWFBufferInputStream& );
00183 };
00184 
00185 }
00186 
00187 
00188 
00189 #endif

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