00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef TEKFILE_H_AF7D74D2_DB02_11D9_9782_000BDBC434D9
00022 #define TEKFILE_H_AF7D74D2_DB02_11D9_9782_000BDBC434D9
00023
00024 #ifndef TEKLTI_H_C35A2A4C_D475_11D9_90BC_000BDBC434D9
00025 #error This file must be included from <teklti.h>
00026 #endif
00027
00028
00029 TEKUUIDIMPORT(UTekFile);
00030
00031
00032 enum TekFileType
00033 {
00034 TekFileType_Binary = 0x0000,
00035 TekFileType_ASCII = 0x0001,
00036 TekFileType_ConfigASCII = 0x0002,
00037 TekFileType_UNICODE = 0x0004,
00038 TekFileType_ConfigUNICODE = 0x0008,
00039 TekFileType_BinaryPipe = 0x0010,
00040 TekFileType_ASCIIPipe = 0x0020,
00041 TekFileType_UnicodePipe = 0x0040,
00042 TekFileType_BZIP2 = 0x0100,
00043 TekFileType_BZIP2_ASCII = 0x0200
00044
00045 };
00046
00047 #define TekFileType_UserDefined TekFileType_Binary
00048
00049 enum TekFileMode
00050 {
00051 TekFileMode_ReadOnly = 0x0000,
00052 TekFileMode_WriteOnly = 0x0001,
00053 TekFileMode_Append = 0x0002,
00054 TekFileMode_ReadWrite = 0x0004,
00055 TekFileMode_ReadWriteTrunc = 0x0008,
00056 TekFileMode_ReadAppend = 0x0010
00057 };
00058
00059
00060
00061
00062
00063
00064
00065
00066
00067
00068
00069
00070
00071
00072
00073 #define TEKFILESEEK_BEGIN 0
00074 #define TEKFILESEEK_CURRENT 1
00075 #define TEKFILESEEK_END 2
00076
00077 enum TekFileSeek
00078 {
00079 TekFileSeek_Begin = 0x0000,
00080 TekFileSeek_Current = 0x0001,
00081 TekFileSeek_End = 0x0002
00082 };
00083
00084
00085
00086
00087
00088
00089 #ifdef USE_386_ASM
00090 extern const char TekFileBinary_ReadOnly[];
00091 extern const char TekFileBinary_WriteOnly[];
00092 extern const char TekFileBinary_Append[];
00093 extern const char TekFileBinary_ReadWrite[];
00094 extern const char TekFileBinary_ReadWriteTrunc[];
00095 extern const char TekFileBinary_ReadAppend[];
00096 #endif
00097
00098
00099
00108 class TekFile : public TekStd
00109 {
00110 public:
00114 TekFile();
00115
00119 ~TekFile();
00120
00121 #ifndef TEKFILE_INTERNAL
00122 virtual TEKERR get_FILE(FILE ** FileDescriptor) = 0;
00123 virtual TEKERR get_Filename(uchar_t ** Name) = 0;
00124 virtual TEKERR get_Mode(TekFileMode * ModeID) = 0;
00125 virtual TEKERR get_Type(TekFileType * FileTypePointer) = 0;
00126 virtual TEKERR put_FILE(FILE * FileDescriptor) = 0;
00127 virtual TEKERR put_Filename(uchar_t * Name) = 0;
00128 virtual TEKERR put_Mode(TekFileMode ModeID) = 0;
00129
00130 virtual TEKERR Close() = 0;
00131 virtual TEKERR Flush() = 0;
00132 virtual TEKERR Open() = 0;
00133 virtual TEKERR Open64() = 0;
00134 virtual TEKERR Read64(
00135 void * Buffer,
00136 uint64_t BytesToRead,
00137 uint64_t * BytesRead
00138 ) = 0;
00139 virtual TEKERR Read(
00140 void * Buffer,
00141 unsigned long BytesToRead,
00142 unsigned long * BytesRead
00143 ) = 0;
00144 virtual TEKERR Seek64(TekFileSeek SeekWhere, int64_t NewLocation) = 0;
00145 virtual TEKERR Seek(TekFileSeek SeekWhere, signed long NewLocation) = 0;
00146 virtual TEKERR Write64(
00147 void * Buffer,
00148 uint64_t BytesToWrite,
00149 uint64_t * BytesWrote
00150 ) = 0;
00151 virtual TEKERR Write(
00152 void * Buffer,
00153 unsigned long BytesToWrite,
00154 unsigned long * BytesWrote
00155 ) = 0;
00156 virtual TEKERR get_Location(unsigned long * Location) = 0;
00157 virtual TEKERR get_Location64(uint64_t * Location) = 0;
00158 #endif
00159
00165
00166 TEKSTD_HEADER_VARS;
00167 };
00168
00169
00170
00171
00172
00173
00174
00175
00176 TEKLTI_DECLSPEC TEKERR TekFileCreate(TekFileType FileType, TekFile ** RetVal, uchar_t * FileName = (uchar_t *)NULL);
00177
00178 #endif
00179
00180