Static class which allows filesystem manipulation.
More...
#include <FileSystem.h>
|
static unsigned int | GetFileSize (const Ogre::String &path) |
| Retrieves a file size. More...
|
|
static bool | ReadFile (const Ogre::String &path, void *buffer, const unsigned int start, const unsigned int length) |
| Reads a file contents and saves them to a buffer. More...
|
|
static bool | WriteFile (const Ogre::String &path, const void *buffer, const unsigned int length) |
| Writes the contents of a buffer to a file. More...
|
|
static bool | WriteNewFile (const Ogre::String &path, const void *buffer, const unsigned int length) |
| Writes the contents of a buffer to new a file. More...
|
|
static bool | RemoveFile (const Ogre::String &path) |
| Deletes a file. More...
|
|
Static class which allows filesystem manipulation.
◆ FileSystem()
FileSystem::FileSystem |
( |
| ) |
|
|
delete |
◆ GetFileSize()
unsigned int FileSystem::GetFileSize |
( |
const Ogre::String & |
path | ) |
|
|
static |
Retrieves a file size.
- Parameters
-
[in] | path | Path to the file. |
- Returns
- File size, in bytes. 0 on error.
◆ ReadFile()
bool FileSystem::ReadFile |
( |
const Ogre::String & |
path, |
|
|
void * |
buffer, |
|
|
const unsigned int |
start, |
|
|
const unsigned int |
length |
|
) |
| |
|
static |
Reads a file contents and saves them to a buffer.
- Parameters
-
[in] | path | Path to the file to read. |
[out] | buffer | The buffer to populate with file data. |
[in] | start | Offset at which to start reading. |
[in] | length | Size of the data to read, in bytes. |
- Returns
- True if the file was successfully read, false on error.
◆ RemoveFile()
bool FileSystem::RemoveFile |
( |
const Ogre::String & |
path | ) |
|
|
static |
Deletes a file.
- Parameters
-
[in] | path | Path to the file to delete. |
- Returns
- True if the file was successfully deleted, false on error.
◆ WriteFile()
bool FileSystem::WriteFile |
( |
const Ogre::String & |
path, |
|
|
const void * |
buffer, |
|
|
const unsigned int |
length |
|
) |
| |
|
static |
Writes the contents of a buffer to a file.
The file must exists, and the new data will be appended at the end.
- Parameters
-
[in] | path | Path to the file to write. |
[in] | buffer | Buffer with the data. |
[in] | length | Size of the data to write, in bytes. |
- Returns
- True if the file was successfully written, false on error.
◆ WriteNewFile()
bool FileSystem::WriteNewFile |
( |
const Ogre::String & |
path, |
|
|
const void * |
buffer, |
|
|
const unsigned int |
length |
|
) |
| |
|
static |
Writes the contents of a buffer to new a file.
If the file exists, it will be deleted before adding the new data.
- Parameters
-
[in] | path | Path to the file to write. |
[in] | buffer | Buffer with the data. |
[in] | length | Size of the data to write, in bytes. |
- Returns
- True if the file was successfully written, false on error.
The documentation for this class was generated from the following files: