#include <XANAConfigParser.h>
Public Methods | |
XANAConfigParser () | |
bool | init (const char *fileName=0) |
virtual | ~XANAConfigParser () |
void | appendLine (XANAConfigFileLine *line) |
bool | deleteLine (const char *name, const char *scope=0) |
bool | overrideOption (const char *name, std::list< std::string > &values, const char *scope=0) |
bool | isDefined (const char *name) const |
int | readIntOption (const char *name) const throw (const char *) |
double | readDoubleOption (const char *name) const throw (const char *) |
const char * | readStringOption (const char *name) const throw (const char *) |
std::vector< int > | readIntListOption (const char *name) const throw (const char *) |
std::vector< double > | readDoubleListOption (const char *name) const throw (const char *) |
const std::list< std::string > | readStringListOption (const char *name) const throw (const char *) |
int | getOptionListSize (const char *name) const |
Return the dimension of a list of options. More... | |
bool | readIntOption (const char *name, int &value, int entry=0) const |
entries in the option list, otherwise false. More... | |
bool | readDoubleOption (const char *name, double &value, int entry=0) const |
entries in the option list, otherwise false. More... | |
bool | readStringOption (const char *name, const char *value, int entry=0) const |
entries in the option list, otherwise false You must provide enough space in value;. More... | |
void | print () const |
Public Attributes | |
FILE * | config_file |
Private Types | |
typedef std::list< XANAConfigFileLine * >::const_iterator | LineIterator |
For convinience a ValueIterator type is defined which walks along the list of option strings. More... | |
Private Attributes | |
std::list< XANAConfigFileLine * > | configLines |
A list of configuration file lines. More... |
|
For convinience a ValueIterator type is defined which walks along the list of option strings.
Definition at line 135 of file XANAConfigParser.h. Referenced by getOptionListSize. |
|
|
|
|
|
|
|
|
|
Return the dimension of a list of options.
Definition at line 75 of file XANAConfigParser.h. References configLines, and LineIterator. Referenced by readDoubleOption, readIntOption, and readStringOption.
00075 { 00076 std::string s(name); 00077 LineIterator I=configLines.begin(); 00078 while (I != configLines.end()) { 00079 if((*I)->isOption(s)){ 00080 return (*I)->getValues().size(); 00081 } 00082 I++; 00083 } 00084 return 0; 00085 } |
|
|
|
|
|
|
|
|
|
Referenced by readDoubleOption. |
|
entries in the option list, otherwise false.
Definition at line 104 of file XANAConfigParser.h. References getOptionListSize, and readDoubleListOption.
00104 { 00105 value=0; 00106 if(entry>=getOptionListSize(name)) return false; 00107 value=readDoubleListOption(name)[entry]; 00108 return true; 00109 } |
|
|
|
Referenced by readIntOption. |
|
entries in the option list, otherwise false.
Definition at line 92 of file XANAConfigParser.h. References getOptionListSize, and readIntListOption.
00092 { 00093 value=0; 00094 if(entry>=getOptionListSize(name)) return false; 00095 value=readIntListOption(name)[entry]; 00096 return true; 00097 } |
|
|
|
Referenced by readStringOption. |
|
entries in the option list, otherwise false You must provide enough space in value;.
Definition at line 117 of file XANAConfigParser.h. References getOptionListSize, and readStringListOption.
00117 { 00118 if(entry>=getOptionListSize(name)) return false; 00119 const std::list<std::string> l=readStringListOption(name); 00120 std::list<std::string>::const_iterator I=l.begin(); 00121 for(int i=0; i<entry; i++) I++; 00122 strcpy(value, (const char *)((*I).c_str())); 00123 return true; 00124 } |
|
|
|
Definition at line 26 of file XANAConfigParser.h. |
|
A list of configuration file lines.
Definition at line 131 of file XANAConfigParser.h. Referenced by getOptionListSize. |