<!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.3-rc2 --> <center> <a class="qindex" href="index.html">Main Page</a> <a class="qindex" href="namespaces.html">Namespace 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> </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 2D game development.</span> 00003 <span class="comment"> Copyright (C) 2002, 2003 James Turk</span> 00004 <span class="comment"></span> 00005 <span class="comment"> Licensed under a BSD-style license.</span> 00006 <span class="comment"></span> 00007 <span class="comment"> The maintainer of this library is James Turk (james@conceptofzero.net) </span> 00008 <span class="comment"> and the home of this Library is http://www.zengine.sourceforge.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__ZEngine_8h.html">ZE_ZEngine.h</a>"</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> 00039 { 00040 <span class="keyword">private</span>: 00041 00042 <span class="comment">//Private Types//</span> 00043 <a name="l00050"></a><a class="code" href="classZE_1_1ZConfigFile_1_1ZCF__Variable.html">00050</a> <span class="keyword">class </span><a class="code" href="classZE_1_1ZConfigFile_1_1ZCF__Variable.html">ZCF_Variable</a> 00051 { 00052 <span class="keyword">public</span>: <a name="l00054"></a><a class="code" href="classZE_1_1ZConfigFile_1_1ZCF__Variable.html#m0">00054</a> string <a class="code" href="classZE_1_1ZConfigFile_1_1ZCF__Variable.html#m0">var</a>; <a name="l00056"></a><a class="code" href="classZE_1_1ZConfigFile_1_1ZCF__Variable.html#m1">00056</a> string <a class="code" href="classZE_1_1ZConfigFile_1_1ZCF__Variable.html#m1">val</a>; 00057 }; 00058 <a name="l00064"></a><a class="code" href="classZE_1_1ZConfigFile_1_1ZCF__Section.html">00064</a> <span class="keyword">class </span><a class="code" href="classZE_1_1ZConfigFile_1_1ZCF__Section.html">ZCF_Section</a> 00065 { 00066 <span class="keyword">public</span>: <a name="l00068"></a><a class="code" href="classZE_1_1ZConfigFile_1_1ZCF__Section.html#m0">00068</a> string <a class="code" href="classZE_1_1ZConfigFile_1_1ZCF__Section.html#m0">section</a>; <a name="l00070"></a><a class="code" href="classZE_1_1ZConfigFile_1_1ZCF__Section.html#m1">00070</a> list<ZCF_Variable> <a class="code" href="classZE_1_1ZConfigFile_1_1ZCF__Section.html#m1">varList</a>; 00071 }; 00072 00073 <span class="keyword">protected</span>: <a name="l00075"></a><a class="code" href="classZE_1_1ZConfigFile.html#n0">00075</a> list<ZCF_Section> <a class="code" href="classZE_1_1ZConfigFile.html#n0">rFileLayout</a>; <a name="l00077"></a><a class="code" href="classZE_1_1ZConfigFile.html#n1">00077</a> string <a class="code" href="classZE_1_1ZConfigFile.html#n1">rFilename</a>; 00078 00086 string <a class="code" href="classZE_1_1ZConfigFile.html#b0">CleanString</a>(string str) <span class="keyword">const</span>; 00087 00095 <span class="keywordtype">bool</span> <a class="code" href="classZE_1_1ZConfigFile.html#b1">Exists</a>(string sec) <span class="keyword">const</span>; 00096 00105 <span class="keywordtype">bool</span> <a class="code" href="classZE_1_1ZConfigFile.html#b1">Exists</a>(string sec, string var) <span class="keyword">const</span>; 00106 00115 <span class="keywordtype">void</span> <a class="code" href="classZE_1_1ZConfigFile.html#b3">SetVariable</a>(string sec, string var, string val); 00116 00126 string <a class="code" href="classZE_1_1ZConfigFile.html#b4">GetVariable</a>(string sec, string var, string defVal) <span class="keyword">const</span>; 00127 00128 <span class="keyword">public</span>: 00129 00135 <a class="code" href="classZE_1_1ZConfigFile.html#a0">ZConfigFile</a>(); 00136 00143 <a class="code" href="classZE_1_1ZConfigFile.html#a0">ZConfigFile</a>(string filename); 00144 00150 <span class="keyword">virtual</span> <a class="code" href="classZE_1_1ZConfigFile.html#a2">~ZConfigFile</a>(); 00151 00158 <span class="keywordtype">void</span> <a class="code" href="classZE_1_1ZConfigFile.html#a3">Process</a>(string filename); 00159 00170 <span class="keywordtype">float</span> <a class="code" href="classZE_1_1ZConfigFile.html#a4">GetFloat</a>(string section, string var, <span class="keywordtype">float</span> defVal) <span class="keyword">const</span>; 00171 00181 <span class="keywordtype">int</span> <a class="code" href="classZE_1_1ZConfigFile.html#a5">GetInt</a>(string section, string var, <span class="keywordtype">int</span> defVal) <span class="keyword">const</span>; 00182 00193 <span class="keywordtype">bool</span> <a class="code" href="classZE_1_1ZConfigFile.html#a6">GetBool</a>(string section, string var, <span class="keywordtype">bool</span> defVal) <span class="keyword">const</span>; 00194 00204 string <a class="code" href="classZE_1_1ZConfigFile.html#a7">GetString</a>(string section, string var, string defVal) <span class="keyword">const</span>; 00205 00216 <span class="keywordtype">void</span> <a class="code" href="classZE_1_1ZConfigFile.html#a8">SetFloat</a>(string section, string var, <span class="keywordtype">float</span> val); 00217 00227 <span class="keywordtype">void</span> <a class="code" href="classZE_1_1ZConfigFile.html#a9">SetInt</a>(string section, string var, <span class="keywordtype">int</span> val); 00228 00238 <span class="keywordtype">void</span> <a class="code" href="classZE_1_1ZConfigFile.html#a10">SetBool</a>(string section, string var, <span class="keywordtype">bool</span> val); 00239 00249 <span class="keywordtype">void</span> <a class="code" href="classZE_1_1ZConfigFile.html#a11">SetString</a>(string section, string var, string val); 00250 00256 <span class="keywordtype">void</span> <a class="code" href="classZE_1_1ZConfigFile.html#a12">Flush</a>(); 00257 00263 <span class="keywordtype">void</span> <a class="code" href="classZE_1_1ZConfigFile.html#a13">Close</a>(); 00264 }; 00265 00266 } 00267 00268 <span class="preprocessor">#endif //__ze_zconfigfile_h__</span> </pre></div><hr><address style="align: right;"><small>Generated on Sun Apr 27 22:34:35 2003 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.3-rc2 </small></address> </body> </html>