#include <conf.h>
Public Member Functions | |
| const OPENCITY_ERR_CODE | Open (const string &fname) |
| void | Close () |
| const string & | GetValue (const string &key, const string def="") |
| const OPENCITY_ERR_CODE | GetBool (const string &key, bool &rbool, const bool def=false) |
| const OPENCITY_ERR_CODE | GetLint (const string &key, OC_LINT &rlint, const OC_LINT def=0) |
| const OPENCITY_ERR_CODE | GetFloat (const string &key, float &rfloat, const float def=0) |
Static Public Member Functions | |
| static OC_CHAR *const | RTrim (OC_CHAR *const str) |
| static OC_CHAR *const | LTrim (OC_CHAR *const str) |
Private Attributes | |
| map< string, string > | _mapData |
Conf* pConf = new Conf(); pConf->Open("opencity.conf"); cout << "one is : '" << pConf->GetValue("one") << "'" << endl << "two is : '" << pConf->GetValue("two") << "'" << endl << "three is : '" << pConf->GetValue("three") << "'" << endl << "moo is : '" << pConf->GetValue("moo") << "'" << endl << "coco : '" << pConf->GetValue("coco") << "'" << endl; pConf->Close(); delete pConf;
Definition at line 55 of file conf.h.
|
||||||||||||||||
|
Empty value causes the method to return OC_ERR_INVALID and the rbool variable contains an undefied value. The following values are interpreted as false: 0, no, n, off. Anything other than space is interpreted as true
|
|
||||||||||||||||
|
Convert the string specified by the key "key" to float. This method uses the function "strtol()" |
|
||||||||||||||||
|
Convert the string specified by the key "key" to long int. This method uses the function "strtol()" |
|
||||||||||||
|
Return the string which represents the value part of the (key-value) pair
|
|
|
Open the .conf file specified by its filename
Definition at line 29 of file conf.cpp. References RTrim(). |
|
|
Static right and left trim tool Definition at line 232 of file conf.cpp. Referenced by Open(). |
1.4.2