OGRE 2.1
Object-Oriented Graphics Rendering Engine
Loading...
Searching...
No Matches
Ogre::FileSystemLayer Class Reference

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>

+ Inheritance diagram for Ogre::FileSystemLayer:

Public Member Functions

 FileSystemLayer (const Ogre::String &subdir)
 Creates a concrete platform-dependent implementation of FileSystemLayer.
 
const Ogre::String getConfigFilePath (Ogre::String filename) const
 Search for the given config file in the user's home path.
 
const Ogre::String getWritablePath (const Ogre::String &filename) const
 Find a path where the given filename can be written to.
 
void operator delete (void *ptr)
 
void operator delete (void *ptr, const char *, int, const char *)
 
void operator delete (void *ptr, void *)
 
void operator delete[] (void *ptr)
 
void operator delete[] (void *ptr, const char *, int, const char *)
 
voidoperator new (size_t sz)
 
voidoperator new (size_t sz, const char *file, int line, const char *func)
 operator new, with debug line info
 
voidoperator new (size_t sz, void *ptr)
 placement operator new
 
voidoperator new[] (size_t sz)
 
voidoperator new[] (size_t sz, const char *file, int line, const char *func)
 array operator new, with debug line info
 
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.
 
static bool fileExists (const Ogre::String &path)
 Test if the given file exists.
 
static bool removeDirectory (const Ogre::String &name)
 Delete a directory.
 
static bool removeFile (const Ogre::String &path)
 Delete a file.
 
static bool renameFile (const Ogre::String &oldpath, const Ogre::String &newpath)
 Rename a file.
 

Detailed Description

Provides methods to find out where the Ogre config files are stored and where logs and settings files should be written to.

Remarks
In modern multi-user OS, a standard user account will often not have write access to the path where the SampleBrowser 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. Specialised implementations for each individual platform must subclass this abstract interface. Implementation for the FileSystemLayer interface.

Constructor & Destructor Documentation

◆ FileSystemLayer()

Ogre::FileSystemLayer::FileSystemLayer ( const Ogre::String subdir)
inline

Creates a concrete platform-dependent implementation of FileSystemLayer.

Parameters
subdirA subdirectory inside the user's path to distinguish between different Ogre releases.

Member Function Documentation

◆ createDirectory()

static bool Ogre::FileSystemLayer::createDirectory ( const Ogre::String name)
static

Create a directory.

◆ fileExists()

static bool Ogre::FileSystemLayer::fileExists ( const Ogre::String path)
static

Test if the given file exists.

◆ getConfigFilePath()

const Ogre::String Ogre::FileSystemLayer::getConfigFilePath ( Ogre::String  filename) const
inline

Search for the given config file in the user's home path.

If it can't be found there, the function falls back to the system-wide install path for Ogre config files. (Usually the same place where the SampleBrowser resides, or a special config path above that path.)

Parameters
filenameThe config file name (without path)
Returns
The full path to the config file.

References OGRE_BUILD_SUFFIX.

◆ getWritablePath()

const Ogre::String Ogre::FileSystemLayer::getWritablePath ( const Ogre::String filename) const
inline

Find a path where the given filename can be written to.

This path will usually be in the user's home directory. This function should be used for any output like logs and graphics settings.

Parameters
filenameName of the file.
Returns
The full path to a writable location for the given filename.

◆ operator delete() [1/3]

template<class Alloc >
void Ogre::AllocatedObject< Alloc >::operator delete ( void ptr)
inlineinherited

◆ operator delete() [2/3]

template<class Alloc >
void Ogre::AllocatedObject< Alloc >::operator delete ( void ptr,
const char ,
int  ,
const char  
)
inlineinherited

◆ operator delete() [3/3]

template<class Alloc >
void Ogre::AllocatedObject< Alloc >::operator delete ( void ptr,
void  
)
inlineinherited

◆ operator delete[]() [1/2]

template<class Alloc >
void Ogre::AllocatedObject< Alloc >::operator delete[] ( void ptr)
inlineinherited

◆ operator delete[]() [2/2]

template<class Alloc >
void Ogre::AllocatedObject< Alloc >::operator delete[] ( void ptr,
const char ,
int  ,
const char  
)
inlineinherited

◆ operator new() [1/3]

template<class Alloc >
void * Ogre::AllocatedObject< Alloc >::operator new ( size_t  sz)
inlineinherited

◆ operator new() [2/3]

template<class Alloc >
void * Ogre::AllocatedObject< Alloc >::operator new ( size_t  sz,
const char file,
int  line,
const char func 
)
inlineinherited

operator new, with debug line info

◆ operator new() [3/3]

template<class Alloc >
void * Ogre::AllocatedObject< Alloc >::operator new ( size_t  sz,
void ptr 
)
inlineinherited

placement operator new

◆ operator new[]() [1/2]

template<class Alloc >
void * Ogre::AllocatedObject< Alloc >::operator new[] ( size_t  sz)
inlineinherited

◆ operator new[]() [2/2]

template<class Alloc >
void * Ogre::AllocatedObject< Alloc >::operator new[] ( size_t  sz,
const char file,
int  line,
const char func 
)
inlineinherited

array operator new, with debug line info

◆ removeDirectory()

static bool Ogre::FileSystemLayer::removeDirectory ( const Ogre::String name)
static

Delete a directory.

Should be empty

◆ removeFile()

static bool Ogre::FileSystemLayer::removeFile ( const Ogre::String path)
static

Delete a file.

◆ renameFile()

static bool Ogre::FileSystemLayer::renameFile ( const Ogre::String oldpath,
const Ogre::String newpath 
)
static

Rename a file.

◆ setConfigPaths()

void Ogre::FileSystemLayer::setConfigPaths ( const Ogre::StringVector paths)
inline

◆ setHomePath()

void Ogre::FileSystemLayer::setHomePath ( const Ogre::String path)
inline

The documentation for this class was generated from the following file: