#include <gauge3d/osabstraction/filesystem.h>
Public Types | |
enum | tOpenFlags { READ = 1 << 0, WRITE = 1 << 1, CREATE = 1 << 2, NOREPLACE = 1 << 3, TRUNCATE = 1 << 4, APPEND = 1 << 5 } |
Flags used in the Open() function. More... | |
enum | tSeekType { BEGINNING, CURRENT, END } |
Flags for the Seek() function. More... | |
Static Public Methods | |
Initialization | |
void | Init (GString progName) |
Initialize the filesystem. More... | |
void | ShutDown () |
Shuts down and cleans up the filesystem. More... | |
Directory Structure | |
GString | WorkingDir () |
Get the currend working directory. | |
GString | ConfigDir () |
Get the directory where config files should be placed. | |
GString | ResourceDir () |
Get the location of the program's resources. | |
GString | PluginDir () |
Get the location of GAUGE plugins. | |
Stream-based File Access | |
File* | Open (GString filename,int flags) |
Open a file. More... | |
int | Read (File *file,void *target,int size) |
Read from a file. More... | |
int | Write (File *file,const void *source,int size) |
Write to a file. More... | |
void | Seek (File *file,int offset,tSeekType relativeTo) |
Seek the position of the stream. More... | |
int | TellPos (File *file) |
Get the position of the stream. More... | |
void | Close (File *file) |
Close the file. More... | |
Memmory Mapped File Access | |
FileMap* | Map (GString filename,int offset,int size,int flags) |
Map a file to memory. More... | |
void | UnMap (FileMap *map) |
Close a memory mapped file. More... | |
Other File Manipulation Functions | |
int | FileSize (GString filename) |
Get the size of a file. More... | |
int | FileSize (File *file) |
Get the size of an already open file. More... | |
bool | Exists (GString filename) |
Check if a file or directory exists. More... | |
void | DeleteFile (GString filename) |
Delete a file. More... | |
Directory Manipulation Functions | |
Directory* | OpenDirectory (GString dirName) |
Open a directory for listing. More... | |
bool | ReadDirectory (GString *filename,Directory *directory) |
Read the name of one object in the directory. More... | |
void | RewindDirectory (Directory *directory) |
Restart reading from the beginning of a directory. More... | |
void | CloseDirectory (Directory *directory) |
Close the directory. More... | |
void | CreateDirectory (GString dirname) |
Create a directory. More... | |
void | DeleteDirectory (GString dirname) |
Remove an empty directory. More... | |
void | DeleteTree (GString dirname) |
Recursively delete a directory and all of its contents. More... | |
bool | IsDirectory (GString dirname) |
Check if an object is a file or a directory. More... |
Do not use this class directly. Use the classes in the File Manipulation module instead.
This is a static class. All members are static. You do not need to instantiate it. So, if you want to open a file, you would say something like GFileSystem::Open("myfile.txt", GFileSystem::READ).
|
Flags used in the Open() function.
|
|
Flags for the Seek() function.
|
|
Initialize the filesystem.
|
|
Shuts down and cleans up the filesystem. Specifically, this function deletes the temporary directory and all of its contents. |
|
Open a file.
|
|
Read from a file.
|
|
Write to a file.
|
|
Seek the position of the stream.
|
|
Get the position of the stream.
|
|
Close the file.
|
|
Map a file to memory.
|
|
Close a memory mapped file. Call this when you are done with the file map. |
|
Get the size of a file.
|
|
Get the size of an already open file.
|
|
Check if a file or directory exists.
|
|
Delete a file.
|
|
Open a directory for listing.
|
|
Read the name of one object in the directory.
|
|
Restart reading from the beginning of a directory.
|
|
Close the directory.
|
|
Create a directory.
|
|
Remove an empty directory.
|
|
Recursively delete a directory and all of its contents.
|
|
Check if an object is a file or a directory.
|