2 Skelton for retropc emulator
4 Author : Takeda.Toshiya
16 #define FILEIO_READ_BINARY 1
17 #define FILEIO_WRITE_BINARY 2
18 #define FILEIO_READ_WRITE_BINARY 3
19 #define FILEIO_READ_WRITE_NEW_BINARY 4
20 #define FILEIO_READ_ASCII 5
21 #define FILEIO_WRITE_ASCII 6
22 #define FILEIO_READ_WRITE_ASCII 7
23 #define FILEIO_READ_WRITE_NEW_ASCII 8
24 #define FILEIO_WRITE_APPEND_ASCII 9
25 #define FILEIO_READ_WRITE_APPEND_ASCII 10
26 #define FILEIO_SEEK_SET 0
27 #define FILEIO_SEEK_CUR 1
28 #define FILEIO_SEEK_END 2
32 typedef struct gzFile_s *gzFile;
35 class DLL_PREFIX FILEIO
43 _TCHAR path[_MAX_PATH];
50 static bool IsFileExisting(const _TCHAR *file_path);
51 static bool IsFileProtected(const _TCHAR *file_path);
52 static bool RemoveFile(const _TCHAR *file_path);
53 static bool RenameFile(const _TCHAR *existing_file_path, const _TCHAR *new_file_path);
55 bool Fopen(const _TCHAR *file_path, int mode);
57 bool Gzopen(const _TCHAR *file_path, int mode);
69 const _TCHAR *FilePath()
76 void FputBool(bool val);
78 void FputUint8(uint8_t val);
79 uint16_t FgetUint16();
80 void FputUint16(uint16_t val);
81 uint32_t FgetUint32();
82 void FputUint32(uint32_t val);
83 uint64_t FgetUint64();
84 void FputUint64(uint64_t val);
86 void FputInt8(int8_t val);
88 void FputInt16(int16_t val);
90 void FputInt32(int32_t val);
92 void FputInt64(int64_t val);
94 void FputFloat(float val);
96 void FputDouble(double val);
98 uint16_t FgetUint16_LE();
99 void FputUint16_LE(uint16_t val);
100 uint32_t FgetUint32_LE();
101 void FputUint32_LE(uint32_t val);
102 uint64_t FgetUint64_LE();
103 void FputUint64_LE(uint64_t val);
104 int16_t FgetInt16_LE();
105 void FputInt16_LE(int16_t val);
106 int32_t FgetInt32_LE();
107 void FputInt32_LE(int32_t val);
108 int64_t FgetInt64_LE();
109 void FputInt64_LE(int64_t val);
110 float FgetFloat_LE();
111 void FputFloat_LE(float val);
112 double FgetDouble_LE();
113 void FputDouble_LE(double val);
115 uint16_t FgetUint16_BE();
116 void FputUint16_BE(uint16_t val);
117 uint32_t FgetUint32_BE();
118 void FputUint32_BE(uint32_t val);
119 uint64_t FgetUint64_BE();
120 void FputUint64_BE(uint64_t val);
121 int16_t FgetInt16_BE();
122 void FputInt16_BE(int16_t val);
123 int32_t FgetInt32_BE();
124 void FputInt32_BE(int32_t val);
125 int64_t FgetInt64_BE();
126 void FputInt64_BE(int64_t val);
127 float FgetFloat_BE();
128 void FputFloat_BE(float val);
129 double FgetDouble_BE();
130 void FputDouble_BE(double val);
134 char *Fgets(char *str, int n);
135 _TCHAR *Fgetts(_TCHAR *str, int n);
136 int Fprintf(const char* format, ...);
137 int Ftprintf(const _TCHAR* format, ...);
139 size_t Fread(void* buffer, size_t size, size_t count);
140 size_t Fwrite(const void* buffer, size_t size, size_t count);
141 int Fseek(long offset, int origin);
143 bool Fcompare(const void* buffer, size_t size);
144 bool Fcompare(const void* buffer, size_t size, size_t count);
146 bool StateCheckUint32(uint32_t val);
147 bool StateCheckInt32(int32_t val);
148 bool StateCheckBuffer(const void *buffer, size_t size, size_t count);
150 void StateBool(bool &val);
151 void StateUint8(uint8_t &val);
152 void StateUint16(uint16_t &val);
153 void StateUint32(uint32_t &val);
154 void StateUint64(uint64_t &val);
155 void StateInt8(int8_t &val);
156 void StateInt16(int16_t &val);
157 void StateInt32(int32_t &val);
158 void StateInt64(int64_t &val);
159 void StateFloat(float &val);
160 void StateDouble(double &val);
161 void StateBuffer(void *buffer, size_t size, size_t count);