Config reader


Classes

struct  conf_node

Functions

 salConf::salConf (const char *url, int size)
 Configuration loader.
 salConf::~salConf ()
 Destructor.
int salConf::getInt (string option_name)
 Load (int) variable.
string salConf::getString (string option_name)
 Load (string) variable.
TTF_Font * salConf::getFont (string option_uri, string option_size)
 Load (TTF_Font) variable.
Uint32 salConf::getColor (string color)
 Load (Uint32) variable (Color code).
Uint32 salConf::convert_color (string color)
 Convert color.

Detailed Description

SAL configuration reading

Function Documentation

Uint32 salConf::convert_color ( string  color  )  [private, inherited]

Convert color.

Parameters:
color Name of color.
Note:
Private.
Convert ASCII text to color code.
Returns COLOR_BLACK when color name wasn't found.

Definition at line 183 of file SAL_config.cpp.

Referenced by salConf::getColor().

Uint32 salConf::getColor ( string  option_name  )  [inherited]

Load (Uint32) variable (Color code).

Parameters:
option_name variable name.
Search the config file for the variable. Then return the value in color code.
Returns COLOR_BLACK when variable wasn't found.

Definition at line 160 of file SAL_config.cpp.

References salConf::conf_nodes, salConf::convert_color(), and salConf::length.

Referenced by SAL().

TTF_Font * salConf::getFont ( string  option_uri,
string  option_size 
) [inherited]

Load (TTF_Font) variable.

Parameters:
option_uri Url to ttf file.
option_size Font size(pt).
Search the config file for the url and size variable. Then load the font and return it.
Returns (NULL) when variable wasn't found.

Definition at line 134 of file SAL_config.cpp.

References salConf::conf_nodes, salConf::length, and salLoadFont.

Referenced by SAL().

int salConf::getInt ( string  option_name  )  [inherited]

Load (int) variable.

Parameters:
option_name variable name.
Search the config file for the variable. Then return the value.
Returns -1 when variable wasn't found.

Definition at line 93 of file SAL_config.cpp.

References salConf::conf_nodes, and salConf::length.

Referenced by SAL().

string salConf::getString ( string  option_name  )  [inherited]

Load (string) variable.

Parameters:
option_name variable name.
Search the config file for the variable. Then return the value.
Returns "" when variable wasn't found.

Definition at line 113 of file SAL_config.cpp.

References salConf::conf_nodes, and salConf::length.

Referenced by SAL().

salConf::salConf ( const char *  url,
int  size 
) [inherited]

Configuration loader.

Class that can load SAL style configuration files.

Definition at line 41 of file SAL_config.cpp.

References salConf::conf_nodes, salConf::length, and conf_node::value.

salConf::~salConf (  )  [inherited]

Destructor.

Safely destructs the config loader.

Definition at line 79 of file SAL_config.cpp.