ASGE
3.2.0
Simple Game Framework in GL
|
Classes | |
struct | IOBuffer |
struct | File |
Functions | |
bool | setWriteDir (const std::string &dir, bool mount) |
bool | createDir (const std::string &dir) |
void | printFiles (std::string &&dir) |
std::vector< std::string > | enumerateFiles (const std::string &dir) |
bool | mount (const std::string &dir, const std::string &mount_point) |
bool | deleteFile (const std::string &filename) |
input and output resource management
bool ASGE::FILEIO::createDir | ( | const std::string & | dir | ) |
Creates a subdirectory in the root of the write directory.
Will attempt to create a subdirectory inside the writeable root. Ensure that the FileIO subsystem is initialised and that a write directory is set (if not using the default).
[in] | dir | The directory to list. |
bool ASGE::FILEIO::deleteFile | ( | const std::string & | filename | ) |
Attempts to delete a file.
Deletes a file using the mounted pseudo-fs. Warning; make sure you specify the correct file for deletion.
[in] | filename | File to delete. |
std::vector<std::string> ASGE::FILEIO::enumerateFiles | ( | const std::string & | dir | ) |
Lists all files in a given directory.
Generates a list of strings representing each file in a given directory. The search is performed in the pseudo-filesystem and does not conform to the local directories.
[in] | dir | The directory to search. |
bool ASGE::FILEIO::mount | ( | const std::string & | dir, |
const std::string & | mount_point | ||
) |
Mounts a real directory into the pseudo-fs.
Mount a directory in the file system to reside within the pseudo-fs. All mount points exist below the root /data
[in] | dir | The directory to mount. |
[in] | mount_point | The mount point to reside below /data/ |
void ASGE::FILEIO::printFiles | ( | std::string && | dir | ) |
Prints files stored in a given directory using the ASGE file IO subsystem. This does not list files outside of the virtual mounted paths.
[in] | dir | The directory to list. |
bool ASGE::FILEIO::setWriteDir | ( | const std::string & | dir, |
bool | mount | ||
) |
Sets the base directory for saving files.
This directory will be used as the root for any files being written to or saved. For obvious reasons, you should look to use a directory different to the gamedata directory. If the folder does not exist or the file subsystem is not initialised then this will fail. The user must have read/write access to the directory for saving to work. It is recommended that the directory used is free of important files.
dir | The root directory for saving files. |