From 73b9d0c5cb02f0ea8350de28bc3687e0af70ea0f Mon Sep 17 00:00:00 2001 From: brain Date: Thu, 23 Jan 2003 19:45:57 +0000 Subject: Initial revision git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@132 e03df62e-2008-0410-955e-edbf42e46eb7 --- docs/module-doc/classConfigReader.html | 324 +++++++++++++++++++++++++++++++++ 1 file changed, 324 insertions(+) create mode 100644 docs/module-doc/classConfigReader.html (limited to 'docs/module-doc/classConfigReader.html') diff --git a/docs/module-doc/classConfigReader.html b/docs/module-doc/classConfigReader.html new file mode 100644 index 000000000..f0221a1a1 --- /dev/null +++ b/docs/module-doc/classConfigReader.html @@ -0,0 +1,324 @@ + + +ConfigReader class Reference + + + +
+Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  
+

ConfigReader Class Reference

Allows reading of values from configuration files This class allows a module to read from either the main configuration file (inspircd.conf) or from a module-specified configuration file. +More... +

+#include <modules.h> +

+List of all members. + + + + + + + + + + + + + + + + + +

Public Methods

 ConfigReader ()
 Default constructor.

 ConfigReader (string filename)
 Overloaded constructor.

 ~ConfigReader ()
 Default destructor.

string ReadValue (string tag, string name, int index)
 Retrieves a value from the config file.

int Enumerate (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

string fname
 The filename of the configuration file, as set by the constructor.

+


Detailed Description

+Allows reading of values from configuration files This class allows a module to read from either the main configuration file (inspircd.conf) or from a module-specified configuration file. +

+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 226 of file modules.h.


Constructor & Destructor Documentation

+

+ + + + +
+ + + + + + + + + +
ConfigReader::ConfigReader  
+
+ + + + + +
+   + + +

+Default constructor. +

+This constructor initialises the ConfigReader class to read the inspircd.conf file as specified when running ./configure. +

+Definition at line 161 of file modules.cpp. +

+References fname. +

+

00162 {
+00163         fname = CONFIG_FILE;
+00164 }
+
+

+ + + + +
+ + + + + + + + + + +
ConfigReader::ConfigReader string   filename
+
+ + + + + +
+   + + +

+Overloaded constructor. +

+This constructor initialises the ConfigReader class to read a user-specified config file +

+Definition at line 172 of file modules.cpp. +

+

00172 : fname(filename) { };
+
+

+ + + + +
+ + + + + + + + + +
ConfigReader::~ConfigReader  
+
+ + + + + +
+   + + +

+Default destructor. +

+This method destroys the ConfigReader class. +

+Definition at line 167 of file modules.cpp. +

+

00168 {
+00169 }
+
+


Member Function Documentation

+

+ + + + +
+ + + + + + + + + + +
int ConfigReader::Enumerate string   tag
+
+ + + + + +
+   + + +

+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 183 of file modules.cpp. +

+References fname. +

+

00184 {
+00185         return EnumConf(fname.c_str(),tag.c_str());
+00186 }
+
+

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + +
string ConfigReader::ReadValue string   tag,
string   name,
int   index
+
+ + + + + +
+   + + +

+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 174 of file modules.cpp. +

+References fname. +

+

00175 {
+00176         char val[MAXBUF];
+00177         ReadConf(fname.c_str(),tag.c_str(),name.c_str(),index,val);
+00178         string s = val;
+00179         return s;
+00180 }
+
+

+ + + + +
+ + + + + + + + + +
bool ConfigReader::Verify  
+
+ + + + + +
+   + + +

+Returns true if a config file is valid. +

+This method is unimplemented and will always return true. +

+Definition at line 189 of file modules.cpp. +

+

00190 {
+00191         return true;
+00192 }
+
+


Member Data Documentation

+

+ + + + +
+ + +
string ConfigReader::fname [protected] +
+
+ + + + + +
+   + + +

+The filename of the configuration file, as set by the constructor. +

+ +

+Definition at line 231 of file modules.h. +

+Referenced by ConfigReader(), Enumerate(), and ReadValue().

+


The documentation for this class was generated from the following files: +
Generated on Wed Jan 22 20:56:47 2003 for InspIRCd by + +doxygen1.3-rc2
+ + -- cgit v1.3.1-10-gc9f91