87 static FileMgr *getSystemFileMgr();
88 static void setSystemFileMgr(
FileMgr *newFileMgr);
107 FileDesc *open(
const char *path,
int mode,
bool tryDowngrade);
108 FileDesc *
open(
const char *path,
unsigned int mode,
bool tryDowngrade) {
return this->
open(path, (
int)mode, tryDowngrade); }
118 FileDesc *
open(
const char *path,
unsigned int mode,
unsigned int perms = IREAD | IWRITE,
bool tryDowngrade =
false) {
return this->
open(path, (
int)mode, (
int)perms, tryDowngrade); }
119 FileDesc *open(
const char *path,
int mode,
int perms = IREAD | IWRITE,
bool tryDowngrade =
false);
129 virtual void flush();
137 static SWBuf getEnvValue(
const char *variableName);
146 static bool hasAccess(
const char *path,
int mode);
152 static signed char existsFile(
const char *ipath,
const char *ifileName = 0);
158 static signed char existsDir(
const char *ipath,
const char *idirName = 0);
169 static std::vector<struct DirEntry> getDirList(
const char *dirPath,
bool includeSize =
false,
bool includeIsDirectory =
true);
178 static char isDirectory(
const char *path);
179 static long getFileSize(
const char *path);
180 static int createParent(
const char *pName);
181 static int createPathAndFile(
const char *fName);
187 static int openFile(
const char *fName,
int mode,
int perms);
188 static int openFileReadOnly(
const char *fName);
189 static void closeFile(
int fd);
190 static long write(
int fd,
const void *buf,
long count);
192 static int copyFile(
const char *srcFile,
const char *destFile);
193 static int copyDir(
const char *srcDir,
const char *destDir);
194 static int removeDir(
const char *targetDir);
195 static int removeFile(
const char *fName);
224 FileDesc(
FileMgr * parent,
const char *path,
int mode,
int perms,
bool tryDowngrade);
233 fd = parent->sysOpen(
this);
239 long seek(
long offset,
int whence);
240 long read(
void *buf,
long count);
241 long write(
const void *buf,
long count);
#define SWORD_NAMESPACE_START
static unsigned int RDONLY
static unsigned int TRUNC
FileDesc * open(const char *path, unsigned int mode, unsigned int perms=IREAD|IWRITE, bool tryDowngrade=false)
FileDesc * open(const char *path, unsigned int mode, bool tryDowngrade)
virtual long resourceConsumption()
static unsigned int APPEND
SWORD_NAMESPACE_START class SWDLLEXPORT FileDesc
static long write(int fd, const void *buf, long count)
static unsigned int CREAT
static FileMgr * systemFileMgr
static unsigned int IWRITE
static unsigned int WRONLY
static unsigned int IREAD
#define SWORD_NAMESPACE_END