diff options
Diffstat (limited to '')
-rw-r--r-- | docs/doxygen/nel/config__file_8h-source.html | 278 |
1 files changed, 278 insertions, 0 deletions
diff --git a/docs/doxygen/nel/config__file_8h-source.html b/docs/doxygen/nel/config__file_8h-source.html new file mode 100644 index 00000000..eb302ca3 --- /dev/null +++ b/docs/doxygen/nel/config__file_8h-source.html @@ -0,0 +1,278 @@ +<!doctype html public "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd"> +<HTML> +<HEAD> + <TITLE>nevrax.org : docs</TITLE> + <LINK REL=stylesheet TYPE="text/css" HREF="http://www.nevrax.org/inc/css/nevrax.css"> + <link href="doxygen.css" rel="stylesheet" type="text/css"> +</HEAD> +<BODY MARGINHEIGHT="0" MARGINWIDTH="0"> + +<!-- uplinks --> +<TABLE CELLSPACING=0 CELLPADDING=0 BORDER=0> + <TR> + <TD WIDTH=16><IMG SRC="http://www.nevrax.org/inc/img/pixel.gif" WIDTH="16" HEIGHT="16" BORDER=0 ALT=""></TD> + <TD WIDTH=140 BGCOLOR=#dddddd><IMG SRC="http://www.nevrax.org/inc/img/pixel.gif" WIDTH="140" HEIGHT="16" BORDER=0 ALT=""></TD> + <TD WIDTH=16><IMG SRC="http://www.nevrax.org/inc/img/pixel.gif" WIDTH="16" HEIGHT="16" BORDER=0 ALT=""></TD> + <TD><IMG width=6 height=14 SRC="http://www.nevrax.org/inc/img/reddots.gif" ALT="#" VSPACE=2 HSPACE=2 BORDER=0 ></TD><TD VALIGN=middle> <A CLASS=uplinks HREF=http://www.nevrax.org><b>Home</B></FONT></A> </TD> + <TD><IMG width=6 height=14 SRC="http://www.nevrax.org/inc/img/reddots.gif" ALT="#" VSPACE=2 HSPACE=2 BORDER=0 ></TD><TD VALIGN=middle> <A CLASS=uplinks HREF=http://www.nevrax.com><b>nevrax.com</B></FONT></A> </TD> + </TR> +</TABLE> + +<!-- banner Nevrax --> +<TABLE CELLSPACING=0 CELLPADDING=0 BORDER=0 WIDTH=100%> + <TR><TD BGCOLOR="#000000" BACKGROUND="http://www.nevrax.org/inc/img/black_banner.jpg"><A HREF="http://www.nevrax.org"><IMG SRC="http://www.nevrax.org/inc/img/nevrax.gif" WIDTH="170" HEIGHT="45" BORDER=0 ALT="Nevrax" ></A></TD></TR> +</TABLE> + +<!-- main table --> +<TABLE CELLSPACING=0 CELLPADDING=0 BORDER=0 height=100%> + <TR> + <TD WIDTH=16><IMG SRC="http://www.nevrax.org/inc/img/pixel.gif" WIDTH="16" HEIGHT="10" BORDER=0 ALT=""></TD> + <TD WIDTH=140 BGCOLOR=#dddddd VALIGN=TOP ALIGN=middle><IMG SRC="http://www.nevrax.org/inc/img/pixel.gif" WIDTH="140" HEIGHT="10" BORDER=0 ALT=""> + + <!------ Begin Box ------> + <TABLE BORDER=0 CELLSPACING=0 CELLPADDING=0 BGCOLOR=black><TR><TD><TABLE border=0 cellspacing=2 cellpadding=0 width=120><tr><TD ALIGN=middle bgcolor=black> + <FONT COLOR=white FACE="sans-serif"><B>Nevrax.org</B></FONT></TD></TR><tr><td colspan=2 bgcolor=#FFFFFF> + <TABLE cellspacing=0 cellpadding=1 border=0> + <tr><td ALIGN=middle><a class='linkbox' href="http://www.nevrax.org/news/" TITLE="Rubrique news"><img width=13 height=15 hspace=5 border=0 src=http://www.nevrax.org/inc/img/picto-news.gif ALT=#></A></td><td><a class='linkbox' href="http://www.nevrax.org/news/" TITLE="News">News</a></td></tr> + <tr><td ALIGN=middle><a class='linkbox' href="http://www.nevrax.org/mail/" TITLE="Rubrique mail"><img width=15 height=11 hspace=5 border=0 src=http://www.nevrax.org/inc/img/picto-mail.gif ALT=#></A></td><td><a class='linkbox' href="http://www.nevrax.org/mail/" TITLE="Mailing list archive">Mailing-list</a></td></tr> + <tr><td ALIGN=middle><a class='linkbox' href="http://www.nevrax.org/docs/" TITLE="Rubrique docs"><img width=14 height=16 hspace=5 border=0 src=http://www.nevrax.org/inc/img/picto-docs.gif ALT=#></A></td><td><a class='linkbox' href="http://www.nevrax.org/docs/" TITLE="Documentation">Documentation</a></td></tr> + <tr><td ALIGN=middle><a class='linkbox' href="http://www.nevrax.org/cvs/" TITLE="Rubrique cvs"><img width=13 height=17 hspace=5 border=0 src=http://www.nevrax.org/inc/img/picto-cvs.gif ALT=#></A></td><td><a class='linkbox' href="http://www.nevrax.org/cvs/" TITLE="CVS Web">CVS</a></td></tr> + <tr><td ALIGN=middle><a class='linkbox' href="http://www.nevrax.org/bugs/" TITLE="Rubrique bugs"><img width=20 height=16 hspace=5 border=0 src=http://www.nevrax.org/inc/img/picto-bugs.gif ALT=#></A></td><td><a class='linkbox' href="http://www.nevrax.org/bugs/" TITLE="Bugtracking">Bugs</a></td></tr> + <tr><td ALIGN=middle><a class='linkbox' href="http://www.nevrax.org/GPL.php3" TITLE="Rubrique license"><img width=18 height=12 hspace=5 border=0 src=http://www.nevrax.org/inc/img/picto-gpl.gif ALT=#></A></td><td><a class='linkbox' href="http://www.nevrax.org/GPL.php3" TITLE="License">License</a></td></tr> + </TABLE> + </TD></TR></TABLE></TD></TR></TABLE> + <!------ End Box ------> + + </TD> + <TD WIDTH=15><IMG SRC="http://www.nevrax.org/inc/img/pixel.gif" WIDTH="16" HEIGHT="16" BORDER=0 ALT=""></TD> + <TD ALIGN=left valign=top><IMG SRC="http://www.nevrax.org/inc/img/pixel.gif" WIDTH="140" HEIGHT="10" BORDER=0 ALT=""> + +<!-- title --> +<TABLE background="http://www.nevrax.org/inc/img/redline.gif" CELLSPACING=0 CELLPADDING=0 BORDER=0 width=100%><tr><td> +<A HREF="http://www.nevrax.org/docs/"><img src="http://www.nevrax.org/inc/img/t_docs.gif" ALT="Docs" HEIGHT=20 BORDER=0></A> +</td><td><IMG SRC="http://www.nevrax.org/inc/img/pixel.gif" WIDTH="1" HEIGHT="1" BORDER=0 ALT=""> +</td></tr></table> + + +<!-- block --> +<TABLE bgcolor="#dddddd" CELLSPACING=0 CELLPADDING=0 BORDER=0 width=100%><tr><td width=1% valign=middle><img width=6 height=14 hspace=2 vspace=2 src="http://www.nevrax.org/inc/img/reddots.gif"></TD> + <TD><B>Documentation</B></TD> + <TD ALIGN=RIGHT> </td> +</tr></table> +<!-- Generated by Doxygen 1.2.14 --> +<center> +<a class="qindex" href="index.html">Main Page</a> <a class="qindex" href="namespaces.html">Namespace List</a> <a class="qindex" href="hierarchy.html">Class Hierarchy</a> <a class="qindex" href="classes.html">Alphabetical List</a> <a class="qindex" href="annotated.html">Compound List</a> <a class="qindex" href="files.html">File List</a> <a class="qindex" href="namespacemembers.html">Namespace Members</a> <a class="qindex" href="functions.html">Compound Members</a> <a class="qindex" href="globals.html">File Members</a> <a class="qindex" href="pages.html">Related Pages</a> <a class="qindexRef" doxygen="_cgi:http://www.nevrax.org/cgi-bin/nel-search.cgi" href="http://www.nevrax.org/cgi-bin/nel-search.cgi">Search</a> </center> +<hr><h1>config_file.h</h1><a href="config__file_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre>00001 +00007 <font class="comment">/* Copyright, 2000 Nevrax Ltd.</font> +00008 <font class="comment"> *</font> +00009 <font class="comment"> * This file is part of NEVRAX NEL.</font> +00010 <font class="comment"> * NEVRAX NEL is free software; you can redistribute it and/or modify</font> +00011 <font class="comment"> * it under the terms of the GNU General Public License as published by</font> +00012 <font class="comment"> * the Free Software Foundation; either version 2, or (at your option)</font> +00013 <font class="comment"> * any later version.</font> +00014 <font class="comment"></font> +00015 <font class="comment"> * NEVRAX NEL is distributed in the hope that it will be useful, but</font> +00016 <font class="comment"> * WITHOUT ANY WARRANTY; without even the implied warranty of</font> +00017 <font class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU</font> +00018 <font class="comment"> * General Public License for more details.</font> +00019 <font class="comment"></font> +00020 <font class="comment"> * You should have received a copy of the GNU General Public License</font> +00021 <font class="comment"> * along with NEVRAX NEL; see the file COPYING. If not, write to the</font> +00022 <font class="comment"> * Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,</font> +00023 <font class="comment"> * MA 02111-1307, USA.</font> +00024 <font class="comment"> */</font> +00025 +00026 <font class="preprocessor">#ifndef NL_CONFIG_FILE_H</font> +00027 <font class="preprocessor"></font><font class="preprocessor">#define NL_CONFIG_FILE_H</font> +00028 <font class="preprocessor"></font> +00029 <font class="preprocessor">#include "<a class="code" href="types__nl_8h.html">nel/misc/types_nl.h</a>"</font> +00030 <font class="preprocessor">#include "<a class="code" href="common_8h.html">nel/misc/common.h</a>"</font> +00031 <font class="preprocessor">#include "<a class="code" href="debug_8h.html">nel/misc/debug.h</a>"</font> +00032 <font class="preprocessor">#include "<a class="code" href="log_8h.html">nel/misc/log.h</a>"</font> +00033 +00034 <font class="preprocessor">#include <vector></font> +00035 <font class="preprocessor">#include <string></font> +00036 <font class="preprocessor">#include <stdio.h></font> +00037 +00038 <font class="keyword">namespace </font>NLMISC +00039 { +00040 +<a name="l00119"></a><a class="code" href="classNLMISC_1_1CConfigFile.html">00119</a> <font class="keyword">class </font>CConfigFile +00120 { +00121 <font class="keyword">public</font>: +00122 +<a name="l00132"></a><a class="code" href="structNLMISC_1_1CConfigFile_1_1CVar.html">00132</a> <font class="keyword">struct </font>CVar +00133 { +00134 <font class="keyword">public</font>: +00135 +<a name="l00136"></a><a class="code" href="structNLMISC_1_1CConfigFile_1_1CVar.html#a0">00136</a> <a class="code" href="structNLMISC_1_1CConfigFile_1_1CVar.html#a0">CVar</a> () : <a class="code" href="structNLMISC_1_1CConfigFile_1_1CVar.html#z282_2">Type</a>(<a class="code" href="structNLMISC_1_1CConfigFile_1_1CVar.html#z282_0s0">T_UNKNOWN</a>) {} +00137 +00139 +00140 +00141 <font class="keywordtype">int</font> <a class="code" href="structNLMISC_1_1CConfigFile_1_1CVar.html#z280_0">asInt</a> (<font class="keywordtype">int</font> <a class="code" href="driver__opengl__extension__def_8h.html#a358">index</a>=0) <font class="keyword">const</font>; +00143 <font class="keywordtype">double</font> <a class="code" href="structNLMISC_1_1CConfigFile_1_1CVar.html#z280_1">asDouble</a> (<font class="keywordtype">int</font> <a class="code" href="driver__opengl__extension__def_8h.html#a358">index</a>=0) <font class="keyword">const</font>; +00145 <font class="keywordtype">float</font> <a class="code" href="structNLMISC_1_1CConfigFile_1_1CVar.html#z280_2">asFloat</a> (<font class="keywordtype">int</font> <a class="code" href="driver__opengl__extension__def_8h.html#a358">index</a>=0) <font class="keyword">const</font>; +00147 <font class="keyword">const</font> std::string &<a class="code" href="structNLMISC_1_1CConfigFile_1_1CVar.html#z280_3">asString</a> (<font class="keywordtype">int</font> <a class="code" href="driver__opengl__extension__def_8h.html#a358">index</a>=0) <font class="keyword">const</font>; +00149 +00152 +00153 +00154 <font class="keywordtype">void</font> <a class="code" href="structNLMISC_1_1CConfigFile_1_1CVar.html#z281_0">setAsInt</a> (<font class="keywordtype">int</font> val, <font class="keywordtype">int</font> <a class="code" href="driver__opengl__extension__def_8h.html#a358">index</a>=0); +00156 <font class="keywordtype">void</font> <a class="code" href="structNLMISC_1_1CConfigFile_1_1CVar.html#z281_1">setAsDouble</a> (<font class="keywordtype">double</font> val, <font class="keywordtype">int</font> <a class="code" href="driver__opengl__extension__def_8h.html#a358">index</a>=0); +00158 <font class="keywordtype">void</font> <a class="code" href="structNLMISC_1_1CConfigFile_1_1CVar.html#z281_2">setAsFloat</a> (<font class="keywordtype">float</font> val, <font class="keywordtype">int</font> <a class="code" href="driver__opengl__extension__def_8h.html#a358">index</a>=0); +00160 <font class="keywordtype">void</font> <a class="code" href="structNLMISC_1_1CConfigFile_1_1CVar.html#z281_3">setAsString</a> (std::string val, <font class="keywordtype">int</font> <a class="code" href="driver__opengl__extension__def_8h.html#a358">index</a>=0); +00161 +00163 <font class="keywordtype">void</font> <a class="code" href="structNLMISC_1_1CConfigFile_1_1CVar.html#z281_0">setAsInt</a> (std::vector<int> vals); +00165 <font class="keywordtype">void</font> <a class="code" href="structNLMISC_1_1CConfigFile_1_1CVar.html#z281_1">setAsDouble</a> (std::vector<double> vals); +00167 <font class="keywordtype">void</font> <a class="code" href="structNLMISC_1_1CConfigFile_1_1CVar.html#z281_2">setAsFloat</a> (std::vector<float> vals); +00169 <font class="keywordtype">void</font> <a class="code" href="structNLMISC_1_1CConfigFile_1_1CVar.html#z281_3">setAsString</a> (std::vector<std::string> vals); +00170 +00172 +00173 <font class="keywordtype">bool</font> <a class="code" href="structNLMISC_1_1CConfigFile_1_1CVar.html#a1">operator== </a>(<font class="keyword">const</font> <a class="code" href="structNLMISC_1_1CConfigFile_1_1CVar.html#a0">CVar</a>& var) <font class="keyword">const</font>; +00174 <font class="keywordtype">bool</font> <a class="code" href="structNLMISC_1_1CConfigFile_1_1CVar.html#a2">operator!= </a>(<font class="keyword">const</font> <a class="code" href="structNLMISC_1_1CConfigFile_1_1CVar.html#a0">CVar</a>& var) <font class="keyword">const</font>; +00175 +00176 <font class="comment">// add this variable with var</font> +00177 <font class="keywordtype">void</font> <a class="code" href="structNLMISC_1_1CConfigFile_1_1CVar.html#a3">add</a> (<font class="keyword">const</font> <a class="code" href="structNLMISC_1_1CConfigFile_1_1CVar.html#a0">CVar</a> &var); +00178 +00179 <font class="comment">// Get the size of the variable. It's the number of element of the array or 1 if it's not an array.</font> +00180 <font class="keywordtype">int</font> <a class="code" href="structNLMISC_1_1CConfigFile_1_1CVar.html#a4">size</a> () <font class="keyword">const</font>; +00181 +00183 +00184 <font class="keyword">static</font> <font class="keywordtype">char</font> *<a class="code" href="structNLMISC_1_1CConfigFile_1_1CVar.html#z282_8">TypeName</a>[]; +00185 +<a name="l00186"></a><a class="code" href="structNLMISC_1_1CConfigFile_1_1CVar.html#z282_0">00186</a> <font class="keyword">enum</font> <a class="code" href="structNLMISC_1_1CConfigFile_1_1CVar.html#z282_0">TVarType</a> { <a class="code" href="structNLMISC_1_1CConfigFile_1_1CVar.html#z282_0s0">T_UNKNOWN</a>, <a class="code" href="structNLMISC_1_1CConfigFile_1_1CVar.html#z282_0s1">T_INT</a>, <a class="code" href="structNLMISC_1_1CConfigFile_1_1CVar.html#z282_0s2">T_STRING</a>, <a class="code" href="structNLMISC_1_1CConfigFile_1_1CVar.html#z282_0s3">T_REAL</a> }; +00187 +<a name="l00188"></a><a class="code" href="structNLMISC_1_1CConfigFile_1_1CVar.html#z282_1">00188</a> std::string <a class="code" href="structNLMISC_1_1CConfigFile_1_1CVar.html#z282_1">Name</a>; +<a name="l00189"></a><a class="code" href="structNLMISC_1_1CConfigFile_1_1CVar.html#z282_2">00189</a> <a class="code" href="structNLMISC_1_1CConfigFile_1_1CVar.html#z282_0">TVarType</a> <a class="code" href="structNLMISC_1_1CConfigFile_1_1CVar.html#z282_2">Type</a>; +<a name="l00190"></a><a class="code" href="structNLMISC_1_1CConfigFile_1_1CVar.html#z282_3">00190</a> <font class="keywordtype">bool</font> <a class="code" href="structNLMISC_1_1CConfigFile_1_1CVar.html#z282_3">Comp</a>; +<a name="l00191"></a><a class="code" href="structNLMISC_1_1CConfigFile_1_1CVar.html#z282_4">00191</a> std::vector<int> <a class="code" href="structNLMISC_1_1CConfigFile_1_1CVar.html#z282_4">IntValues</a>; +<a name="l00192"></a><a class="code" href="structNLMISC_1_1CConfigFile_1_1CVar.html#z282_5">00192</a> std::vector<double> <a class="code" href="structNLMISC_1_1CConfigFile_1_1CVar.html#z282_5">RealValues</a>; +<a name="l00193"></a><a class="code" href="structNLMISC_1_1CConfigFile_1_1CVar.html#z282_6">00193</a> std::vector<std::string> <a class="code" href="structNLMISC_1_1CConfigFile_1_1CVar.html#z282_6">StrValues</a>; +00194 <a class="code" href="driver__opengl__extension__def_8h.html#a424">void</a> (*<a class="code" href="structNLMISC_1_1CConfigFile_1_1CVar.html#z282_7">Callback</a>)(<a class="code" href="structNLMISC_1_1CConfigFile_1_1CVar.html#a0">CVar</a> &var); +00196 }; +00197 +<a name="l00198"></a><a class="code" href="classNLMISC_1_1CConfigFile.html#a0">00198</a> <a class="code" href="classNLMISC_1_1CConfigFile.html#a0">CConfigFile</a>() : <a class="code" href="classNLMISC_1_1CConfigFile.html#o0">_Callback</a>(NULL) {} +00199 +00200 <font class="keyword">virtual</font> <a class="code" href="classNLMISC_1_1CConfigFile.html#a1">~CConfigFile</a> (); +00201 +00203 CVar &<a class="code" href="classNLMISC_1_1CConfigFile.html#a2">getVar</a> (<font class="keyword">const</font> std::string &varName); +00204 +00206 CVar *<a class="code" href="classNLMISC_1_1CConfigFile.html#a3">getVarPtr</a> (<font class="keyword">const</font> std::string &varName); +00207 +00209 <font class="keywordtype">bool</font> <a class="code" href="classNLMISC_1_1CConfigFile.html#a4">exists</a> (<font class="keyword">const</font> std::string &varName); +00210 +00212 <font class="keywordtype">void</font> <a class="code" href="classNLMISC_1_1CConfigFile.html#a5">load</a> (<font class="keyword">const</font> std::string &fileName); +00213 +00215 <font class="keywordtype">void</font> <a class="code" href="classNLMISC_1_1CConfigFile.html#a6">save</a> () <font class="keyword">const</font>; +00216 +00218 <font class="keywordtype">bool</font> <a class="code" href="classNLMISC_1_1CConfigFile.html#a7">loaded</a>(); +00219 +00221 <font class="keywordtype">void</font> <a class="code" href="classNLMISC_1_1CConfigFile.html#a8">reparse</a> (<font class="keyword">const</font> <font class="keywordtype">char</font> *filename = NULL, <font class="keywordtype">bool</font> callingCallback = <font class="keyword">true</font>); +00222 +00224 <font class="keywordtype">void</font> <a class="code" href="classNLMISC_1_1CConfigFile.html#a9">print</a> () <font class="keyword">const</font>; +00225 +00227 <font class="keywordtype">void</font> <a class="code" href="classNLMISC_1_1CConfigFile.html#a9">print</a> (CLog *log) <font class="keyword">const</font>; +00228 +00230 <font class="keywordtype">void</font> <a class="code" href="classNLMISC_1_1CConfigFile.html#a11">setCallback</a> (<font class="keywordtype">void</font> (*cb)()); +00231 +00233 <font class="keywordtype">void</font> <a class="code" href="classNLMISC_1_1CConfigFile.html#a11">setCallback</a> (<font class="keyword">const</font> std::string &VarName, <font class="keywordtype">void</font> (*cb)(CConfigFile::CVar &var)); +00234 +00235 <font class="keywordtype">void</font> <a class="code" href="classNLMISC_1_1CConfigFile.html#a13">setLastModifiedNow</a> (); +00236 +<a name="l00238"></a><a class="code" href="classNLMISC_1_1CConfigFile.html#m0">00238</a> std::vector<std::string> <a class="code" href="classNLMISC_1_1CConfigFile.html#m0">UnknownVariables</a>; +00239 +<a name="l00241"></a><a class="code" href="classNLMISC_1_1CConfigFile.html#a14">00241</a> std::string <a class="code" href="classNLMISC_1_1CConfigFile.html#a14">getFilename</a> ()<font class="keyword"> const </font>{ <font class="keywordflow">return</font> <a class="code" href="classNLMISC_1_1CConfigFile.html#o2">_FileName</a>; } +00242 +00245 <font class="keyword">static</font> <font class="keywordtype">void</font> <a class="code" href="classNLMISC_1_1CConfigFile.html#d0">CConfigFile::setTimeout</a> (uint32 timeout); +00246 +00248 <font class="keyword">static</font> <font class="keywordtype">void</font> <a class="code" href="classNLMISC_1_1CConfigFile.html#d1">checkConfigFiles</a> (); +00249 +00250 <font class="keyword">private</font>: +00251 +00253 <a class="code" href="driver__opengl__extension__def_8h.html#a424">void</a> (*<a class="code" href="classNLMISC_1_1CConfigFile.html#o0">_Callback</a>)(); +00254 +<a name="l00256"></a><a class="code" href="classNLMISC_1_1CConfigFile.html#o1">00256</a> std::vector<CVar> <a class="code" href="classNLMISC_1_1CConfigFile.html#o1">_Vars</a>; +00257 +<a name="l00259"></a><a class="code" href="classNLMISC_1_1CConfigFile.html#o2">00259</a> std::string <a class="code" href="classNLMISC_1_1CConfigFile.html#o2">_FileName</a>; +00260 +00262 uint32 <a class="code" href="classNLMISC_1_1CConfigFile.html#c0">getLastModified</a> (); +<a name="l00264"></a><a class="code" href="classNLMISC_1_1CConfigFile.html#o3">00264</a> uint32 <a class="code" href="classNLMISC_1_1CConfigFile.html#o3">_LastModified</a>; +00265 +00266 <font class="keyword">static</font> uint32 <a class="code" href="classNLMISC_1_1CConfigFile.html#r0">_Timeout</a>; +00267 +00268 <font class="keyword">static</font> std::vector<CConfigFile *> *<a class="code" href="classNLMISC_1_1CConfigFile.html#r1">_ConfigFiles</a>; +00269 }; +00270 +<a name="l00271"></a><a class="code" href="structNLMISC_1_1EConfigFile.html">00271</a> <font class="keyword">struct </font>EConfigFile : <font class="keyword">public</font> Exception +00272 { +<a name="l00273"></a><a class="code" href="structNLMISC_1_1EConfigFile.html#a0">00273</a> <a class="code" href="structNLMISC_1_1EConfigFile.html#a0">EConfigFile</a>() { <a class="code" href="classNLMISC_1_1Exception.html#n0">_Reason</a> = <font class="stringliteral">"Unknown Config File Exception"</font>;} +00274 }; +00275 +<a name="l00276"></a><a class="code" href="structNLMISC_1_1EBadType.html">00276</a> <font class="keyword">struct </font>EBadType : <font class="keyword">public</font> EConfigFile +00277 { +<a name="l00278"></a><a class="code" href="structNLMISC_1_1EBadType.html#a0">00278</a> <a class="code" href="structNLMISC_1_1EBadType.html#a0">EBadType</a> (<font class="keyword">const</font> std::string &varName, <font class="keywordtype">int</font> varType, <font class="keywordtype">int</font> wantedType) +00279 { +00280 <font class="keyword">static</font> <font class="keywordtype">char</font> str[NLMISC::MaxCStringSize]; +00281 <a class="code" href="namespaceNLMISC.html#a211">smprintf</a> (str, NLMISC::MaxCStringSize, <font class="stringliteral">"Bad variable type, variable \"%s\" is a %s and not a %s"</font>, varName.c_str (), CConfigFile::CVar::TypeName[varType], CConfigFile::CVar::TypeName[wantedType]); +00282 <a class="code" href="classNLMISC_1_1Exception.html#n0">_Reason</a> = str; +00283 <a class="code" href="debug_8h.html#a1">nlinfo</a>(<font class="stringliteral">"Exception will be launched: %s"</font>, <a class="code" href="classNLMISC_1_1Exception.html#n0">_Reason</a>.c_str()); +00284 } +00285 }; +00286 +<a name="l00287"></a><a class="code" href="structNLMISC_1_1EBadSize.html">00287</a> <font class="keyword">struct </font>EBadSize : <font class="keyword">public</font> EConfigFile +00288 { +<a name="l00289"></a><a class="code" href="structNLMISC_1_1EBadSize.html#a0">00289</a> <a class="code" href="structNLMISC_1_1EBadSize.html#a0">EBadSize</a> (<font class="keyword">const</font> std::string &varName, <font class="keywordtype">int</font> varSize, <font class="keywordtype">int</font> varIndex) +00290 { +00291 <font class="keyword">static</font> <font class="keywordtype">char</font> str[NLMISC::MaxCStringSize]; +00292 <a class="code" href="namespaceNLMISC.html#a211">smprintf</a> (str, NLMISC::MaxCStringSize, <font class="stringliteral">"Trying to access to the index %d but the variable \"%s\" size is %d"</font>, varIndex, varName.c_str (), varSize); +00293 <a class="code" href="classNLMISC_1_1Exception.html#n0">_Reason</a> = str; +00294 <a class="code" href="debug_8h.html#a1">nlinfo</a>(<font class="stringliteral">"Exception will be launched: %s"</font>, <a class="code" href="classNLMISC_1_1Exception.html#n0">_Reason</a>.c_str()); +00295 } +00296 }; +00297 +<a name="l00298"></a><a class="code" href="structNLMISC_1_1EUnknownVar.html">00298</a> <font class="keyword">struct </font>EUnknownVar : <font class="keyword">public</font> EConfigFile +00299 { +<a name="l00300"></a><a class="code" href="structNLMISC_1_1EUnknownVar.html#a0">00300</a> <a class="code" href="structNLMISC_1_1EUnknownVar.html#a0">EUnknownVar</a> (<font class="keyword">const</font> std::string &filename, <font class="keyword">const</font> std::string &varName) +00301 { +00302 <font class="keyword">static</font> <font class="keywordtype">char</font> str[NLMISC::MaxCStringSize]; +00303 <a class="code" href="namespaceNLMISC.html#a211">smprintf</a> (str, NLMISC::MaxCStringSize, <font class="stringliteral">"variable \"%s\" not found in file \"%s\""</font>, varName.c_str (), filename.c_str()); +00304 <a class="code" href="classNLMISC_1_1Exception.html#n0">_Reason</a> = str; +00305 <a class="code" href="debug_8h.html#a1">nlinfo</a>(<font class="stringliteral">"Exception will be launched: %s"</font>, <a class="code" href="classNLMISC_1_1Exception.html#n0">_Reason</a>.c_str()); +00306 } +00307 }; +00308 +<a name="l00309"></a><a class="code" href="structNLMISC_1_1EParseError.html">00309</a> <font class="keyword">struct </font>EParseError : <font class="keyword">public</font> EConfigFile +00310 { +<a name="l00311"></a><a class="code" href="structNLMISC_1_1EParseError.html#a0">00311</a> <a class="code" href="structNLMISC_1_1EParseError.html#a0">EParseError</a> (<font class="keyword">const</font> std::string &fileName, <font class="keywordtype">int</font> currentLine) +00312 { +00313 <font class="keyword">static</font> <font class="keywordtype">char</font> str[NLMISC::MaxCStringSize]; +00314 <a class="code" href="namespaceNLMISC.html#a211">smprintf</a> (str, NLMISC::MaxCStringSize, <font class="stringliteral">"Parse error on the \"%s\" file, line %d"</font>, fileName.c_str (), currentLine); +00315 <a class="code" href="classNLMISC_1_1Exception.html#n0">_Reason</a> = str; +00316 <a class="code" href="debug_8h.html#a1">nlinfo</a>(<font class="stringliteral">"Exception will be launched: %s"</font>, <a class="code" href="classNLMISC_1_1Exception.html#n0">_Reason</a>.c_str()); +00317 } +00318 }; +00319 +<a name="l00320"></a><a class="code" href="structNLMISC_1_1EFileNotFound.html">00320</a> <font class="keyword">struct </font>EFileNotFound : <font class="keyword">public</font> EConfigFile +00321 { +<a name="l00322"></a><a class="code" href="structNLMISC_1_1EFileNotFound.html#a0">00322</a> <a class="code" href="structNLMISC_1_1EFileNotFound.html#a0">EFileNotFound</a> (<font class="keyword">const</font> std::string &fileName) +00323 { +00324 <font class="keyword">static</font> <font class="keywordtype">char</font> str[NLMISC::MaxCStringSize]; +00325 <a class="code" href="namespaceNLMISC.html#a211">smprintf</a> (str, NLMISC::MaxCStringSize, <font class="stringliteral">"File \"%s\" not found"</font>, fileName.c_str ()); +00326 <a class="code" href="classNLMISC_1_1Exception.html#n0">_Reason</a> = str; +00327 } +00328 }; +00329 +00330 } <font class="comment">// NLMISC</font> +00331 +00332 <font class="preprocessor">#endif // NL_CONFIG_FILE_H</font> +00333 <font class="preprocessor"></font> +00334 <font class="comment">/* End of config_file.h */</font> +</pre></div> + +<!-- footer --> +<BR><FONT Size=+5> </FONT> +</TD> +<TD WIDTH=15><IMG SRC=http://www.nevrax.org/inc/img/pixel.gif WIDTH=15 HEIGHT=15 BORDER=0 ALT=""></TD> +</TR> +</TABLE> +</BODY> +</HTML> |