Main Page   Namespace List   Alphabetical List   Data Structures   File List   Data Fields   Globals  

configini Class Reference


Public Methods

void init (const char *fname)
void loadFile ()
char * strlwr (const char *)
string getParam (const char *section, const char *key)
map< string, string > getParam (const char *section)
string cleanBlanks (string)
int stringToInt (string s)
int getIntParam (const char *section, const char *key)
float getfloatParam (const char *section, const char *key)

Private Attributes

string configFile
 stores the filename

string configContent
 stores its content


Detailed Description

This class permits to use config files in the ".ini" format in a system independant manner.


Member Function Documentation

string configini::cleanBlanks string    s
 

Cleans trailing and ..beginning... empty spaces from string s

Parameters:
s:  the string to be cleaned

float configini::getfloatParam const char *    section,
const char *    key
 

Takes a float parameter from an ini file

Parameters:
key  : keyname to retrieve like Quit (without =)
section  : section name like KEYS (without [])
Returns:
: the value required or -1 if no value TODO : to be optimised a bit and secured

int configini::getIntParam const char *    section,
const char *    key
 

Takes an int parameter from an ini file

Parameters:
key  : keyname to retrieve like Quit (without =)
section  : section name like KEYS (without [])
Returns:
: the value required or -1 if no value TODO : to be optimised a bit and secured

std::map< string, string > configini::getParam const char *    section
 

Gets the first key with its value from section

Parameters:
section  : the section to parse

string configini::getParam const char *    section,
const char *    key
 

Takes a parameter from an ini file

Parameters:
key  : keyname to retrieve like Quit (without =)
section  : section name like KEYS (without [])
Returns:
: string retBuffer or "" if no value has been found TODO : to be optimised a bit and secured

void configini::init const char *    fname
 

Gets the file name

void configini::loadFile  
 

Loads the file to memory

int configini::stringToInt string    s
 

Converts a string to int

char * configini::strlwr const char *    src
 

Puts a string to lower chars


Field Documentation

string configini::configContent [private]
 

stores its content

string configini::configFile [private]
 

stores the filename


The documentation for this class was generated from the following files:
Generated on Wed Feb 18 16:32:53 2004 for POVAMA by doxygen1.2.18