Name | Description |
---|---|
Geo::GeoFileManager | The file manager deals with locating resources given a path and a filename. |
Name | Description |
---|---|
GeoFSeekOrigin | To avoid pulling in the entire stdio header, use our own values for GeoFSeek. |
Name | Description |
---|---|
void(* FileOpenCallback)(const char *path, const char *mode) | path: path to the file being opened. |
__int64 offset_t | A offset type, similar to size_t (off_t is not supported on all used platforms) |
Name | Description |
---|---|
FileExists(const char *) | Checks that testFile exists. |
FileExistsAndIsNewer(const char *, const char *) | Checks that testFile exists and is newer than exemplarFile. |
FileIsWritable(const char *) | Checks that the file named filename can be written to. |
FreeLoadedFile(void *) | Free a previously loaded file. |
GeoConstructAPIFilename(const char *, char *) | Construct a filename for use in the underlying platform filesystem API. |
GeoDeleteFile(const char *) | Delete a file. |
GeoDirectoryCreate(const char *) | Creates a directory and all the directories leading up to it. |
GeoDirectoryDelete(const char *) | Delete a directory and all its files, without user prompts. |
GeoFClose(FILE *) | A safe alternative to fclose. |
GeoFEof(FILE *) | A safe alternative to feof. |
GeoFError(FILE *) | A safe alternative to ferror. Returns a non-zero value to indicate an error. |
GeoFOpen(const char *, const char *) | GeoFOpen. |
GeoFRead(void *, size_t, size_t, FILE *) | A safe alternative to fread. |
GeoFSeek(offset_t, GeoFSeekOrigin, FILE *) | A safe alternative to fseek. |
GeoFTell(FILE *) | A safe alternative to ftell. |
GeoFWrite(const void *, size_t, size_t, FILE *) | A safe alternative to fwrite. |
GeoRenameFile(const char *, const char *) | Rename a file. |
GetFileSystemPrefix() | Get the previously set file system prefix for the current platform. |
InvokeFileOpenCallback(const char *, const char *) | Invoke the file open callback, if set. |
LoadFile(const char *, u32 &, u32, u32) | A safe alternative to ferror. |
LoadFileStr(const char *, u32 &, u32) | Load a file and append a null terminator. |
SaveFile(const char *, const void *, u32) | Save a file. |
SetFileOpenCallback(FileOpenCallback) | Set the function to be called when a file is opened, or a null pointer to disable the callback. |
SetFileSystemPrefix(const char *) | Set a file system prefix for the current platform. |
public: enum GeoFSeekOrigin
{
GEO_SEEK_SET = 0,
GEO_SEEK_CUR = 1,
GEO_SEEK_END = 2
}
To avoid pulling in the entire stdio header, use our own values for GeoFSeek.
GEO_SEEK_SET | Seek from beginning of file (SEEK_SET) |
GEO_SEEK_CUR | Seek from current position (SEEK_CUR) |
GEO_SEEK_END | Seek from end of file (SEEK_END) |
public: bool GEO_CALL FileExists
(
const char * testFile
)
Checks that testFile exists.
public: bool GEO_CALL FileExistsAndIsNewer
(
const char * testFile,
const char * exemplarFile
)
Checks that testFile exists and is newer than exemplarFile.
Returns true iff both files exist and the testFile has been modified more recently than exemplarFile.
public: bool GEO_CALL FileIsWritable
(
const char * filename
)
Checks that the file named filename can be written to.
Returns true for a writable existing file, or if a file with that name could be created.
public: void GEO_CALL FreeLoadedFile
(
void * file
)
Free a previously loaded file.
public: bool GeoConstructAPIFilename
(
const char * inFilename,
char * outFilename
)
Construct a filename for use in the underlying platform filesystem API.
public: bool GeoDeleteFile
(
const char * filename
)
Delete a file.
public: bool GEO_CALL GeoDirectoryCreate
(
const char * directory
)
Creates a directory and all the directories leading up to it.
Used often in the pipeline tools
Does nothing (and returns false) on a console |
public: bool GEO_CALL GeoDirectoryDelete
(
const char * directory
)
Delete a directory and all its files, without user prompts.
Used on occasion in the pipeline tools, though it is dangerous to act like this without user permission!
Does nothing (and returns false) on a console |
public: int GEO_CALL GeoFClose
(
FILE * stream
)
A safe alternative to fclose.
public: int GEO_CALL GeoFEof
(
FILE * stream
)
A safe alternative to feof.
public: Geo::s32GEO_CALL GeoFError
(
FILE * file
)
A safe alternative to ferror. Returns a non-zero value to indicate an error.
public: FILE *GEO_CALL GeoFOpen
(
const char * filename,
const char * mode
)
GeoFOpen.
Calls the operating system's fopen() method, and returns a FILE* in the usual fashion, however it takes account of any local system convension for file paths, and transparently manages these behind the scenes.
public: size_t GEO_CALL GeoFRead
(
void * input,
size_t size,
size_t count,
FILE * file
)
A safe alternative to fread.
This guarantees (unless there is an error) to load the entire data. If the number returned does not match the count specified for input, there was a file IO problem.
public: int GEO_CALL GeoFSeek
(
offset_t offset,
GeoFSeekOrigin origin,
FILE * file
)
A safe alternative to fseek.
public: offset_t GEO_CALL GeoFTell
(
FILE * file
)
A safe alternative to ftell.
public: size_t GEO_CALL GeoFWrite
(
const void * output,
size_t size,
size_t count,
FILE * file
)
A safe alternative to fwrite.
public: bool GEO_CALL GeoRenameFile
(
const char * oldName,
const char * newName
)
Rename a file.
public: const char *GEO_CALL GetFileSystemPrefix()
Get the previously set file system prefix for the current platform.
public: void InvokeFileOpenCallback
(
const char * path,
const char * mode
)
Invoke the file open callback, if set.
public: void *GEO_CALL LoadFile
(
const char * filename,
u32 & length,
u32 align,
u32 extra_alloc
)
A safe alternative to ferror.
Load a file returns 0 if this fails the loaded file must be freed using FreeLoadedFile
public: char *GEO_CALL LoadFileStr
(
const char * filename,
u32 & length,
u32 align
)
Load a file and append a null terminator.
The loaded file must be freed using FreeLoadedFile.
Null if this fails
public: bool GEO_CALL SaveFile
(
const char * filename,
const void * data,
u32 length
)
Save a file.
False if this fails.
public: void SetFileOpenCallback
(
FileOpenCallback callback
)
Set the function to be called when a file is opened, or a null pointer to disable the callback.
This has no effect unless GEO_DEVEL is defined!
public: void GEO_CALL SetFileSystemPrefix
(
const char * prefix
)
Set a file system prefix for the current platform.
For example, "/app_home" then GeoFOpen "/filename" will open e.g. "/app_home/filename"