2019-05-24 17:58:32 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
class CFileMgr
|
|
|
|
{
|
2020-04-17 05:54:14 +00:00
|
|
|
static char ms_rootDirName[128];
|
|
|
|
static char ms_dirName[128];
|
2019-05-24 17:58:32 +00:00
|
|
|
public:
|
|
|
|
static void Initialise(void);
|
|
|
|
static void ChangeDir(const char *dir);
|
|
|
|
static void SetDir(const char *dir);
|
|
|
|
static void SetDirMyDocuments(void);
|
2020-12-21 20:26:32 +00:00
|
|
|
static ssize_t LoadFile(const char *file, uint8 *buf, int unused, const char *mode);
|
2019-05-24 17:58:32 +00:00
|
|
|
static int OpenFile(const char *file, const char *mode);
|
2020-06-27 21:01:51 +00:00
|
|
|
static int OpenFile(const char *file) { return OpenFile(file, "rb"); }
|
2019-05-24 17:58:32 +00:00
|
|
|
static int OpenFileForWriting(const char *file);
|
2020-12-21 20:26:32 +00:00
|
|
|
static size_t Read(int fd, const char *buf, ssize_t len);
|
|
|
|
static size_t Write(int fd, const char *buf, ssize_t len);
|
2019-05-24 17:58:32 +00:00
|
|
|
static bool Seek(int fd, int offset, int whence);
|
2019-06-28 19:24:22 +00:00
|
|
|
static bool ReadLine(int fd, char *buf, int len);
|
2019-06-12 23:12:37 +00:00
|
|
|
static int CloseFile(int fd);
|
2019-05-24 17:58:32 +00:00
|
|
|
static int GetErrorReadWrite(int fd);
|
2020-08-14 15:57:23 +00:00
|
|
|
static char *GetRootDirName() { return ms_rootDirName; }
|
2019-05-24 17:58:32 +00:00
|
|
|
};
|