Main Page | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Class Members | Related Pages

RS_VariableDict Class Reference

Dictionary of variables. More...

#include <rs_variabledict.h>

List of all members.

Public Member Functions

 RS_VariableDict ()
 Constructor.
void clear ()
 Removes all variables in the blocklist.
int count ()
void add (const RS_String &key, const RS_Vector &value, int code)
 Adds a variable to the variable dictionary.
void add (const RS_String &key, const RS_String &value, int code)
 Adds a variable to the variable dictionary.
void add (const RS_String &key, int value, int code)
 Adds a variable to the variable dictionary.
void add (const RS_String &key, double value, int code)
 Adds a variable to the variable dictionary.
RS_Vector getVector (const RS_String &key, const RS_Vector &def)
 Gets the value for the given variable.
RS_String getString (const RS_String &key, const RS_String &def)
 Gets the value for the given variable.
int getInt (const RS_String &key, int def)
 Gets the value as int for the given variable.
double getDouble (const RS_String &key, double def)
 Gets the value as double for the given variable.
virtual void remove (const RS_String &key)
 Removes a variable from the list.
RS_Hash< RS_String, RS_Variable > & getVariableDict ()


Detailed Description

Dictionary of variables.

The variables are stored as key / value pairs (string / string).

Author:
Andrew Mustun


Member Function Documentation

void RS_VariableDict::add const RS_String &  key,
double  value,
int  code
 

Adds a variable to the variable dictionary.

If a variable with the same name already exists, is will be overwritten.

void RS_VariableDict::add const RS_String &  key,
int  value,
int  code
 

Adds a variable to the variable dictionary.

If a variable with the same name already exists, is will be overwritten.

void RS_VariableDict::add const RS_String &  key,
const RS_String &  value,
int  code
 

Adds a variable to the variable dictionary.

If a variable with the same name already exists, is will be overwritten.

void RS_VariableDict::add const RS_String &  key,
const RS_Vector value,
int  code
 

Adds a variable to the variable dictionary.

If a variable with the same name already exists, is will be overwritten.

int RS_VariableDict::count  )  [inline]
 

Returns:
Number of variables available.

double RS_VariableDict::getDouble const RS_String &  key,
double  def
 

Gets the value as double for the given variable.

Parameters:
key Key of the variable.
def Default value.
Returns:
The value for the given variable or the given default value if the variable couldn't be found.

int RS_VariableDict::getInt const RS_String &  key,
int  def
 

Gets the value as int for the given variable.

Parameters:
key Key of the variable.
def Default value.
Returns:
The value for the given variable or the given default value if the variable couldn't be found.

RS_String RS_VariableDict::getString const RS_String &  key,
const RS_String &  def
 

Gets the value for the given variable.

Parameters:
key Key of the variable.
def Default value.
Returns:
The value for the given variable or the given default value if the variable couldn't be found.

RS_Vector RS_VariableDict::getVector const RS_String &  key,
const RS_Vector def
 

Gets the value for the given variable.

Parameters:
key Key of the variable.
def Default value.
Returns:
The value for the given variable or the given default value if the variable couldn't be found.


The documentation for this class was generated from the following files:
Generated on Sat Jan 6 13:48:23 2007 for qcadlib by  doxygen 1.4.4