StreamFileDescriptor.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_STREAM_FILE_DESCRIPTOR_H
00024 #define _DWFCORE_STREAM_FILE_DESCRIPTOR_H
00025 
00026 
00031 
00032 
00033 #include "dwfcore/String.h"
00034 #include "dwfcore/FileDescriptor.h"
00035 
00036 
00037 namespace DWFCore
00038 {
00039 
00051 class DWFStreamFileDescriptor : virtual public DWFCoreMemory
00052                               , public DWFFileDescriptor
00053 {
00054 
00055 public:
00056 
00065     _DWFCORE_API 
00066     DWFStreamFileDescriptor( const DWFFile&   rFile,
00067                              const DWFString& zStreamIOFlags )
00068         throw();
00069 
00075     _DWFCORE_API
00076     virtual ~DWFStreamFileDescriptor()
00077         throw();
00078 
00082     _DWFCORE_API 
00083     void open()
00084         throw( DWFException );
00085 
00089     _DWFCORE_API 
00090     void close()
00091         throw( DWFException );
00092 
00096     _DWFCORE_API 
00097     size_t size()
00098         throw( DWFException );
00099 
00112     _DWFCORE_API 
00113     size_t read( void* pBuffer, size_t nBytesToRead )
00114         throw( DWFException );
00115 
00125     _DWFCORE_API 
00126     off_t seek( int eOrigin, off_t nOffset )
00127         throw( DWFException );
00128 
00140     _DWFCORE_API 
00141     size_t write( const void* pBuffer, size_t nBytesToWrite )
00142         throw( DWFException );
00143 
00150     _DWFCORE_API 
00151     virtual void flush()
00152         throw( DWFException );
00153 
00154 private:
00155 
00156     FILE*       _fp;
00157     size_t      _nFilesize;
00158     DWFString   _zFlags;
00159 
00160 private:
00161 
00162     //
00163     // Unimplemented methods
00164     //
00165 
00166     DWFStreamFileDescriptor();
00167     DWFStreamFileDescriptor( const DWFStreamFileDescriptor& );
00168     DWFStreamFileDescriptor& operator=( const DWFStreamFileDescriptor& );
00169 };
00170 
00171 }
00172 
00173 
00174 #endif

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