zengine/doc/html/ZE__ZConfigFile_8h-source.html

95 lines
7.1 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
<title>/include/ZE_ZConfigFile.h Source File</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
</head><body>
<!-- Generated by Doxygen 1.2.18 -->
<center>
<a class="qindex" href="index.html">Main Page</a> &nbsp; <a class="qindex" href="namespaces.html">Namespace List</a> &nbsp; <a class="qindex" href="hierarchy.html">Class Hierarchy</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="namespacemembers.html">Namespace Members</a> &nbsp; <a class="qindex" href="functions.html">Compound Members</a> &nbsp; <a class="qindex" href="globals.html">File Members</a> &nbsp; </center>
<hr><h1>/include/ZE_ZConfigFile.h</h1><a href="ZE__ZConfigFile_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre>00001 <span class="comment">/*******************************************************************************</span>
00002 <span class="comment"> This file is Part of the ZEngine Library for SDL Game Development.</span>
00003 <span class="comment"> Copyright (C) 2002 ConceptOfZero.net</span>
00004 <span class="comment"></span>
00005 <span class="comment"> Licensed under the BSD License, see licensing.txt.</span>
00006 <span class="comment"></span>
00007 <span class="comment"> The maintainer of this library is James Turk (jturk@conceptofzero.net) </span>
00008 <span class="comment"> and the home of this Library is http://www.conceptofzero.net/</span>
00009 <span class="comment">*******************************************************************************/</span>
00010
00025 <span class="preprocessor">#ifndef __ze_zconfigfile_h__</span>
00026 <span class="preprocessor"></span><span class="preprocessor">#define __ze_zconfigfile_h__</span>
00027 <span class="preprocessor"></span>
00028 <span class="preprocessor">#include "<a class="code" href="ZE__ZObject_8h.html">ZE_ZObject.h</a>"</span> <span class="comment">//included even though ZCF isn't derived (to obtain all other needed headers)</span>
00029
00030 <span class="keyword">namespace </span>ZE
00031 {
00032
<a name="l00038"></a><a class="code" href="classZE_1_1ZConfigFile.html">00038</a> <span class="keyword">class </span><a class="code" href="classZE_1_1ZConfigFile.html">ZConfigFile</a> : <span class="keyword">public</span> <a class="code" href="classZE_1_1ZObject.html">ZObject</a>
00039 {
00040 <span class="keyword">private</span>:
00041
00042 <span class="comment">//Private Types//</span>
00043
00044
<a name="l00051"></a><a class="code" href="classZE_1_1ZConfigFile_1_1ZCF__Variable.html">00051</a> <span class="keyword">class </span><a class="code" href="classZE_1_1ZConfigFile_1_1ZCF__Variable.html">ZCF_Variable</a>
00052 {
00053 <span class="keyword">public</span>:
<a name="l00055"></a><a class="code" href="classZE_1_1ZConfigFile_1_1ZCF__Variable.html#m0">00055</a> string <a class="code" href="classZE_1_1ZConfigFile_1_1ZCF__Variable.html#m0">var</a>;
<a name="l00057"></a><a class="code" href="classZE_1_1ZConfigFile_1_1ZCF__Variable.html#m1">00057</a> string <a class="code" href="classZE_1_1ZConfigFile_1_1ZCF__Variable.html#m1">val</a>;
00058 };
00059
<a name="l00065"></a><a class="code" href="classZE_1_1ZConfigFile_1_1ZCF__Section.html">00065</a> <span class="keyword">class </span><a class="code" href="classZE_1_1ZConfigFile_1_1ZCF__Section.html">ZCF_Section</a>
00066 {
00067 <span class="keyword">public</span>:
<a name="l00069"></a><a class="code" href="classZE_1_1ZConfigFile_1_1ZCF__Section.html#m0">00069</a> string <a class="code" href="classZE_1_1ZConfigFile_1_1ZCF__Section.html#m0">section</a>;
<a name="l00071"></a><a class="code" href="classZE_1_1ZConfigFile_1_1ZCF__Section.html#m1">00071</a> list&lt;ZCF_Variable&gt; <a class="code" href="classZE_1_1ZConfigFile_1_1ZCF__Section.html#m1">varList</a>;
00072 };
00073
<a name="l00075"></a><a class="code" href="classZE_1_1ZConfigFile.html#o0">00075</a> list&lt;ZCF_Section&gt; <a class="code" href="classZE_1_1ZConfigFile.html#o0">mFileLayout</a>;
00076
<a name="l00078"></a><a class="code" href="classZE_1_1ZConfigFile.html#o1">00078</a> string <a class="code" href="classZE_1_1ZConfigFile.html#o1">mFilename</a>;
00079
00087 string <a class="code" href="classZE_1_1ZConfigFile.html#c0">CleanString</a>(string str);
00088
00089 <span class="keywordtype">bool</span> Exists(string sec);
00090 <span class="keywordtype">bool</span> Exists(string sec, string var);
00091 <span class="keywordtype">void</span> SetVariable(string sec, string var, string val);
00092 string GetVariable(string sec, string var, string defVal);
00093
00094 <span class="keyword">public</span>:
00095
00101 <a class="code" href="classZE_1_1ZConfigFile.html#a0">ZConfigFile</a>();
00102
00109 <a class="code" href="classZE_1_1ZConfigFile.html#a0">ZConfigFile</a>(string filename);
00110
00116 <a class="code" href="classZE_1_1ZConfigFile.html#a2">~ZConfigFile</a>();
00117
00124 <span class="keywordtype">void</span> <a class="code" href="classZE_1_1ZConfigFile.html#a3">Process</a>(string filename);
00125
00135 <span class="keywordtype">int</span> <a class="code" href="classZE_1_1ZConfigFile.html#a4">GetInt</a>(string section, string var, <span class="keywordtype">int</span> defVal);
00136
00147 <span class="keywordtype">bool</span> <a class="code" href="classZE_1_1ZConfigFile.html#a5">GetBool</a>(string section, string var, <span class="keywordtype">bool</span> defVal);
00148
00158 string <a class="code" href="classZE_1_1ZConfigFile.html#a6">GetString</a>(string section, string var, string defVal);
00159
00169 <span class="keywordtype">void</span> <a class="code" href="classZE_1_1ZConfigFile.html#a7">SetInt</a>(string section, string var, <span class="keywordtype">int</span> val);
00170
00180 <span class="keywordtype">void</span> <a class="code" href="classZE_1_1ZConfigFile.html#a8">SetBool</a>(string section, string var, <span class="keywordtype">bool</span> val);
00181
00191 <span class="keywordtype">void</span> <a class="code" href="classZE_1_1ZConfigFile.html#a9">SetString</a>(string section, string var, string val);
00192
00198 <span class="keywordtype">void</span> <a class="code" href="classZE_1_1ZConfigFile.html#a10">Flush</a>();
00199
00205 <span class="keywordtype">void</span> <a class="code" href="classZE_1_1ZConfigFile.html#a11">Close</a>();
00206 };
00207
00208 }
00209
00210 <span class="preprocessor">#endif //__ze_zconfigfile_h__</span>
</pre></div><hr><address style="align: right;"><small>Generated on Sun Dec 1 02:44:14 2002 for ZEngine by
<a href="http://www.doxygen.org/index.html">
<img src="doxygen.png" alt="doxygen" align="middle" border=0
width=110 height=53></a>1.2.18 </small></address>
</body>
</html>