From 60a9969b9471dec190d5526b79cb731ea2e1b751 Mon Sep 17 00:00:00 2001 From: brain Date: Wed, 7 Apr 2004 18:21:29 +0000 Subject: Added new documentation git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@424 e03df62e-2008-0410-955e-edbf42e46eb7 --- docs/module-doc/classConfigReader.html | 114 ++++++++++++++++++++++----------- 1 file changed, 76 insertions(+), 38 deletions(-) (limited to 'docs/module-doc/classConfigReader.html') diff --git a/docs/module-doc/classConfigReader.html b/docs/module-doc/classConfigReader.html index f19df250a..1e56ef39b 100644 --- a/docs/module-doc/classConfigReader.html +++ b/docs/module-doc/classConfigReader.html @@ -35,8 +35,10 @@ Inheritance diagram for ConfigReader:

Verify ()  Returns true if a config file is valid.


Protected Attributes

-std::string fnameThe filename of the configuration file, as set by the constructor.

+std::stringstream * cacheThe contents of the configuration file This protected member should never be accessed by a module (and cannot be accessed unless the core is changed).

+bool errorUsed to store errors.


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. @@ -45,7 +47,7 @@ It may either be instantiated with one parameter or none. Constructing the class

-Definition at line 448 of file modules.h.


Constructor & Destructor Documentation

+Definition at line 469 of file modules.h.

Constructor & Destructor Documentation

@@ -75,13 +77,14 @@ Default constructor.

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

-Definition at line 296 of file modules.cpp. +Definition at line 319 of file modules.cpp.

-References fname. +References cache, and error.

-

00297 {
-00298         fname = CONFIG_FILE;
-00299 }
+
00320 {
+00321         this->cache = new std::stringstream(stringstream::in | stringstream::out);
+00322         this->error = LoadConf(CONFIG_FILE,this->cache);
+00323 }
 
@@ -115,9 +118,14 @@ Overloaded constructor.

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

-Definition at line 307 of file modules.cpp. +Definition at line 333 of file modules.cpp.

-

00307 : fname(filename) { };
+References cache, and error.
+

+

00334 {
+00335         this->cache = new std::stringstream(stringstream::in | stringstream::out);
+00336         this->error = LoadConf(filename.c_str(),this->cache);
+00337 };
 
@@ -150,10 +158,14 @@ Default destructor.

This method destroys the ConfigReader class.

-Definition at line 302 of file modules.cpp. +Definition at line 326 of file modules.cpp. +

+References cache.

-

00303 {
-00304 }
+
00327 {
+00328         if (this->cache)
+00329                 delete this->cache;
+00330 }
 
@@ -188,13 +200,11 @@ 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 317 of file modules.cpp. +Definition at line 347 of file modules.cpp.

-References fname. -

-

00318 {
-00319         return EnumConf(fname.c_str(),tag.c_str());
-00320 }
+
00348 {
+00349         return EnumConf(cache,tag.c_str());
+00350 }
 
@@ -243,15 +253,13 @@ 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 309 of file modules.cpp. -

-References fname. +Definition at line 339 of file modules.cpp.

-

00310 {
-00311         char val[MAXBUF];
-00312         ReadConf(fname.c_str(),tag.c_str(),name.c_str(),index,val);
-00313         return val;
-00314 }
+
00340 {
+00341         char val[MAXBUF];
+00342         ReadConf(cache,tag.c_str(),name.c_str(),index,val);
+00343         return val;
+00344 }
 
@@ -282,24 +290,54 @@ References fname.

Returns true if a config file is valid.

-This method is unimplemented and will always return true. +This method is partially implemented and will only return false if the config file does not exist or could not be opened.

-Definition at line 323 of file modules.cpp. +Definition at line 353 of file modules.cpp.

-

00324 {
-00325         return true;
-00326 }
+References error.
+

+

00354 {
+00355         return this->error;
+00356 }
 

Member Data Documentation

-

+

+ + + + +
+ + +
std::stringstream* ConfigReader::cache [protected] +
+
+ + + + + +
+   + + +

+The contents of the configuration file This protected member should never be accessed by a module (and cannot be accessed unless the core is changed). +

+It will contain a pointer to the configuration file data with unneeded data (such as comments) stripped from it. +

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

+Referenced by ConfigReader(), and ~ConfigReader().

+

@@ -312,18 +350,18 @@ Definition at line 323 +Referenced by ConfigReader(), and Verify().
-
std::string ConfigReader::fname [protected] + bool ConfigReader::error [protected]

-The filename of the configuration file, as set by the constructor. +Used to store errors.

-Definition at line 453 of file modules.h. +Definition at line 480 of file modules.h.

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


The documentation for this class was generated from the following files: -
Generated on Tue Apr 6 21:13:50 2004 for InspIRCd by +
Generated on Wed Apr 7 19:20:37 2004 for InspIRCd by doxygen1.3-rc3
-- cgit v1.2.3