72 bool IsEOF(
void)
const;
75 int Read(
void * a_Buffer,
size_t a_NumBytes);
81 int Write(
const void * a_Buffer,
size_t a_NumBytes);
84 long Seek (
int iPosition);
87 long Tell (
void)
const;
166 int Printf(
const char * a_Fmt, fmt::ArgList);
167 FMT_VARIADIC(
int,
Printf,
const char *)
static bool Exists(const AString &a_FileName)
Returns true if the file specified exists.
static bool DeleteFolderContents(const AString &a_FolderName)
Deletes all content from the specified folder.
static AString GetPathSeparator(void)
Returns the path separator used by the current platform.
static bool Delete(const AString &a_Path)
Deletes a file or a folder, returns true if successful.
static bool Rename(const AString &a_OrigPath, const AString &a_NewPath)
Renames a file or folder, returns true if successful.
long Tell(void) const
Returns the current position (bytes from file start) or -1 for failure; asserts if not open...
static bool Copy(const AString &a_SrcFileName, const AString &a_DstFileName)
Copies a file, returns true if successful.
static AString GetExecutableExt(void)
Returns the customary executable extension used by the current platform.
long GetSize(void) const
Returns the size of file, in bytes, or -1 for failure; asserts if not open.
static bool CreateFolder(const AString &a_FolderPath)
Creates a new folder with the specified name.
static AString ReadWholeFile(const AString &a_FileName)
Returns the entire contents of the specified file as a string.
int Printf(const char *a_Fmt, fmt::ArgList)
static char PathSeparator()
int ReadRestOfFile(AString &a_Contents)
Reads the file from current position till EOF into an AString; returns the number of bytes read or -1...
std::vector< AString > AStringVector
static bool IsFile(const AString &a_Path)
Returns true if the specified path is a regular file.
bool Open(const AString &iFileName, eMode iMode)
long Seek(int iPosition)
Seeks to iPosition bytes from file start, returns old position or -1 for failure; asserts if not open...
static bool DeleteFolder(const AString &a_FolderName)
Deletes a folder, returns true if successful.
static bool IsFolder(const AString &a_Path)
Returns true if the specified path is a folder.
static bool CreateFolderRecursive(const AString &a_FolderPath)
Creates a new folder with the specified name, creating its parents if needed.
static AStringVector GetFolderContents(const AString &a_Folder)
Returns the list of all items in the specified folder (files, folders, nix pipes, whatever's there)...
void Flush(void)
Flushes all the bufferef output into the file (only when writing)
int Write(const void *a_Buffer, size_t a_NumBytes)
Writes up to a_NumBytes bytes from a_Buffer, returns the number of bytes actually written...
eMode
The mode in which to open the file.
int Read(void *a_Buffer, size_t a_NumBytes)
Reads up to a_NumBytes bytes into a_Buffer, returns the number of bytes actually read, or -1 on failure; asserts if not open.
cFile(void)
Simple constructor - creates an unopened file object, use Open() to open / create a real file...
static bool DeleteFile(const AString &a_FileName)
Deletes a file, returns true if successful.
static unsigned GetLastModificationTime(const AString &a_FileName)
Returns the last modification time (in current timezone) of the specified file.
static AString ChangeFileExt(const AString &a_FileName, const AString &a_NewExt)
Returns a_FileName with its extension changed to a_NewExt.
~cFile()
Auto-closes the file, if open.