Public Member Functions | Private Member Functions | Private Attributes
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:
Inheritance graph
[legend]

List of all members.

Public Member Functions

 FileSystemLayer (const Ogre::String &subdir)
 Creates a concrete platform-dependent implementation of FileSystemLayer.
bool createDirectory (const Ogre::String &name)
 Create a directory.
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, void *)
void operator delete (void *ptr, const char *, int, const char *)
void operator delete[] (void *ptr)
void operator delete[] (void *ptr, const char *, int, const char *)
void * operator new (size_t sz, const char *file, int line, const char *func)
 operator new, with debug line info
void * operator new (size_t sz)
void * operator new (size_t sz, void *ptr)
 placement operator new
void * operator new[] (size_t sz, const char *file, int line, const char *func)
 array operator new, with debug line info
void * operator new[] (size_t sz)
void setConfigPaths (const Ogre::StringVector &paths)
void setHomePath (const Ogre::String &path)

Private Member Functions

bool fileExists (const Ogre::String &path) const
 Test if the given file exists.
void getConfigPaths ()
 Determine config search paths.
void prepareUserHome (const Ogre::String &subdir)
 Create an Ogre directory and the given subdir in the user's home.

Private Attributes

Ogre::StringVector mConfigPaths
Ogre::String mHomePath

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.

Definition at line 49 of file OgreFileSystemLayer.h.


Constructor & Destructor Documentation

Creates a concrete platform-dependent implementation of FileSystemLayer.

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

Definition at line 57 of file OgreFileSystemLayer.h.


Member Function Documentation

Create a directory.

bool Ogre::FileSystemLayer::fileExists ( const Ogre::String path) const [private]

Test if the given file exists.

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.

Definition at line 74 of file OgreFileSystemLayer.h.

References OGRE_BUILD_SUFFIX.

Determine config search paths.

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.

Definition at line 110 of file OgreFileSystemLayer.h.

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

Definition at line 96 of file OgreMemoryAllocatedObject.h.

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

Definition at line 102 of file OgreMemoryAllocatedObject.h.

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

Definition at line 108 of file OgreMemoryAllocatedObject.h.

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

Definition at line 113 of file OgreMemoryAllocatedObject.h.

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

Definition at line 119 of file OgreMemoryAllocatedObject.h.

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

operator new, with debug line info

Definition at line 68 of file OgreMemoryAllocatedObject.h.

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

Definition at line 73 of file OgreMemoryAllocatedObject.h.

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

placement operator new

Definition at line 79 of file OgreMemoryAllocatedObject.h.

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

array operator new, with debug line info

Definition at line 86 of file OgreMemoryAllocatedObject.h.

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

Definition at line 91 of file OgreMemoryAllocatedObject.h.

void Ogre::FileSystemLayer::prepareUserHome ( const Ogre::String subdir) [private]

Create an Ogre directory and the given subdir in the user's home.

Definition at line 115 of file OgreFileSystemLayer.h.

Definition at line 119 of file OgreFileSystemLayer.h.


Member Data Documentation

Definition at line 127 of file OgreFileSystemLayer.h.

Definition at line 128 of file OgreFileSystemLayer.h.


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

Copyright © 2012 Torus Knot Software Ltd
Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.
Last modified Mon Jul 27 2020 13:41:02