FileInputStream.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_FILE_INPUT_STREAM_H
00024 #define _DWFCORE_FILE_INPUT_STREAM_H
00025 
00026 
00031 
00032 
00033 #include "dwfcore/InputStream.h"
00034 #include "dwfcore/FileDescriptor.h"
00035 
00036 
00037 namespace DWFCore
00038 {
00039 
00045 class DWFFileInputStream : virtual public DWFCoreMemory
00046                          , public DWFInputStream
00047 {
00048 
00049 public:
00050 
00056     _DWFCORE_API
00057     DWFFileInputStream()
00058         throw();
00059 
00065     _DWFCORE_API
00066     virtual ~DWFFileInputStream()
00067         throw();
00068 
00081     _DWFCORE_API 
00082     void attach( DWFFileDescriptor* pFileDescriptor,
00083                  bool               bOwnDescriptor )
00084         throw( DWFException );
00085 
00091     _DWFCORE_API 
00092     void detach()
00093         throw( DWFException );
00094 
00107     _DWFCORE_API
00108     size_t available() const
00109         throw( DWFException );
00110 
00122     _DWFCORE_API 
00123     size_t read( void*  pBuffer,
00124                  size_t nBytesToRead )
00125         throw( DWFException );
00126 
00137     _DWFCORE_API
00138     off_t seek( int    eOrigin,
00139                 off_t  nOffset )
00140         throw( DWFException );
00141 
00148     _DWFCORE_API
00149     const DWFFileDescriptor* descriptor() const
00150         throw()
00151     {
00152         return _pFileDescriptor;
00153     }
00154 
00155 private:
00156 
00157     bool               _bOwner;
00158     size_t             _nAvailableBytes;
00159     DWFFileDescriptor* _pFileDescriptor;
00160 
00161 private:
00162 
00163     //
00164     // Unimplemented methods
00165     //
00166 
00167     DWFFileInputStream( const DWFFileInputStream& );
00168     DWFFileInputStream& operator=( const DWFFileInputStream& );
00169 };
00170 
00171 }
00172 
00173 
00174 
00175 #endif

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