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];
49 static bool IsFileExisting(const _TCHAR *file_path);
50 static bool IsFileProtected(const _TCHAR *file_path);
51 static bool RemoveFile(const _TCHAR *file_path);
52 static bool RenameFile(const _TCHAR *existing_file_path, const _TCHAR *new_file_path);
54 bool Fopen(const _TCHAR *file_path, int mode);
56 bool Gzopen(const _TCHAR *file_path, int mode);
68 const _TCHAR *FilePath()
75 void FputBool(bool val);
77 void FputUint8(uint8_t val);
78 uint16_t FgetUint16();
79 void FputUint16(uint16_t val);
80 uint32_t FgetUint32();
81 void FputUint32(uint32_t val);
82 uint64_t FgetUint64();
83 void FputUint64(uint64_t val);
85 void FputInt8(int8_t val);
87 void FputInt16(int16_t val);
89 void FputInt32(int32_t val);
91 void FputInt64(int64_t val);
93 void FputFloat(float val);
95 void FputDouble(double val);
97 uint16_t FgetUint16_LE();
98 void FputUint16_LE(uint16_t val);
99 uint32_t FgetUint32_LE();
100 void FputUint32_LE(uint32_t val);
101 uint64_t FgetUint64_LE();
102 void FputUint64_LE(uint64_t val);
103 int16_t FgetInt16_LE();
104 void FputInt16_LE(int16_t val);
105 int32_t FgetInt32_LE();
106 void FputInt32_LE(int32_t val);
107 int64_t FgetInt64_LE();
108 void FputInt64_LE(int64_t val);
110 uint16_t FgetUint16_BE();
111 void FputUint16_BE(uint16_t val);
112 uint32_t FgetUint32_BE();
113 void FputUint32_BE(uint32_t val);
114 uint64_t FgetUint64_BE();
115 void FputUint64_BE(uint64_t val);
116 int16_t FgetInt16_BE();
117 void FputInt16_BE(int16_t val);
118 int32_t FgetInt32_BE();
119 void FputInt32_BE(int32_t val);
120 int64_t FgetInt64_BE();
121 void FputInt64_BE(int64_t val);
125 char *Fgets(char *str, int n);
126 _TCHAR *Fgetts(_TCHAR *str, int n);
127 int Fprintf(const char* format, ...);
128 int Ftprintf(const _TCHAR* format, ...);
130 size_t Fread(void* buffer, size_t size, size_t count);
131 size_t Fwrite(const void* buffer, size_t size, size_t count);
132 int Fseek(long offset, int origin);
134 bool Fcompare(const void* buffer, size_t size);