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
30 class DLL_PREFIX FILEIO
39 static bool IsFileExisting(const _TCHAR *file_path);
40 static bool IsFileProtected(const _TCHAR *file_path);
41 static bool RemoveFile(const _TCHAR *file_path);
42 static bool RenameFile(const _TCHAR *existing_file_path, const _TCHAR *new_file_path);
44 bool Fopen(const _TCHAR *file_path, int mode);
46 bool IsOpened() { return (fp != NULL); }
47 uint32_t FileLength();
50 void FputBool(bool val);
52 void FputUint8(uint8_t val);
53 uint16_t FgetUint16();
54 void FputUint16(uint16_t val);
55 uint32_t FgetUint32();
56 void FputUint32(uint32_t val);
57 uint64_t FgetUint64();
58 void FputUint64(uint64_t val);
60 void FputInt8(int8_t val);
62 void FputInt16(int16_t val);
64 void FputInt32(int32_t val);
66 void FputInt64(int64_t val);
68 void FputFloat(float val);
70 void FputDouble(double val);
72 uint16_t FgetUint16_LE();
73 void FputUint16_LE(uint16_t val);
74 uint32_t FgetUint32_LE();
75 void FputUint32_LE(uint32_t val);
76 uint64_t FgetUint64_LE();
77 void FputUint64_LE(uint64_t val);
78 int16_t FgetInt16_LE();
79 void FputInt16_LE(int16_t val);
80 int32_t FgetInt32_LE();
81 void FputInt32_LE(int32_t val);
82 int64_t FgetInt64_LE();
83 void FputInt64_LE(int64_t val);
85 uint16_t FgetUint16_BE();
86 void FputUint16_BE(uint16_t val);
87 uint32_t FgetUint32_BE();
88 void FputUint32_BE(uint32_t val);
89 uint64_t FgetUint64_BE();
90 void FputUint64_BE(uint64_t val);
91 int16_t FgetInt16_BE();
92 void FputInt16_BE(int16_t val);
93 int32_t FgetInt32_BE();
94 void FputInt32_BE(int32_t val);
95 int64_t FgetInt64_BE();
96 void FputInt64_BE(int64_t val);
100 char *Fgets(char *str, int n);
101 int Fprintf(const char* format, ...);
103 uint32_t Fread(void* buffer, uint32_t size, uint32_t count);
104 uint32_t Fwrite(void* buffer, uint32_t size, uint32_t count);
105 uint32_t Fseek(long offset, int origin);