#include <XFuConfiguration.h>
Inheritance diagram for XFuConfiguration:
Public Member Functions | |
XFuConfiguration () | |
Constructor. | |
virtual | ~XFuConfiguration () |
Destructor. | |
virtual CHAR * | get (const CHAR *aKey) |
Returns the value of the property (NULL if none). | |
virtual INT32 | getINT32 (const CHAR *aKey) |
Returns the value of a property as an INT32, or 0 if not found. | |
virtual FLOAT32 | getFLOAT32 (const CHAR *aKey) |
Returns the value of a property as a FLOAT32, or 0 if not found. | |
virtual void | put (const CHAR *aKey, const CHAR *aValue) |
Sets the value of a property. | |
virtual void | clear () |
Clears the current properties. | |
virtual INT | load (const CHAR *aFilename) |
Loads new configuration file and merges its data to the current set. | |
virtual INT | load (XFcFile *aFile) |
Loads new configuration file and merges its data to the current set. | |
Static Public Member Functions | |
XFuConfiguration * | create () |
Static constructor. | |
XFuConfiguration * | create (const CHAR *aFilename) |
Static constructor. | |
XFuConfiguration * | create (XFcFile *aFile) |
Static constructor. | |
Protected Member Functions | |
virtual void | processLine (const CHAR *aStr) |
Parses a line of the config file. | |
CHAR8 * | readLine (XFcFile *aFile) |
Reads a line from a file. | |
CHAR * | strDupTrim (const CHAR *aStr) |
Returns a new string where the leading and trailing spaces are removed. | |
Protected Attributes | |
XFcHashtable< XFuStringKey, void * > * | mProperties |
Properties hashtable. |
Reads and parses a set of configuration keys from a file. The format of the configuration file is such that there is one property on each row in a text file. Each property is a pair of a key and a value, delimited by a '=' char, for example: fileName=HelloWorld.xff. Leading and trailing spaces are trimmed. Lines starting with character '#' are treated as comment lines and are ignored.
Definition at line 30 of file XFuConfiguration.h.
|
Constructor.
Definition at line 53 of file XFuConfiguration.cpp. |
|
Destructor.
Definition at line 58 of file XFuConfiguration.cpp. References clear(). |
|
Clears the current properties.
Definition at line 106 of file XFuConfiguration.cpp. References mProperties. Referenced by ~XFuConfiguration(), and XFuConfigurationData::~XFuConfigurationData(). |
|
Static constructor.
Reimplemented in XFuConfigurationData. Definition at line 38 of file XFuConfiguration.cpp. References load(). |
|
Static constructor.
Reimplemented in XFuConfigurationData. Definition at line 23 of file XFuConfiguration.cpp. References load(). |
|
Static constructor.
Reimplemented in XFuConfigurationData. Definition at line 17 of file XFuConfiguration.cpp. |
|
Returns the value of the property (NULL if none).
Reimplemented in XFuConfigurationData. Definition at line 64 of file XFuConfiguration.cpp. References mProperties. Referenced by XFuConfigurationData::get(), getFLOAT32(), getINT32(), and put(). |
|
Returns the value of a property as a FLOAT32, or 0 if not found.
Definition at line 82 of file XFuConfiguration.cpp. References get(). |
|
Returns the value of a property as an INT32, or 0 if not found.
Definition at line 72 of file XFuConfiguration.cpp. References get(). |
|
Loads new configuration file and merges its data to the current set.
Reimplemented in XFuConfigurationData. Definition at line 119 of file XFuConfiguration.cpp. References mProperties, processLine(), readLine(), and strDupTrim(). |
|
Loads new configuration file and merges its data to the current set.
Reimplemented in XFuConfigurationData. Definition at line 155 of file XFuConfiguration.cpp. Referenced by create(), and XFuConfigurationData::load(). |
|
Parses a line of the config file. Extracts the property key and value from it and adds these to the property hashtable. Definition at line 169 of file XFuConfiguration.cpp. References put(). Referenced by load(). |
|
Sets the value of a property.
Reimplemented in XFuConfigurationData. Definition at line 92 of file XFuConfiguration.cpp. References get(), and mProperties. Referenced by processLine(), and XFuConfigurationData::put(). |
|
Reads a line from a file.
Definition at line 251 of file XFuConfiguration.cpp. Referenced by load(). |
|
Returns a new string where the leading and trailing spaces are removed.
Definition at line 215 of file XFuConfiguration.cpp. Referenced by load(). |
|
Properties hashtable.
Definition at line 101 of file XFuConfiguration.h. |
![]() | ||||
![]() |
Confidential Copyright © 2002-2003 Fathammer | with doxygen by Dimitri van Heesch |