#include <modules.h>
Inheritance diagram for ConfigReader:
Public Member Functions | |
ConfigReader () | |
Default constructor. | |
ConfigReader (std::string filename) | |
Overloaded constructor. | |
~ConfigReader () | |
Default destructor. | |
std::string | ReadValue (std::string tag, std::string name, int index) |
Retrieves a value from the config file. | |
int | Enumerate (std::string tag) |
Counts the number of times a given tag appears in the config file. | |
bool | Verify () |
Returns true if a config file is valid. | |
Protected Attributes | |
std::string | fname |
The filename of the configuration file, as set by the constructor. |
It may either be instantiated with one parameter or none. Constructing the class using one parameter allows you to specify a path to your own configuration file, otherwise, inspircd.conf is read.
Definition at line 359 of file modules.h.
|
Default constructor. This constructor initialises the ConfigReader class to read the inspircd.conf file as specified when running ./configure. Definition at line 265 of file modules.cpp. References fname.
00266 { 00267 fname = CONFIG_FILE; 00268 } |
|
Overloaded constructor. This constructor initialises the ConfigReader class to read a user-specified config file Definition at line 276 of file modules.cpp.
00276 : fname(filename) { }; |
|
Default destructor. This method destroys the ConfigReader class. Definition at line 271 of file modules.cpp.
00272 { 00273 } |
|
Counts the number of times a given tag appears in the config file. This method counts the number of times a tag appears in a config file, for use where there are several tags of the same kind, e.g. with opers and connect types. It can be used with the index value of ConfigReader::ReadValue to loop through all copies of a multiple instance tag. Definition at line 286 of file modules.cpp. References fname.
00287 { 00288 return EnumConf(fname.c_str(),tag.c_str()); 00289 } |
|
Retrieves a value from the config file. This method retrieves a value from the config file. Where multiple copies of the tag exist in the config file, index indicates which of the values to retrieve. Definition at line 278 of file modules.cpp. References fname.
00279 { 00280 char val[MAXBUF]; 00281 ReadConf(fname.c_str(),tag.c_str(),name.c_str(),index,val); 00282 return val; 00283 } |
|
Returns true if a config file is valid. This method is unimplemented and will always return true. Definition at line 292 of file modules.cpp.
00293 { 00294 return true; 00295 } |
|
The filename of the configuration file, as set by the constructor.
Definition at line 364 of file modules.h. Referenced by ConfigReader(), Enumerate(), and ReadValue(). |