00001 /**** 00002 * \file fileraw.h <mi32/fileraw.h> 00003 * \brief Class FILE_RAW - Handle open files on supported platforms 00004 * 00005 * Implementation notes: 00006 * 00007 * This class is not thread safe. Most of the time the instance is specific to a 00008 * thread therefore the resource sharing issues are not involved. If this class is 00009 * a shared resource, it is up to the user of the class to guard it using the 00010 * appropriate locking method. 00011 * 00012 * \if NODOC 00013 * $Id: fileraw.h_v 1.20 2006/07/07 22:49:25 scowan Exp $ 00014 * 00015 * $Log: fileraw.h_v $ 00016 * Revision 1.20 2006/07/07 22:49:25 scowan 00017 * Make dtor virtual. 00018 * 00019 * Revision 1.19 2006/07/06 19:37:30 scowan 00020 * Added comments about network files to be open and sharing values. 00021 * 00022 * Revision 1.18 2005/07/20 14:17:07 mju 00023 * Moved share modes to fileaccess hdr. 00024 * 00025 * Revision 1.17 2005/07/19 17:41:25 mju 00026 * Moved access modes to fileaccess hdr. 00027 * 00028 * Revision 1.16 2004/03/05 16:46:11 mju 00029 * Exclude warning about non-virtual dtor. 00030 * 00031 * Revision 1.15 2003/09/25 21:29:07 dwilliss 00032 * Don't capitalize enum any more. Genitor needed it, doxygen doesn't like it. 00033 * 00034 * Revision 1.14 2003/09/15 13:49:56 fileserver!dwilliss 00035 * Doxygen 00036 * 00037 * Revision 1.13 2003/09/05 16:51:49 mju 00038 * Destructor should not be virtual, because we don't allow inheritance from FILE_RAW. 00039 * 00040 * Revision 1.12 2003/09/04 20:15:35 dwilliss 00041 * Destructor should be virtual 00042 * 00043 * Revision 1.11 2003/07/11 15:26:45 mju 00044 * Inherit from GENERICRW. 00045 * Eliminate error handler parms. 00046 * 00047 * Revision 1.10 2003/07/10 19:28:03 mju 00048 * Add IsWritable. 00049 * 00050 * Revision 1.9 2003/07/03 20:36:12 scowan 00051 * Support unix system calls. 00052 * 00053 * Revision 1.8 2002/12/11 18:26:27 scowan 00054 * undef class lib export at the end. 00055 * 00056 * Revision 1.7 2002/09/17 22:14:43 scowan 00057 * Moved forward declaration to non-documented area. 00058 * 00059 * Revision 1.6 2002/05/30 19:25:04 dwilliss 00060 * Needed to export class using silly Macintosh non-standard way too 00061 * 00062 * Revision 1.5 2002/05/01 22:04:14 mju 00063 * Change parms to private generateerr method. 00064 * 00065 * Revision 1.4 2001/12/24 16:36:36 scowan 00066 * Added methods. 00067 * 00068 * Revision 1.3 2001/07/18 17:22:00 scowan 00069 * Moved it back. 00070 * 00071 * Revision 1.2 2001/07/18 17:03:28 scowan 00072 * Moved seek from enum to stddefns. 00073 * 00074 * Revision 1.1 2000/08/03 13:14:43 mju 00075 * Initial revision 00076 * \endif 00077 ****/ 00078 00079 #ifndef INC_MI32_FILERAW_H 00080 #define INC_MI32_FILERAW_H 00081 00082 #ifndef INC_MI32_GENERICRW_H 00083 #include <mi32/genericrw.h> 00084 #endif 00085 00086 #ifndef INC_MI32_FILEACCESS_H 00087 #include <mi32/fileaccess.h> 00088 #endif 00089 00090 #ifdef MISYSTEMDLL 00091 #define CLASSLIBEXPORT MI_DLLCLASSEXPORT 00092 #else 00093 #define CLASSLIBEXPORT MI_DLLCLASSIMPORT 00094 #endif 00095 00096 #ifndef GENERATING_DOXYGEN_OUTPUT 00098 class FILE_RAW_PRIV; 00099 class FILEPATH; 00100 #endif 00101 00103 class CLASSLIBEXPORT FILE_RAW : public GENERICRW { 00104 public: 00105 00107 FILE_RAW ( 00108 ); 00109 00111 virtual ~FILE_RAW ( 00112 ); 00113 00115 void Close ( 00116 ); 00117 00120 bool GetPath ( 00121 FILEPATH& path 00122 ) const; 00123 00125 bool IsOpen ( 00126 ) const; 00127 00132 ERRVALUE Open ( 00133 const FILEPATH& filepath, 00134 FILE_ACCESS access = FILE_ACCESS_Read, 00135 FILE_SHARE share = FILE_SHARE_Any 00136 ); 00137 00138 private: 00139 #ifndef GENERATING_DOXYGEN_OUTPUT 00140 00142 FILE_RAW_PRIV *m_priv; 00143 00145 virtual CAPABILITIES v_GetCapabilities () const; 00146 virtual INT64 v_GetSize () const; 00147 virtual INT64 v_GetSizeLimit () const; 00148 virtual INT32 v_Read (void* buffer, INT32 numbytes, bool AllowPartial); 00149 virtual ERRVALUE v_Resize (INT64 newsize); 00150 virtual INT64 v_Seek (INT64 offset, SEEKFROM from); 00151 virtual INT64 v_Tell () const; 00152 virtual ERRVALUE v_Write (const void* buffer, INT32 numbytes); 00153 00154 FILE_RAW (const FILE_RAW&); 00155 FILE_RAW& operator= (const FILE_RAW&); 00156 00157 #endif 00158 }; 00159 00160 #undef CLASSLIBEXPORT 00161 #endif
1.6.1