|
jaffarCommon
|
#include <file.hpp>
Public Member Functions | |
| __JAFFAR_COMMON__INLINE__ MemoryFile * | fopen (const std::string filename, const std::string mode) |
| int | fclose (MemoryFile *const file) |
| int | fdestroy (const std::string &filename) |
| bool | contains (const std::string &filename) const |
| int64_t | getFileSize (const std::string &filename) const |
| uint8_t * | getFileBuffer (const std::string &filename) const |
This class defines a directory on which files can be created, opened, closed and re-opened later. The file's lifetime is that of the directory itself, unless purposefully destroyed.
|
inline |
Checks if the directory contains the given file
| [in] | filename | The name of the file to check for |
|
inline |
Closes the provided file
| [in] | file | The file to close |
|
inline |
Forcibly destroys a file by name (similar to rm)
| filename | Name of the file to delete from the directory |
|
inline |
Opens a file The behaviour imitates that of the POSIX fopen, including mode. However, it also adds the size argument for the creation of new files. Appending mode is not supported as this assumes the buffer will increase, which is not currently possible for mem buffers
| [in] | filename | The file of the name to open |
| [in] | mode | The opening mode (r,w,a,+) |
|
inline |
Retrieves a file's internal buffer
| [in] | filename | The name of the file to get the internal buffer from |
|
inline |
Retrieves a file's size
| [in] | filename | The name of the file to check size for |