RigsofRods
Soft-body Physics Simulation
Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes
SkyX::CfgFileManager Class Reference

Config file manager. More...

#include <SCfgFileManager.h>

+ Collaboration diagram for SkyX::CfgFileManager:

Public Member Functions

 CfgFileManager (SkyX *s, BasicController *c, Ogre::Camera *d)
 Constructor. More...
 
 ~CfgFileManager ()
 Destructor. More...
 
const bool load (const Ogre::String &File) const
 Load hydrax cfg file. More...
 
const bool save (const Ogre::String &File, const Ogre::String &Path="") const
 Save current hydrax config to a file. More...
 

Static Public Member Functions

static Ogre::String _getCfgString (const Ogre::String &Name, const int &Value)
 
static Ogre::String _getCfgString (const Ogre::String &Name, const Ogre::Real &Value)
 
static Ogre::String _getCfgString (const Ogre::String &Name, const bool &Value)
 
static Ogre::String _getCfgString (const Ogre::String &Name, const Ogre::Vector2 &Value)
 
static Ogre::String _getCfgString (const Ogre::String &Name, const Ogre::Vector3 &Value)
 
static Ogre::String _getCfgString (const Ogre::String &Name, const Ogre::Vector4 &Value)
 
static Ogre::String _getCfgString (const Ogre::String &Name, const Ogre::Degree &Value)
 
static int _getIntValue (Ogre::ConfigFile &CfgFile, const Ogre::String Name)
 Get int value. More...
 
static Ogre::Real _getFloatValue (Ogre::ConfigFile &CfgFile, const Ogre::String Name)
 Get float value. More...
 
static bool _getBoolValue (Ogre::ConfigFile &CfgFile, const Ogre::String Name)
 Get bool value. More...
 
static Ogre::Vector2 _getVector2Value (Ogre::ConfigFile &CfgFile, const Ogre::String Name)
 Get vector2 value. More...
 
static Ogre::Vector3 _getVector3Value (Ogre::ConfigFile &CfgFile, const Ogre::String Name)
 Get vector3 value. More...
 
static Ogre::Vector4 _getVector4Value (Ogre::ConfigFile &CfgFile, const Ogre::String Name)
 
static Ogre::Degree _getDegreeValue (Ogre::ConfigFile &CfgFile, const Ogre::String Name)
 
static bool _isStringInList (const Ogre::StringVector &List, const Ogre::String &Find)
 

Private Member Functions

const bool _saveToFile (const Ogre::String &Data, const Ogre::String &File, const Ogre::String &Path) const
 Save a string in file. More...
 
const void _loadCfgFile (const Ogre::String &File, std::pair< bool, Ogre::ConfigFile > &Result) const
 Load a cfg file in an Ogre::ConfigFile. More...
 
const Ogre::String _getVersionCfgString () const
 Get hydrax version cfg string. More...
 
const bool _checkVersion (Ogre::ConfigFile &CfgFile) const
 Check hydrax version cfg file. More...
 

Private Attributes

SkyXmSkyX
 Hydrax parent pointer. More...
 
BasicControllermController
 
Ogre::Camera * mCamera
 

Detailed Description

Config file manager.

Class to load/save all Hydrax options from/to a config file

Definition at line 40 of file SCfgFileManager.h.

Constructor & Destructor Documentation

◆ CfgFileManager()

SkyX::CfgFileManager::CfgFileManager ( SkyX s,
BasicController c,
Ogre::Camera *  d 
)

Constructor.

Parameters
hHydrax parent pointer

Definition at line 30 of file SCfgFileManager.cpp.

◆ ~CfgFileManager()

SkyX::CfgFileManager::~CfgFileManager ( )

Destructor.

Definition at line 35 of file SCfgFileManager.cpp.

Member Function Documentation

◆ _checkVersion()

const bool SkyX::CfgFileManager::_checkVersion ( Ogre::ConfigFile &  CfgFile) const
private

Check hydrax version cfg file.

Parameters
CfgFileConfig file
Returns
true if it's the same version, false if not.

Definition at line 230 of file SCfgFileManager.cpp.

+ Here is the caller graph for this function:

◆ _getBoolValue()

bool SkyX::CfgFileManager::_getBoolValue ( Ogre::ConfigFile &  CfgFile,
const Ogre::String  Name 
)
static

Get bool value.

Remarks
if the parameter isn't found or the data type is not a bool value, return false as default

Definition at line 278 of file SCfgFileManager.cpp.

+ Here is the caller graph for this function:

◆ _getCfgString() [1/7]

Ogre::String SkyX::CfgFileManager::_getCfgString ( const Ogre::String &  Name,
const bool &  Value 
)
static

Definition at line 181 of file SCfgFileManager.cpp.

◆ _getCfgString() [2/7]

Ogre::String SkyX::CfgFileManager::_getCfgString ( const Ogre::String &  Name,
const int &  Value 
)
static

Definition at line 171 of file SCfgFileManager.cpp.

◆ _getCfgString() [3/7]

Ogre::String SkyX::CfgFileManager::_getCfgString ( const Ogre::String &  Name,
const Ogre::Degree &  Value 
)
static

Definition at line 201 of file SCfgFileManager.cpp.

◆ _getCfgString() [4/7]

Ogre::String SkyX::CfgFileManager::_getCfgString ( const Ogre::String &  Name,
const Ogre::Real &  Value 
)
static

Definition at line 176 of file SCfgFileManager.cpp.

◆ _getCfgString() [5/7]

Ogre::String SkyX::CfgFileManager::_getCfgString ( const Ogre::String &  Name,
const Ogre::Vector2 &  Value 
)
static

Definition at line 186 of file SCfgFileManager.cpp.

◆ _getCfgString() [6/7]

Ogre::String SkyX::CfgFileManager::_getCfgString ( const Ogre::String &  Name,
const Ogre::Vector3 &  Value 
)
static

Definition at line 191 of file SCfgFileManager.cpp.

◆ _getCfgString() [7/7]

Ogre::String SkyX::CfgFileManager::_getCfgString ( const Ogre::String &  Name,
const Ogre::Vector4 &  Value 
)
static

Definition at line 196 of file SCfgFileManager.cpp.

◆ _getDegreeValue()

Ogre::Degree SkyX::CfgFileManager::_getDegreeValue ( Ogre::ConfigFile &  CfgFile,
const Ogre::String  Name 
)
static

Definition at line 342 of file SCfgFileManager.cpp.

+ Here is the caller graph for this function:

◆ _getFloatValue()

Ogre::Real SkyX::CfgFileManager::_getFloatValue ( Ogre::ConfigFile &  CfgFile,
const Ogre::String  Name 
)
static

Get float value.

Remarks
if the parameter isn't found or the data type is not a float value, return 0 as default

Definition at line 264 of file SCfgFileManager.cpp.

+ Here is the caller graph for this function:

◆ _getIntValue()

int SkyX::CfgFileManager::_getIntValue ( Ogre::ConfigFile &  CfgFile,
const Ogre::String  Name 
)
static

Get int value.

Remarks
if the parameter isn't found or the data type is not an int value, return 0 as default

Definition at line 250 of file SCfgFileManager.cpp.

◆ _getVector2Value()

Ogre::Vector2 SkyX::CfgFileManager::_getVector2Value ( Ogre::ConfigFile &  CfgFile,
const Ogre::String  Name 
)
static

Get vector2 value.

Remarks
if the parameter isn't found or the data type is not an int value, returns (0,0) as default

Definition at line 292 of file SCfgFileManager.cpp.

+ Here is the caller graph for this function:

◆ _getVector3Value()

Ogre::Vector3 SkyX::CfgFileManager::_getVector3Value ( Ogre::ConfigFile &  CfgFile,
const Ogre::String  Name 
)
static

Get vector3 value.

Remarks
if the parameter isn't found or the data type is not an int value, returns (0,0,0) as default

Definition at line 307 of file SCfgFileManager.cpp.

+ Here is the caller graph for this function:

◆ _getVector4Value()

Ogre::Vector4 SkyX::CfgFileManager::_getVector4Value ( Ogre::ConfigFile &  CfgFile,
const Ogre::String  Name 
)
static

Definition at line 323 of file SCfgFileManager.cpp.

+ Here is the caller graph for this function:

◆ _getVersionCfgString()

const Ogre::String SkyX::CfgFileManager::_getVersionCfgString ( ) const
private

Get hydrax version cfg string.

Returns
Hydrax version cfg string

Definition at line 219 of file SCfgFileManager.cpp.

+ Here is the caller graph for this function:

◆ _isStringInList()

bool SkyX::CfgFileManager::_isStringInList ( const Ogre::StringVector &  List,
const Ogre::String &  Find 
)
static

Definition at line 206 of file SCfgFileManager.cpp.

◆ _loadCfgFile()

const void SkyX::CfgFileManager::_loadCfgFile ( const Ogre::String &  File,
std::pair< bool, Ogre::ConfigFile > &  Result 
) const
private

Load a cfg file in an Ogre::ConfigFile.

Parameters
FileFile name
Result,std::pair<bool,Ogre::ConfigFile&>First: False if the file isn't in the Hydrax resource group, Second: Ogre::ConfigFile

Definition at line 155 of file SCfgFileManager.cpp.

+ Here is the caller graph for this function:

◆ _saveToFile()

const bool SkyX::CfgFileManager::_saveToFile ( const Ogre::String &  Data,
const Ogre::String &  File,
const Ogre::String &  Path 
) const
private

Save a string in file.

Returns
false if an error has ocurred

Definition at line 138 of file SCfgFileManager.cpp.

+ Here is the caller graph for this function:

◆ load()

const bool SkyX::CfgFileManager::load ( const Ogre::String &  File) const

Load hydrax cfg file.

Parameters
FileFile name
Returns
false if an error has been ocurred(Check the log file in this case).

Definition at line 39 of file SCfgFileManager.cpp.

+ Here is the call graph for this function:

◆ save()

const bool SkyX::CfgFileManager::save ( const Ogre::String &  File,
const Ogre::String &  Path = "" 
) const

Save current hydrax config to a file.

Parameters
FileDestination file name
PathFile path
Returns
false if an error has been ocurred(Check the log file in this case).

Definition at line 127 of file SCfgFileManager.cpp.

+ Here is the call graph for this function:

Field Documentation

◆ mCamera

Ogre::Camera* SkyX::CfgFileManager::mCamera
private

Definition at line 130 of file SCfgFileManager.h.

◆ mController

BasicController* SkyX::CfgFileManager::mController
private

Definition at line 129 of file SCfgFileManager.h.

◆ mSkyX

SkyX* SkyX::CfgFileManager::mSkyX
private

Hydrax parent pointer.

Definition at line 128 of file SCfgFileManager.h.


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