V-Gears 0
Free Final Fantasy VII engine.
FileSystem Class Reference

Static class which allows filesystem manipulation. More...

#include <FileSystem.h>

Public Member Functions

 FileSystem ()=delete
 Destructor. More...
 

Static Public Member Functions

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...
 

Detailed Description

Static class which allows filesystem manipulation.

Constructor & Destructor Documentation

◆ FileSystem()

FileSystem::FileSystem ( )
delete

Destructor.

Member Function Documentation

◆ GetFileSize()

unsigned int FileSystem::GetFileSize ( const Ogre::String &  path)
static

Retrieves a file size.

Parameters
[in]pathPath 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]pathPath to the file to read.
[out]bufferThe buffer to populate with file data.
[in]startOffset at which to start reading.
[in]lengthSize 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]pathPath 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]pathPath to the file to write.
[in]bufferBuffer with the data.
[in]lengthSize 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]pathPath to the file to write.
[in]bufferBuffer with the data.
[in]lengthSize 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: