class cepConfiguration

A drop in replacement for the original cepConfiguration. More...

Definition#include <gdms/cepConfiguration.h>
List of all Methods
Annotated List
Files
Globals
Hierarchy
Index

Public Methods

Public Static Methods

Protected Methods

Private Types

Private Methods

Private Static Methods

Private Members


Detailed Description

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:
filenamethe 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:
valkeyThe key to lookup
defvalThe default value
outvalThis 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:
valkeyThe key to lookup
defvalThe default value
outvalThis 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:
valkeyThe key to lookup
defvalThe default value
outvalThis 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:
valkeyThe key to lookup
valueThe 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:
valkeyThe key to lookup
valueThe 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:
valkeyThe key to lookup
valueThe 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:
filenamethe 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:
filenamethe 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:
filenamethe 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:
inthe 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:
entrythe line fromt he file to parse
datathe 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:
outthe 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