FileDescriptor.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_DESCRIPTOR_H
00024 #define _DWFCORE_FILE_DESCRIPTOR_H
00025 
00030 
00031 #include "dwfcore/File.h"
00032 
00033 
00034 namespace DWFCore
00035 {
00036 
00047 class DWFFileDescriptor
00048 {
00049 
00050 public:
00051 
00059     _DWFCORE_API 
00060     DWFFileDescriptor( const DWFFile& rFile )
00061         throw() 
00062         : _oFile( rFile )
00063     {;}
00064 
00070     _DWFCORE_API
00071     virtual ~DWFFileDescriptor()
00072         throw()
00073     {;}
00074 
00081     _DWFCORE_API
00082     const DWFFile& file() const
00083         throw()
00084     {
00085         return _oFile;
00086     }
00087 
00094     _DWFCORE_API
00095     virtual void open()
00096         throw( DWFException ) = 0;
00097 
00104     _DWFCORE_API
00105     virtual void close()
00106         throw( DWFException ) = 0;
00107 
00115     _DWFCORE_API
00116     virtual size_t size()
00117         throw( DWFException ) = 0;
00118 
00134     _DWFCORE_API
00135     virtual size_t read( void* pBuffer, size_t nBytesToRead )
00136         throw( DWFException )
00137     {
00138         (void)pBuffer;
00139         (void)nBytesToRead;
00140 
00141         _DWFCORE_THROW( DWFNotImplementedException, /*NOXLATE*/L"Read operation not implemented for this descriptor" );
00142     }
00143 
00156     _DWFCORE_API
00157     virtual off_t seek( int eOrigin, off_t nOffset )
00158         throw( DWFException )
00159     {
00160         (void)eOrigin;
00161         (void)nOffset;
00162 
00163         _DWFCORE_THROW( DWFNotImplementedException, /*NOXLATE*/L"Seek operation not implemented for this descriptor" );
00164     }
00165 
00180     _DWFCORE_API 
00181     virtual size_t write( const void* pBuffer, size_t nBytesToWrite )
00182         throw( DWFException )
00183     {
00184         (void)pBuffer;
00185         (void)nBytesToWrite;
00186 
00187         _DWFCORE_THROW( DWFNotImplementedException, /*NOXLATE*/L"Write operation not implemented for this descriptor" );
00188     }
00189 
00199     _DWFCORE_API
00200     virtual void flush()
00201     {
00202         _DWFCORE_THROW( DWFNotImplementedException, /*NOXLATE*/L"Flush operation not implemented for this descriptor" );
00203     }
00204 
00205 protected:
00206 
00210     DWFFile     _oFile;
00211 
00212 private:
00213 
00214     //
00215     // Unimplemented methods
00216     //
00217 
00218     DWFFileDescriptor( const DWFFileDescriptor& );
00219     DWFFileDescriptor& operator=( const DWFFileDescriptor& );
00220 };
00221 
00222 
00223 }
00224 
00225 #endif
00226 
00227 

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