win32/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_WIN32_H
00024 #define _DWFCORE_STANDARD_FILE_DESCRIPTOR_WIN32_H
00025 
00026 #include "dwfcore/Core.h"
00027 #include "dwfcore/String.h"
00028 #include "dwfcore/FileDescriptor.h"
00029 
00030 
00040 
00041 
00042 #ifdef  _DWFCORE_WIN32_SYSTEM
00043 
00044 
00045 namespace DWFCore
00046 {
00047 
00055 class DWFStandardFileDescriptor : virtual public DWFCoreMemory
00056                                 , public DWFFileDescriptor
00057 {
00058 
00059 public:
00060 
00061 
00075     _DWFCORE_API 
00076     DWFStandardFileDescriptor( DWFFile&                 rFile,
00077                                DWORD                    dwDesiredAccess,
00078                                DWORD                    dwShareMode,
00079                                LPSECURITY_ATTRIBUTES    pSecurityAttributes,
00080                                DWORD                    dwCreationDisposition,
00081                                DWORD                    dwFlagsAndAttributes )
00082         throw();
00083 
00093     _DWFCORE_API 
00094     DWFStandardFileDescriptor( DWFFile& rFile,
00095                                HANDLE   hFile )
00096         throw();
00097 
00103     _DWFCORE_API 
00104     virtual ~DWFStandardFileDescriptor()
00105         throw();
00106 
00110     _DWFCORE_API 
00111     void open()
00112         throw( DWFException );
00113 
00117     _DWFCORE_API 
00118     void close()
00119         throw( DWFException );
00120 
00124     _DWFCORE_API 
00125     size_t size()
00126         throw( DWFException );
00127 
00140     _DWFCORE_API 
00141     size_t read( void* pBuffer, size_t nBytesToRead )
00142         throw( DWFException );
00143 
00153     _DWFCORE_API 
00154     off_t seek( int eOrigin, off_t nOffset )
00155         throw( DWFException );
00156 
00168     _DWFCORE_API 
00169     size_t write( const void* pBuffer, size_t nBytesToWrite )
00170         throw( DWFException );
00171 
00178     _DWFCORE_API 
00179     void flush()
00180     {
00181         ; // NOP
00182     }
00183 
00184 private:
00185 
00186     HANDLE                  _hFile;
00187     DWORD                   _dwDesiredAccess;
00188     DWORD                   _dwShareMode;
00189     DWORD                   _dwCreationDisposition;
00190     DWORD                   _dwFlagsAndAttributes;
00191     LPSECURITY_ATTRIBUTES   _pSecurityAttributes;
00192 
00193 private:
00194 
00195     //
00196     // Unimplemented Methods
00197     //
00198 
00199     DWFStandardFileDescriptor( const DWFStandardFileDescriptor& );
00200     DWFStandardFileDescriptor& operator=( const DWFStandardFileDescriptor& );
00201 };
00202 
00203 }
00204 
00205 
00206 #else
00207 #error  This is a Win32 header file and is incompatible with your current system configuration
00208 #endif 
00209 
00210 #endif

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