|
|
A drop in replacement for the original cepConfiguration. This implements a whiteboard pattern.
| ~cepConfiguration ()
| ~cepConfiguration |
| void initialise ( const string & filename )
| initialise |
[static]
Makes a new config using a config file called filename
Parameters:
| filename | the name of the file to use for persistance |
| cepConfiguration & getInstance ()
| getInstance |
[static]
Gets a reference to the configuration.
Returns: a reference to the current configuration
| cepError getValue (const string & valkey, const string & defval, string & outval)
| getValue |
Get the value for a given configuration item. If the key does not exist then the deafult value is returned
Parameters:
| valkey | The key to lookup |
| defval | The default value |
| outval | This is set by the method. |
See also: cepError
| cepError getValue (const string & valkey, const bool & defval, bool & outval)
| getValue |
Get the value for a given configuration item. If the key does not exist then the deafult value is returned
Parameters:
| valkey | The key to lookup |
| defval | The default value |
| outval | This is set by the method. |
See also: cepError
| cepError getValue (const string & valkey, const int &defval, int &outval)
| getValue |
Get the value for a given configuration item. If the key does not exist then the deafult value is returned
Parameters:
| valkey | The key to lookup |
| defval | The default value |
| outval | This is set by the method. |
See also: cepError
| cepError setValue (const string & valkey, const string & value)
| setValue |
Set the value for a given configuration item. If the key does not exist then it is created
Parameters:
| valkey | The key to lookup |
| value | The value to set |
See also: cepError
| cepError setValue (const string & valkey, const int &value)
| setValue |
Set the value for a given configuration item. If the key does not exist then it is created
Parameters:
| valkey | The key to lookup |
| value | The value to set |
See also: cepError
| cepError setValue (const string & valkey, const bool & value)
| setValue |
Set the value for a given configuration item. If the key does not exist then it is created
Parameters:
| valkey | The key to lookup |
| value | The value to set |
See also: cepError
| cepConfiguration (const string & filename)
| cepConfiguration |
[protected]
Constructor. this is protected to ensure that there can be only one.
Parameters:
| filename | the canonical path to the config file |
| static cepConfiguration * config | config |
[private]
| typedef map < string, string, less < string > >map_t | < string, string, less < string > >map_t |
[private]
| map_t map | map |
[private]
| string path | path |
[private]
| cepError load (const string & filename)
| load |
[private]
Load the data from the config file
Parameters:
| filename | the canonical path to the config file |
Returns: the cepError. use cepError::isReal() to see if an error occurred.
See also: cepError
| cepError save (const string & filename)
| save |
[private]
Load the data from the config file
Parameters:
| filename | the canonical path to the config file |
Returns: the cepError. use cepError::isReal() to see if an error occurred.
See also: cepError
| cepError readConfig ( ifstream & in)
| readConfig |
[private]
Reads the config data from the input stream
Parameters:
| in | the input stream from which to read |
Returns: the cepError. use cepError::isReal() to see if an error occurred.
See also: cepError
| cepError parseConfigEntry (const string & entry, pair < string,
string > &data)
| parseConfigEntry |
[private]
Parses a single entry fromt he config file
Parameters:
| entry | the line fromt he file to parse |
| data | the data extracte. this is populated by the method. |
Returns: the cepError. use cepError::isReal() to see if an error occurred.
| cepError writeConfig (ofstream & out)
| writeConfig |
[private]
Writes the config data to the output stream
Parameters:
| out | the output stream to write to |
Returns: the cepError. use cepError::isReal() to see if an error occurred.
See also: cepError
| const string & getDefaultConfigPath ()
| getDefaultConfigPath |
[private static]
Builds the path to the config file. this checks to see if the environment variable HOME is set. if so, then the path points to it, otherwise it is pointed at the current working directory
Returns: the path to the config file