ansi/StandardFileDescriptor.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_STANDARD_FILE_DESCRIPTOR_ANSI_H
00024 #define _DWFCORE_STANDARD_FILE_DESCRIPTOR_ANSI_H
00025 
00026 
00031 
00032 
00033 #include <fcntl.h>
00034 #include "dwfcore/String.h"
00035 #include "dwfcore/FileDescriptor.h"
00036 
00037 
00038 
00039 namespace DWFCore
00040 {
00041 
00042 //
00043 // Generic file descriptor implementation
00044 //
00045 class DWFStandardFileDescriptor : public DWFFileDescriptor
00046 {
00047 
00048 public:
00049 
00060     _DWFCORE_API
00061     DWFStandardFileDescriptor( DWFFile& rFile,
00062                                int      eIOFlags,
00063                                int      eIOMode )
00064         throw();
00065 
00075     _DWFCORE_API
00076     DWFStandardFileDescriptor( DWFFile& rFile,
00077                                int      iHandle )
00078         throw();
00079 
00085     _DWFCORE_API 
00086     virtual ~DWFStandardFileDescriptor()
00087         throw();
00088 
00092     _DWFCORE_API 
00093     void open()
00094         throw( DWFException );
00095 
00099     _DWFCORE_API 
00100     void close()
00101         throw( DWFException );
00102 
00106     _DWFCORE_API 
00107     size_t size()
00108         throw( DWFException );
00109 
00122     _DWFCORE_API 
00123     size_t read( void* pBuffer, size_t nBytesToRead )
00124         throw( DWFException );
00125 
00135     _DWFCORE_API 
00136     off_t seek( int eOrigin, off_t nOffset )
00137         throw( DWFException );
00138 
00150     _DWFCORE_API 
00151     size_t write( const void* pBuffer, size_t nBytesToWrite )
00152         throw( DWFException );
00153 
00160     _DWFCORE_API 
00161     void flush()
00162     {
00163         ; // NOP
00164     }
00165 
00166 
00167 private:
00168 
00169     int _iHandle;
00170     int _eIOFlags;
00171     int _eIOMode;
00172 
00173 private:
00174 
00175     //
00176     // Unimplemented Methods
00177     //
00178 
00179     DWFStandardFileDescriptor( const DWFStandardFileDescriptor& );
00180     DWFStandardFileDescriptor& operator=( const DWFStandardFileDescriptor& );
00181 };
00182 
00183 }
00184 
00185 
00186 #endif

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