OGRE
1.12.13
Object-Oriented Graphics Rendering Engine
|
Provides methods to find out where the Ogre config files are stored and where logs and settings files should be written to. More...
#include <OgreFileSystemLayer.h>
Public Member Functions | |
FileSystemLayer (const Ogre::String &subdir) | |
Creates a concrete platform-dependent implementation of FileSystemLayer. More... | |
Ogre::String | getConfigFilePath (Ogre::String filename) const |
Search for the given config file in a set of predefined locations. More... | |
Ogre::String | getWritablePath (const Ogre::String &filename) const |
Find a path where the given filename can be written to. More... | |
void | setConfigPaths (const Ogre::StringVector &paths) |
void | setHomePath (const Ogre::String &path) |
Static Public Member Functions | |
static bool | createDirectory (const Ogre::String &name) |
Create a directory. More... | |
static bool | fileExists (const Ogre::String &path) |
Test if the given file exists. More... | |
static bool | removeDirectory (const Ogre::String &name) |
Delete a directory. More... | |
static bool | removeFile (const Ogre::String &path) |
Delete a file. More... | |
static bool | renameFile (const Ogre::String &oldpath, const Ogre::String &newpath) |
Rename a file. More... | |
static String | resolveBundlePath (String path) |
Resolve path inside the application bundle on some platforms Ogre is delivered as an application bundle this function resolves the given path such that it points inside that bundle. More... | |
Provides methods to find out where the Ogre config files are stored and where logs and settings files should be written to.
In modern multi-user OS, a standard user account will often not have write access to the path where the application is stored. In order to still be able to store graphics settings and log output and for the user to overwrite the default Ogre config files, this class tries to create a folder inside the user's home directory.
|
inline |
Creates a concrete platform-dependent implementation of FileSystemLayer.
subdir | A subdirectory inside the user's path to distinguish between different Ogre applications. |
|
inline |
Search for the given config file in a set of predefined locations.
The search order is
filename | The config file name (without path) |
|
inline |
Find a path where the given filename can be written to.
This path will usually be a subdirectory in the user's home directory. This function should be used for any output like logs and graphics settings.
Platform | Location |
---|---|
Windows | Documents/$subdir/ |
Linux | ~/.cache/$subdir/ |
OSX | ~/Library/Application Support/$subdir/ |
iOS | NSDocumentDirectory |
Android / Emscripten | n/a |
filename | Name of the file. |
|
inline |
|
inline |
Resolve path inside the application bundle on some platforms Ogre is delivered as an application bundle this function resolves the given path such that it points inside that bundle.
path |
|
static |
Create a directory.
|
static |
Delete a directory.
Should be empty
|
static |
Test if the given file exists.
|
static |
Delete a file.
|
static |
Rename a file.