<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8"> <title>incron: incroncfg.h Source File</title> <link href="doxygen.css" rel="stylesheet" type="text/css"> <link href="tabs.css" rel="stylesheet" type="text/css"> </head><body> <!-- Generated by Doxygen 1.5.6 --> <div class="navigation" id="top"> <div class="tabs"> <ul> <li><a href="index.html"><span>Main Page</span></a></li> <li><a href="annotated.html"><span>Classes</span></a></li> <li class="current"><a href="files.html"><span>Files</span></a></li> </ul> </div> <h1>incroncfg.h</h1><a href="incroncfg_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <a name="l00003"></a>00003 <a name="l00017"></a>00017 <span class="preprocessor">#ifndef INCRONCFG_H_</span> <a name="l00018"></a>00018 <span class="preprocessor"></span><span class="preprocessor">#define INCRONCFG_H_</span> <a name="l00019"></a>00019 <span class="preprocessor"></span> <a name="l00020"></a>00020 <a name="l00021"></a>00021 <span class="preprocessor">#include <cstring></span> <a name="l00022"></a>00022 <span class="preprocessor">#include <map></span> <a name="l00023"></a>00023 <a name="l00025"></a>00025 <a name="l00030"></a><a class="code" href="classIncronCfg.html">00030</a> <span class="keyword">class </span><a class="code" href="classIncronCfg.html" title="Configuration class.">IncronCfg</a> <a name="l00031"></a>00031 { <a name="l00032"></a>00032 <span class="keyword">public</span>: <a name="l00033"></a>00033 <a name="l00035"></a>00035 <span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code" href="classIncronCfg.html#9fe219f0d98b358a32fd4e58804f1213" title="Initializes default configuration values.">Init</a>(); <a name="l00036"></a>00036 <a name="l00038"></a>00038 <a name="l00047"></a>00047 <span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code" href="classIncronCfg.html#c75ef9eab5f3878c4470b08231afd1e1" title="Loads configuration values.">Load</a>(<span class="keyword">const</span> std::string& rPath); <a name="l00048"></a>00048 <a name="l00050"></a>00050 <a name="l00059"></a>00059 <span class="keyword">static</span> <span class="keywordtype">bool</span> <a class="code" href="classIncronCfg.html#bcb3d392c025d0d93f9c9c49ef8f7d42" title="Retrieves a configuration value.">GetValue</a>(<span class="keyword">const</span> std::string& rKey, std::string& rVal); <a name="l00060"></a>00060 <a name="l00062"></a>00062 <a name="l00071"></a>00071 <span class="keyword">static</span> <span class="keywordtype">bool</span> <a class="code" href="classIncronCfg.html#bcb3d392c025d0d93f9c9c49ef8f7d42" title="Retrieves a configuration value.">GetValue</a>(<span class="keyword">const</span> std::string& rKey, <span class="keywordtype">int</span>& rVal); <a name="l00072"></a>00072 <a name="l00074"></a>00074 <a name="l00083"></a>00083 <span class="keyword">static</span> <span class="keywordtype">bool</span> <a class="code" href="classIncronCfg.html#bcb3d392c025d0d93f9c9c49ef8f7d42" title="Retrieves a configuration value.">GetValue</a>(<span class="keyword">const</span> std::string& rKey, <span class="keywordtype">unsigned</span>& rVal); <a name="l00084"></a>00084 <a name="l00086"></a>00086 <a name="l00095"></a>00095 <span class="keyword">static</span> <span class="keywordtype">bool</span> <a class="code" href="classIncronCfg.html#bcb3d392c025d0d93f9c9c49ef8f7d42" title="Retrieves a configuration value.">GetValue</a>(<span class="keyword">const</span> std::string& rKey, <span class="keywordtype">bool</span>& rVal); <a name="l00096"></a>00096 <a name="l00098"></a>00098 <a name="l00105"></a>00105 <span class="keyword">static</span> std::string <a class="code" href="classIncronCfg.html#68271df7c649d11b4c405422f21d779b" title="Builds a file path.">BuildPath</a>(<span class="keyword">const</span> std::string& rPath, <span class="keyword">const</span> std::string& rName); <a name="l00106"></a>00106 <a name="l00107"></a>00107 <span class="keyword">protected</span>: <a name="l00109"></a>00109 <a name="l00115"></a>00115 <span class="keyword">static</span> <span class="keywordtype">bool</span> <a class="code" href="classIncronCfg.html#fe4381ce8e57579dd59097192bd75ac6" title="Parses a line a attempts to get a key and a value.">ParseLine</a>(<span class="keyword">const</span> <span class="keywordtype">char</span>* s, std::string& rKey, std::string& rVal); <a name="l00116"></a>00116 <a name="l00118"></a>00118 <a name="l00122"></a>00122 <span class="keyword">static</span> <span class="keywordtype">bool</span> <a class="code" href="classIncronCfg.html#b995e931ef67fc62a833227332a10735" title="Checks whether a line is a comment.">IsComment</a>(<span class="keyword">const</span> <span class="keywordtype">char</span>* s); <a name="l00123"></a>00123 <a name="l00124"></a>00124 <span class="keyword">private</span>: <a name="l00125"></a>00125 <span class="keyword">static</span> std::map<std::string, std::string> m_values; <a name="l00126"></a>00126 <span class="keyword">static</span> std::map<std::string, std::string> m_defaults; <a name="l00127"></a>00127 }; <a name="l00128"></a>00128 <a name="l00129"></a>00129 <span class="preprocessor">#endif </span><span class="comment">/*INCRONCFG_H_*/</span> </pre></div></div> <hr size="1"><address style="text-align: right;"><small>Generated on Sun Jun 21 22:27:24 2009 for incron by <a href="http://www.doxygen.org/index.html"> <img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.6 </small></address> </body> </html>