Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members

ConfigParameter Class Reference

#include <Config.h>

List of all members.


Detailed Description

A ConfigParameter is the single value in the configuration.

It can be stored in the main section or a sub-section.

Author:
Thomas Jacob

Definition at line 758 of file Config.h.

Public Member Functions

bool GetBoolValue ()
 Returns the boolean value of the parameter.

double GetDoubleValue ()
 Returns the double float value of the parameter.

long GetLongValue ()
 Returns the long integer value of the parameter.

char * GetStringValue ()
 Returns the string value of the parameter.

int GetType ()
 Returns the type of the parameter.

void SetBoolValue (bool boolValue)
 Sets the type of the parameter to boolean and sets its value.

void SetDoubleValue (double doubleValue)
 Sets the type of the parameter to double float and sets its value.

void SetLongValue (long longValue)
 Sets the type of the parameter to long integer and sets its value.

void SetStringValue (const char *stringValue)
 Sets the type of the parameter to string and sets its value.


Private Member Functions

 ConfigParameter (const char *stringValue)
 Creates a string (char *) config parameter.

 ConfigParameter (long longValue)
 Creates a long integer config parameter.

 ConfigParameter (double doubleValue)
 Creates a double float config parameter.

 ConfigParameter (bool boolValue)
 Creates a boolean config parameter.

 ConfigParameter ()
 Creates a config parameter.

bool WriteCorrectedForCfgFile (class Config::Writer *Writer)
 Writes the parameter to a file, after having it modified so that all illegal characters are escaped with a back slash.

 ~ConfigParameter ()
 Destroys the config parameter.


Private Attributes

friend ConfigSection
friend HashMap<ConfigParameter>
int Type
 The current type of the parameter.


Constructor & Destructor Documentation

ConfigParameter  )  [private]
 

Creates a config parameter.

ConfigParameter bool  boolValue  )  [private]
 

Creates a boolean config parameter.

Parameters:
boolValue The boolean value.

ConfigParameter double  doubleValue  )  [private]
 

Creates a double float config parameter.

Parameters:
doubleValue The double float value.

ConfigParameter long  longValue  )  [private]
 

Creates a long integer config parameter.

Parameters:
longValue The long integer value.

ConfigParameter const char *  stringValue  )  [private]
 

Creates a string (char *) config parameter.

Parameters:
stringValue The string value.
Note:
The method copies the string so its memory is not used after the creation.

~ConfigParameter  )  [private]
 

Destroys the config parameter.


Member Function Documentation

bool GetBoolValue  ) 
 

Returns the boolean value of the parameter.

If the parameter is not of boolean type, it is converted in prior. The type is not changed when doing this.

Returns:
The boolean value of the parameter.

double GetDoubleValue  ) 
 

Returns the double float value of the parameter.

If the parameter is not of double float type, it is converted in prior. The type is not changed when doing this.

Returns:
The double float value of the parameter.

long GetLongValue  ) 
 

Returns the long integer value of the parameter.

If the parameter is not of long integer type, it is converted in prior. The type is not changed when doing this.

Returns:
The long integer value of the parameter.

char* GetStringValue  ) 
 

Returns the string value of the parameter.

If the parameter is not of string type, it is converted in prior, as far as this does not mean any memory allocation. If the conversion isn't possible without allocating memory (for example for the integer type), the method returns an empty string.

Returns:
The string value of the parameter.
Note:
Do not free or change this value. Use SetStringValue instead.

int GetType  )  [inline]
 

Returns the type of the parameter.

Returns:
The type of the parameter.

void SetBoolValue bool  boolValue  ) 
 

Sets the type of the parameter to boolean and sets its value.

Parameters:
boolValue The new boolean value.

void SetDoubleValue double  doubleValue  ) 
 

Sets the type of the parameter to double float and sets its value.

Parameters:
doubleValue The new double float value.

void SetLongValue long  longValue  ) 
 

Sets the type of the parameter to long integer and sets its value.

Parameters:
longValue The new long integer value.

void SetStringValue const char *  stringValue  ) 
 

Sets the type of the parameter to string and sets its value.

Parameters:
stringValue The new boolean value.
Note:
The method copies the string so its memory is not used after the creation.

bool WriteCorrectedForCfgFile class Config::Writer Writer  )  [private]
 

Writes the parameter to a file, after having it modified so that all illegal characters are escaped with a back slash.

Parameters:
Writer The writer to write to.
Returns:
Whether the writing was successful.


Member Data Documentation

bool BoolValue [private]
 

The boolean value of the parameter, if the parameter's type is boolean.

Definition at line 772 of file Config.h.

friend ConfigSection [private]
 

Definition at line 761 of file Config.h.

double DoubleValue [private]
 

The double float value of the parameter, if the parameter's type is double float.

Definition at line 778 of file Config.h.

friend HashMap<ConfigParameter> [private]
 

Definition at line 762 of file Config.h.

long LongValue [private]
 

The long integer value of the parameter, if the parameter's type is long integer.

Definition at line 784 of file Config.h.

char* StringValue [private]
 

The string (char *) value of the parameter, if the parameter's type is string.

Definition at line 790 of file Config.h.

int Type [private]
 

The current type of the parameter.

Definition at line 803 of file Config.h.


The documentation for this class was generated from the following file:
Generated on Tue Oct 3 00:23:39 2006 for ToolBox by doxygen 1.3.6