]> git.netwichtig.de Git - user/henk/code/inspircd.git/blob - docs/module-doc/classConfigReader.html
5e10ed3b50e51f418afa488b3a13746ca1a15cdf
[user/henk/code/inspircd.git] / docs / module-doc / classConfigReader.html
1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
2 <html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
3 <title>ConfigReader class Reference</title>
4 <link href="doxygen.css" rel="stylesheet" type="text/css">
5 </head><body>
6 <!-- Generated by Doxygen 1.3-rc2 -->
7 <center>
8 <a class="qindex" href="main.html">Main Page</a> &nbsp; <a class="qindex" href="hierarchy.html">Class Hierarchy</a> &nbsp; <a class="qindex" href="classes.html">Alphabetical List</a> &nbsp; <a class="qindex" href="annotated.html">Compound List</a> &nbsp; <a class="qindex" href="files.html">File List</a> &nbsp; <a class="qindex" href="functions.html">Compound Members</a> &nbsp; <a class="qindex" href="globals.html">File Members</a> &nbsp; </center>
9 <hr><h1>ConfigReader Class Reference</h1>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. 
10 <a href="#_details">More...</a>
11 <p>
12 <code>#include &lt;<a class="el" href="modules_8h-source.html">modules.h</a>&gt;</code>
13 <p>
14 <p>Inheritance diagram for ConfigReader:
15 <p><center><img src="classConfigReader.png" usemap="#ConfigReader_map" border="0" alt=""></center>
16 <map name="ConfigReader_map">
17 <area href="classclassbase.html" alt="classbase" shape="rect" coords="0,0,90,24">
18 </map>
19 <a href="classConfigReader-members.html">List of all members.</a><table border=0 cellpadding=0 cellspacing=0>
20 <tr><td></td></tr>
21 <tr><td colspan=2><br><h2>Public Methods</h2></td></tr>
22 <tr><td nowrap align=right valign=top>&nbsp;</td><td valign=bottom><a class="el" href="classConfigReader.html#a0">ConfigReader</a> ()</td></tr>
23 <tr><td>&nbsp;</td><td><font size=-1><em>Default constructor.</em> <a href="#a0"></a><em></em></font><br><br></td></tr>
24 <tr><td nowrap align=right valign=top>&nbsp;</td><td valign=bottom><a class="el" href="classConfigReader.html#a1">ConfigReader</a> (string filename)</td></tr>
25 <tr><td>&nbsp;</td><td><font size=-1><em>Overloaded constructor.</em> <a href="#a1"></a><em></em></font><br><br></td></tr>
26 <tr><td nowrap align=right valign=top>&nbsp;</td><td valign=bottom><a class="el" href="classConfigReader.html#a2">~ConfigReader</a> ()</td></tr>
27 <tr><td>&nbsp;</td><td><font size=-1><em>Default destructor.</em> <a href="#a2"></a><em></em></font><br><br></td></tr>
28 <tr><td nowrap align=right valign=top>string&nbsp;</td><td valign=bottom><a class="el" href="classConfigReader.html#a3">ReadValue</a> (string tag, string name, int index)</td></tr>
29 <tr><td>&nbsp;</td><td><font size=-1><em>Retrieves a value from the config file.</em> <a href="#a3"></a><em></em></font><br><br></td></tr>
30 <tr><td nowrap align=right valign=top>int&nbsp;</td><td valign=bottom><a class="el" href="classConfigReader.html#a4">Enumerate</a> (string tag)</td></tr>
31 <tr><td>&nbsp;</td><td><font size=-1><em>Counts the number of times a given tag appears in the config file.</em> <a href="#a4"></a><em></em></font><br><br></td></tr>
32 <tr><td nowrap align=right valign=top>bool&nbsp;</td><td valign=bottom><a class="el" href="classConfigReader.html#a5">Verify</a> ()</td></tr>
33 <tr><td>&nbsp;</td><td><font size=-1><em>Returns true if a config file is valid.</em> <a href="#a5"></a><em></em></font><br><br></td></tr>
34 <tr><td colspan=2><br><h2>Protected Attributes</h2></td></tr>
35 <tr><td nowrap align=right valign=top>string&nbsp;</td><td valign=bottom><a class="el" href="classConfigReader.html#n0">fname</a></td></tr>
36 <tr><td>&nbsp;</td><td><font size=-1><em>The filename of the configuration file, as set by the constructor.</em> <a href="#n0"></a><em></em></font><br><br></td></tr>
37 </table>
38 <hr><a name="_details"></a><h2>Detailed Description</h2>
39 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.
40 <p>
41 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. 
42 <p>
43
44 <p>
45 Definition at line <a class="el" href="modules_8h-source.html#l00233">233</a> of file <a class="el" href="modules_8h-source.html">modules.h</a>.<hr><h2>Constructor &amp; Destructor Documentation</h2>
46 <a name="a0" doxytag="ConfigReader::ConfigReader"></a><p>
47 <table width="100%" cellpadding="2" cellspacing="0" border="0">
48   <tr>
49     <td class="md">
50       <table cellpadding="0" cellspacing="0" border="0">
51         <tr>
52           <td class="md" nowrap valign="top"> ConfigReader::ConfigReader </td>
53           <td class="md" valign="top">(&nbsp;</td>
54           <td class="mdname1" valign="top" nowrap>&nbsp;          </td>
55           <td class="md" valign="top">)&nbsp;</td>
56           <td class="md" nowrap></td>
57         </tr>
58
59       </table>
60     </td>
61   </tr>
62 </table>
63 <table cellspacing=5 cellpadding=0 border=0>
64   <tr>
65     <td>
66       &nbsp;
67     </td>
68     <td>
69
70 <p>
71 Default constructor.
72 <p>
73 This constructor initialises the ConfigReader class to read the inspircd.conf file as specified when running ./configure.
74 <p>
75 Definition at line <a class="el" href="modules_8cpp-source.html#l00164">164</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
76 <p>
77 References <a class="el" href="modules_8h-source.html#l00238">fname</a>.
78 <p>
79 <div class="fragment"><pre>00165 {
80 00166         <a class="code" href="classConfigReader.html#n0">fname</a> = CONFIG_FILE;
81 00167 }
82 </pre></div>    </td>
83   </tr>
84 </table>
85 <a name="a1" doxytag="ConfigReader::ConfigReader"></a><p>
86 <table width="100%" cellpadding="2" cellspacing="0" border="0">
87   <tr>
88     <td class="md">
89       <table cellpadding="0" cellspacing="0" border="0">
90         <tr>
91           <td class="md" nowrap valign="top"> ConfigReader::ConfigReader </td>
92           <td class="md" valign="top">(&nbsp;</td>
93           <td class="md" nowrap valign="top">string&nbsp;</td>
94           <td class="mdname1" valign="top" nowrap>&nbsp; <em>filename</em>          </td>
95           <td class="md" valign="top">)&nbsp;</td>
96           <td class="md" nowrap></td>
97         </tr>
98
99       </table>
100     </td>
101   </tr>
102 </table>
103 <table cellspacing=5 cellpadding=0 border=0>
104   <tr>
105     <td>
106       &nbsp;
107     </td>
108     <td>
109
110 <p>
111 Overloaded constructor.
112 <p>
113 This constructor initialises the ConfigReader class to read a user-specified config file
114 <p>
115 Definition at line <a class="el" href="modules_8cpp-source.html#l00175">175</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
116 <p>
117 <div class="fragment"><pre>00175 : <a class="code" href="classConfigReader.html#n0">fname</a>(filename) { };
118 </pre></div>    </td>
119   </tr>
120 </table>
121 <a name="a2" doxytag="ConfigReader::~ConfigReader"></a><p>
122 <table width="100%" cellpadding="2" cellspacing="0" border="0">
123   <tr>
124     <td class="md">
125       <table cellpadding="0" cellspacing="0" border="0">
126         <tr>
127           <td class="md" nowrap valign="top"> ConfigReader::~ConfigReader </td>
128           <td class="md" valign="top">(&nbsp;</td>
129           <td class="mdname1" valign="top" nowrap>&nbsp;          </td>
130           <td class="md" valign="top">)&nbsp;</td>
131           <td class="md" nowrap></td>
132         </tr>
133
134       </table>
135     </td>
136   </tr>
137 </table>
138 <table cellspacing=5 cellpadding=0 border=0>
139   <tr>
140     <td>
141       &nbsp;
142     </td>
143     <td>
144
145 <p>
146 Default destructor.
147 <p>
148 This method destroys the ConfigReader class.
149 <p>
150 Definition at line <a class="el" href="modules_8cpp-source.html#l00170">170</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
151 <p>
152 <div class="fragment"><pre>00171 {
153 00172 }
154 </pre></div>    </td>
155   </tr>
156 </table>
157 <hr><h2>Member Function Documentation</h2>
158 <a name="a4" doxytag="ConfigReader::Enumerate"></a><p>
159 <table width="100%" cellpadding="2" cellspacing="0" border="0">
160   <tr>
161     <td class="md">
162       <table cellpadding="0" cellspacing="0" border="0">
163         <tr>
164           <td class="md" nowrap valign="top"> int ConfigReader::Enumerate </td>
165           <td class="md" valign="top">(&nbsp;</td>
166           <td class="md" nowrap valign="top">string&nbsp;</td>
167           <td class="mdname1" valign="top" nowrap>&nbsp; <em>tag</em>          </td>
168           <td class="md" valign="top">)&nbsp;</td>
169           <td class="md" nowrap></td>
170         </tr>
171
172       </table>
173     </td>
174   </tr>
175 </table>
176 <table cellspacing=5 cellpadding=0 border=0>
177   <tr>
178     <td>
179       &nbsp;
180     </td>
181     <td>
182
183 <p>
184 Counts the number of times a given tag appears in the config file.
185 <p>
186 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 <a class="el" href="classConfigReader.html#a3">ConfigReader::ReadValue</a> to loop through all copies of a multiple instance tag.
187 <p>
188 Definition at line <a class="el" href="modules_8cpp-source.html#l00186">186</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
189 <p>
190 References <a class="el" href="modules_8h-source.html#l00238">fname</a>.
191 <p>
192 <div class="fragment"><pre>00187 {
193 00188         <span class="keywordflow">return</span> EnumConf(<a class="code" href="classConfigReader.html#n0">fname</a>.c_str(),tag.c_str());
194 00189 }
195 </pre></div>    </td>
196   </tr>
197 </table>
198 <a name="a3" doxytag="ConfigReader::ReadValue"></a><p>
199 <table width="100%" cellpadding="2" cellspacing="0" border="0">
200   <tr>
201     <td class="md">
202       <table cellpadding="0" cellspacing="0" border="0">
203         <tr>
204           <td class="md" nowrap valign="top"> string ConfigReader::ReadValue </td>
205           <td class="md" valign="top">(&nbsp;</td>
206           <td class="md" nowrap valign="top">string&nbsp;</td>
207           <td class="mdname" nowrap>&nbsp; <em>tag</em>, </td>
208         </tr>
209         <tr>
210           <td></td>
211           <td></td>
212           <td class="md" nowrap>string&nbsp;</td>
213           <td class="mdname" nowrap>&nbsp; <em>name</em>, </td>
214         </tr>
215         <tr>
216           <td></td>
217           <td></td>
218           <td class="md" nowrap>int&nbsp;</td>
219           <td class="mdname" nowrap>&nbsp; <em>index</em></td>
220         </tr>
221         <tr>
222           <td></td>
223           <td class="md">)&nbsp;</td>
224           <td class="md" colspan="2"></td>
225         </tr>
226
227       </table>
228     </td>
229   </tr>
230 </table>
231 <table cellspacing=5 cellpadding=0 border=0>
232   <tr>
233     <td>
234       &nbsp;
235     </td>
236     <td>
237
238 <p>
239 Retrieves a value from the config file.
240 <p>
241 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.
242 <p>
243 Definition at line <a class="el" href="modules_8cpp-source.html#l00177">177</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
244 <p>
245 References <a class="el" href="modules_8h-source.html#l00238">fname</a>.
246 <p>
247 <div class="fragment"><pre>00178 {
248 00179         <span class="keywordtype">char</span> val[MAXBUF];
249 00180         ReadConf(<a class="code" href="classConfigReader.html#n0">fname</a>.c_str(),tag.c_str(),name.c_str(),index,val);
250 00181         string s = val;
251 00182         <span class="keywordflow">return</span> s;
252 00183 }
253 </pre></div>    </td>
254   </tr>
255 </table>
256 <a name="a5" doxytag="ConfigReader::Verify"></a><p>
257 <table width="100%" cellpadding="2" cellspacing="0" border="0">
258   <tr>
259     <td class="md">
260       <table cellpadding="0" cellspacing="0" border="0">
261         <tr>
262           <td class="md" nowrap valign="top"> bool ConfigReader::Verify </td>
263           <td class="md" valign="top">(&nbsp;</td>
264           <td class="mdname1" valign="top" nowrap>&nbsp;          </td>
265           <td class="md" valign="top">)&nbsp;</td>
266           <td class="md" nowrap></td>
267         </tr>
268
269       </table>
270     </td>
271   </tr>
272 </table>
273 <table cellspacing=5 cellpadding=0 border=0>
274   <tr>
275     <td>
276       &nbsp;
277     </td>
278     <td>
279
280 <p>
281 Returns true if a config file is valid.
282 <p>
283 This method is unimplemented and will always return true.
284 <p>
285 Definition at line <a class="el" href="modules_8cpp-source.html#l00192">192</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
286 <p>
287 <div class="fragment"><pre>00193 {
288 00194         <span class="keywordflow">return</span> <span class="keyword">true</span>;
289 00195 }
290 </pre></div>    </td>
291   </tr>
292 </table>
293 <hr><h2>Member Data Documentation</h2>
294 <a name="n0" doxytag="ConfigReader::fname"></a><p>
295 <table width="100%" cellpadding="2" cellspacing="0" border="0">
296   <tr>
297     <td class="md">
298       <table cellpadding="0" cellspacing="0" border="0">
299         <tr>
300           <td class="md" nowrap valign="top"> string ConfigReader::fname<code> [protected]</code>
301       </table>
302     </td>
303   </tr>
304 </table>
305 <table cellspacing=5 cellpadding=0 border=0>
306   <tr>
307     <td>
308       &nbsp;
309     </td>
310     <td>
311
312 <p>
313 The filename of the configuration file, as set by the constructor.
314 <p>
315
316 <p>
317 Definition at line <a class="el" href="modules_8h-source.html#l00238">238</a> of file <a class="el" href="modules_8h-source.html">modules.h</a>.
318 <p>
319 Referenced by <a class="el" href="modules_8cpp-source.html#l00164">ConfigReader()</a>, <a class="el" href="modules_8cpp-source.html#l00186">Enumerate()</a>, and <a class="el" href="modules_8cpp-source.html#l00177">ReadValue()</a>.    </td>
320   </tr>
321 </table>
322 <hr>The documentation for this class was generated from the following files:<ul>
323 <li><a class="el" href="modules_8h-source.html">modules.h</a><li><a class="el" href="modules_8cpp-source.html">modules.cpp</a></ul>
324 <hr><address style="align: right;"><small>Generated on Sun Jan 26 23:45:48 2003 for InspIRCd by
325 <a href="http://www.doxygen.org/index.html">
326 <img src="doxygen.png" alt="doxygen" align="middle" border=0 
327 width=110 height=53></a>1.3-rc2 </small></address>
328 </body>
329 </html>