00001 00018 #ifndef INC_MI32_FILELEGACY_H 00019 #define INC_MI32_FILELEGACY_H 00020 00021 #ifndef INC_MI32_STDDEFNS_H 00022 #include <mi32/stddefns.h> 00023 #endif 00024 00025 #ifndef INC_MI32_FILEACCESS_H 00026 #include <mi32/fileaccess.h> 00027 #endif 00028 00029 #ifndef INC_STDIO_H 00030 #include <stdio.h> 00031 #define INC_STDIO_H 00032 #endif 00033 00034 #ifdef MISYSTEMDLL 00035 #define CLASSLIBEXPORT MI_DLLCLASSEXPORT 00036 #else 00037 #define CLASSLIBEXPORT MI_DLLCLASSIMPORT 00038 #endif 00039 00040 #ifndef GENERATING_DOXYGEN_OUTPUT 00041 class FILEPATH; 00042 #endif 00043 00044 00047 class CLASSLIBEXPORT FILE_LEGACY_HANDLE { 00048 public: 00049 00051 FILE_LEGACY_HANDLE ( 00052 ); 00053 00055 ~FILE_LEGACY_HANDLE ( 00056 ); 00057 00059 operator int ( 00060 ) const { return (m_handle); } 00061 00063 void Close ( 00064 ); 00065 00067 int GetHandle ( 00068 ) const { return (m_handle); } 00069 00071 bool IsOpen ( 00072 ) const { return (m_handle >= 0); } 00073 00078 ERRVALUE Open ( 00079 const FILEPATH& filepath, 00080 FILE_ACCESS access = FILE_ACCESS_Read, 00081 FILE_SHARE share = FILE_SHARE_Auto 00082 ); 00083 00084 private: 00085 #ifndef GENERATING_DOXYGEN_OUTPUT 00086 int m_handle; 00087 00088 FILE_LEGACY_HANDLE (const FILE_LEGACY_HANDLE&); 00089 FILE_LEGACY_HANDLE& operator= (const FILE_LEGACY_HANDLE&); 00090 #endif // GENERATING_DOXYGEN_OUTPUT 00091 }; 00092 00093 00096 class CLASSLIBEXPORT FILE_LEGACY_STREAM { 00097 public: 00098 00099 enum TRANSLATION { 00100 TRANSLATION_None = 0, 00101 TRANSLATION_Text = 1 00102 }; 00103 00105 FILE_LEGACY_STREAM ( 00106 ); 00107 00109 ~FILE_LEGACY_STREAM ( 00110 ); 00111 00113 operator FILE* ( 00114 ) const { return (m_fp); } 00115 00117 void Close ( 00118 ); 00119 00121 FILE* GetFilePointer ( 00122 ) const { return (m_fp); } 00123 00125 bool IsOpen ( 00126 ) const { return (m_fp != 0); } 00127 00130 ERRVALUE Open ( 00131 const FILEPATH& filepath, 00132 TRANSLATION translation, 00133 FILE_ACCESS access = FILE_ACCESS_Read 00134 ); 00135 00136 private: 00137 #ifndef GENERATING_DOXYGEN_OUTPUT 00138 FILE *m_fp; 00139 00140 FILE_LEGACY_STREAM (const FILE_LEGACY_STREAM&); 00141 FILE_LEGACY_STREAM& operator= (const FILE_LEGACY_STREAM&); 00142 #endif // GENERATING_DOXYGEN_OUTPUT 00143 }; 00144 00145 00146 #undef CLASSLIBEXPORT 00147 00148 #endif // INC_MI32_FILELEGACY_H
1.6.1