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);
114 _TCHAR FgetTCHAR_LE();
115 void FputTCHAR_LE(_TCHAR val);
117 uint16_t FgetUint16_BE();
118 void FputUint16_BE(uint16_t val);
119 uint32_t FgetUint32_BE();
120 void FputUint32_BE(uint32_t val);
121 uint64_t FgetUint64_BE();
122 void FputUint64_BE(uint64_t val);
123 int16_t FgetInt16_BE();
124 void FputInt16_BE(int16_t val);
125 int32_t FgetInt32_BE();
126 void FputInt32_BE(int32_t val);
127 int64_t FgetInt64_BE();
128 void FputInt64_BE(int64_t val);
129 float FgetFloat_BE();
130 void FputFloat_BE(float val);
131 double FgetDouble_BE();
132 void FputDouble_BE(double val);
133 _TCHAR FgetTCHAR_BE();
134 void FputTCHAR_BE(_TCHAR val);
138 char *Fgets(char *str, int n);
139 _TCHAR *Fgetts(_TCHAR *str, int n);
140 int Fprintf(const char* format, ...);
141 int Ftprintf(const _TCHAR* format, ...);
143 size_t Fread(void* buffer, size_t size, size_t count);
144 size_t Fwrite(const void* buffer, size_t size, size_t count);
145 int Fseek(long offset, int origin);
147 bool Fcompare(const void* buffer, size_t size);
148 bool Fcompare(const void* buffer, size_t size, size_t count);
149 bool Fflush(); // Pls.Add 20181013 K.O
151 bool StateCheckUint32(uint32_t val);
152 bool StateCheckInt32(int32_t val);
153 bool StateCheckBuffer(const _TCHAR *buffer, size_t size, size_t count);
155 void StateValue(bool &val);
156 void StateValue(uint8_t &val);
157 void StateValue(uint16_t &val);
158 void StateValue(uint32_t &val);
159 void StateValue(uint64_t &val);
160 void StateValue(int8_t &val);
161 void StateValue(int16_t &val);
162 void StateValue(int32_t &val);
163 void StateValue(int64_t &val);
164 void StateValue(pair16_t &val);
165 void StateValue(pair32_t &val);
166 void StateValue(pair64_t &val);
167 void StateValue(float &val);
168 void StateValue(double &val);
169 void StateValue(_TCHAR &val);
170 void StateValueScrnType_t(scrntype_t &val);
172 void StateArray(bool *buffer, size_t size, size_t count);
173 void StateArray(uint8_t *buffer, size_t size, size_t count);
174 void StateArray(uint16_t *buffer, size_t size, size_t count);
175 void StateArray(uint32_t *buffer, size_t size, size_t count);
176 void StateArray(uint64_t *buffer, size_t size, size_t count);
177 void StateArray(int8_t *buffer, size_t size, size_t count);
178 void StateArray(int16_t *buffer, size_t size, size_t count);
179 void StateArray(int32_t *buffer, size_t size, size_t count);
180 void StateArray(int64_t *buffer, size_t size, size_t count);
181 void StateArray(pair16_t *buffer, size_t size, size_t count);
182 void StateArray(pair32_t *buffer, size_t size, size_t count);
183 void StateArray(pair64_t *buffer, size_t size, size_t count);
184 void StateArray(float *buffer, size_t size, size_t count);
185 void StateArray(double *buffer, size_t size, size_t count);
186 void StateArray(_TCHAR *buffer, size_t size, size_t count);
187 void StateArrayScrnType_t(scrntype_t *buffer, size_t size, size_t count);
190 void StateBuffer(void *buffer, size_t size, size_t count);