namespace Akenti class Properties

A class to hold the variables defined in the Akenti configuration file

Public Methods

Properties ()
Constructor
~Properties ()
Destructor
void load (const string& filename)
Reads and parses the configuration file
const string& getValue (const string& key) const
Returns the value for a keyword
const string& getValue (const string& key, const string& defaultValue) const
Returns the value or a default value for a keyword
const string& getValue (const pair& key) const
Returns the value corresponding to a key that consists of two string objects
const string& getValue (const pair& key, const string& defaultValue) const
Returns the value corresponding to a key that consists of two string objects
string paramString () const
Returns the contents of the Properties table
static Properties& getSystemProperties ()
Returns the system wide Properties object

Documentation

A class to hold the variables defined in the Akenti configuration file. There is a static Properties object that can be accessed by the GetSystemProperties method. It is initialized by the load method when the Akenti code is first entered. Subsequently any piece of code can do a GetSystemProperties call to get a reference to the resulting map object and then do getValue calls to find the value for any key word.
Properties()
Constructor

~Properties()
Destructor

void load(const string& filename)
Reads and parses the configuration file. The configuration file consists of lines of ascii text where each line starts with a keyword and has one value. The keyword may not contain any white space, but the value may. Lines which start with a "#" are comments. The result is a Properties map that consists of one string value for each key.
Parameters:
filename - absolute pathname of an Akenti configuration file.

const string& getValue(const string& key) const
Returns the value for a keyword.
Returns:
the value for a key. If no value is found a empty string is returned
Parameters:
key - the lookup key

const string& getValue(const string& key, const string& defaultValue) const
Returns the value or a default value for a keyword
Parameters:
key - the lookup key
defaultValue - the value that will be returned if no other value is found in the Properties map for this key

const string& getValue(const pair& key) const
Returns the value corresponding to a key that consists of two string objects.
Returns:
the value a string or empty string if no value is found
Parameters:
key - pair used for lookup

const string& getValue(const pair& key, const string& defaultValue) const
Returns the value corresponding to a key that consists of two string objects.
Returns:
the value a string or the default value if no value is found
Parameters:
key - pair used for lookup
defaultValue - string returned if no value is found

string paramString() const
Returns the contents of the Properties table
Returns:
a string starting with [consisting of keyword="value pairs for the whole table" and ending with ].

static Properties& getSystemProperties()
Returns the system wide Properties object
Returns:
system wide Properties object


This class has no child classes.
Author:
Srilekha Mudumbai Abdelilah Essiari
Version:
1.1 00/05/01

alphabetic index hierarchy of classes


this page has been generated automatically by doc++

(c)opyright by Malte Zöckler, Roland Wunderling
contact: doc++@zib.de