<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <title>Barry: Barry::ConfigFile Class Reference</title> <link href="tabs.css" rel="stylesheet" type="text/css"/> <link href="doxygen.css" rel="stylesheet" type="text/css"/> </head> <body> <!-- Generated by Doxygen 1.6.2-20100208 --> <div class="navigation" id="top"> <div class="tabs"> <ul> <li><a href="index.html"><span>Main Page</span></a></li> <li><a href="modules.html"><span>Modules</span></a></li> <li><a href="namespaces.html"><span>Namespaces</span></a></li> <li class="current"><a href="annotated.html"><span>Classes</span></a></li> <li><a href="files.html"><span>Files</span></a></li> <li><a href="dirs.html"><span>Directories</span></a></li> </ul> </div> <div class="tabs"> <ul> <li><a href="annotated.html"><span>Class List</span></a></li> <li><a href="classes.html"><span>Class Index</span></a></li> <li><a href="hierarchy.html"><span>Class Hierarchy</span></a></li> <li><a href="functions.html"><span>Class Members</span></a></li> </ul> </div> <div class="navpath"><a class="el" href="namespaceBarry.html">Barry</a>::<a class="el" href="classBarry_1_1ConfigFile.html">ConfigFile</a> </div> </div> <div class="contents"> <h1>Barry::ConfigFile Class Reference</h1><!-- doxytag: class="Barry::ConfigFile" --><div class="dynheader"> Collaboration diagram for Barry::ConfigFile:</div> <div class="dynsection"> <div class="center"><img src="classBarry_1_1ConfigFile__coll__graph.png" border="0" usemap="#Barry_1_1ConfigFile_coll__map" alt="Collaboration graph"/></div> <map name="Barry_1_1ConfigFile_coll__map" id="Barry_1_1ConfigFile_coll__map"> <area shape="rect" id="node2" href="classBarry_1_1Pin.html" title="Barry::Pin" alt="" coords="5,187,85,218"/><area shape="rect" id="node4" href="classBarry_1_1ConfigFile_1_1DBListType.html" title="Barry::ConfigFile::DBListType" alt="" coords="109,187,312,218"/><area shape="rect" id="node6" title="STL class." alt="" coords="117,105,283,135"/><area shape="rect" id="node10" title="STL class." alt="" coords="348,187,428,218"/><area shape="rect" id="node12" title="STL class." alt="" coords="307,105,475,135"/></map> <center><span class="legend">[<a href="graph_legend.html">legend</a>]</span></center></div> <p><a href="classBarry_1_1ConfigFile-members.html">List of all members.</a></p> <table border="0" cellpadding="0" cellspacing="0"> <tr><td colspan="2"><h2>Classes</h2></td></tr> <tr><td class="memItemLeft" align="right" valign="top">class </td><td class="memItemRight" valign="bottom"><a class="el" href="classBarry_1_1ConfigFile_1_1DBListType.html">DBListType</a></td></tr> <tr><td colspan="2"><h2>Public Member Functions</h2></td></tr> <tr><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classBarry_1_1ConfigFile.html#a77c215fe70a81595f6d79402cdabeecd">ConfigFile</a> (<a class="el" href="classBarry_1_1Pin.html">Barry::Pin</a> pin)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Loads config file for the given pin, and ends up in an unenlightened state. <a href="#a77c215fe70a81595f6d79402cdabeecd"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classBarry_1_1ConfigFile.html#a0c2f123cc6772f9a2d63a9996fe5d209">ConfigFile</a> (<a class="el" href="classBarry_1_1Pin.html">Barry::Pin</a> pin, const <a class="el" href="classBarry_1_1DatabaseDatabase.html">Barry::DatabaseDatabase</a> &db)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Opens and loads config file for given pin, and calls Enlighten Throws <a class="el" href="classBarry_1_1ConfigFileError.html" title="Thrown by the ConfigFile class when encountering a serious system error while loading...">ConfigFileError</a> on error. <a href="#a0c2f123cc6772f9a2d63a9996fe5d209"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classBarry_1_1ConfigFile.html#a94b2a621e4a027c9463e99095b49fc03">Save</a> ()</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Saves current device's config, overwriting or creating a config file. <a href="#a94b2a621e4a027c9463e99095b49fc03"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classBarry_1_1ConfigFile.html#a7e238ad959a35f9d31644e3221d6edec">Enlighten</a> (const <a class="el" href="classBarry_1_1DatabaseDatabase.html">Barry::DatabaseDatabase</a> &db)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Compares a given databasedatabase from a real device with the current config. <a href="#a7e238ad959a35f9d31644e3221d6edec"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classBarry_1_1ConfigFile.html#a9b1e30ff7cd571b3506f041ece85b014">SetBackupList</a> (const <a class="el" href="classBarry_1_1ConfigFile_1_1DBListType.html">DBListType</a> &list)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Sets list with new config. <a href="#a9b1e30ff7cd571b3506f041ece85b014"></a><br/></td></tr> <tr><td colspan="2"><h2>Static Public Member Functions</h2></td></tr> <tr><td class="memItemLeft" align="right" valign="top">static bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classBarry_1_1ConfigFile.html#af06a343c8df13c801348ed0b4d781b46">CheckPath</a> (const std::string &path, std::string *perr=0)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Checks that the path in path exists, and if not, creates it. <a href="#af06a343c8df13c801348ed0b4d781b46"></a><br/></td></tr> <tr><td colspan="2"><h2>Protected Member Functions</h2></td></tr> <tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classBarry_1_1ConfigFile.html#a7c1c8e24d85b013ba83159c0f7a2a12d">Load</a> ()</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Attempt to load the configuration file, but do not fail if not available. <a href="#a7c1c8e24d85b013ba83159c0f7a2a12d"></a><br/></td></tr> </table> <hr/><a name="_details"></a><h2>Detailed Description</h2> <p>Definition at line <a class="el" href="configfile_8h_source.html#l00032">32</a> of file <a class="el" href="configfile_8h_source.html">configfile.h</a>.</p> <hr/><h2>Constructor & Destructor Documentation</h2> <a class="anchor" id="a77c215fe70a81595f6d79402cdabeecd"></a><!-- doxytag: member="Barry::ConfigFile::ConfigFile" ref="a77c215fe70a81595f6d79402cdabeecd" args="(Barry::Pin pin)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">Barry::ConfigFile::ConfigFile </td> <td>(</td> <td class="paramtype"><a class="el" href="classBarry_1_1Pin.html">Barry::Pin</a> </td> <td class="paramname"> <em>pin</em></td> <td> ) </td> <td><code> [explicit]</code></td> </tr> </table> </div> <div class="memdoc"> <p>Loads config file for the given pin, and ends up in an unenlightened state. </p> <p>Throws <a class="el" href="classBarry_1_1ConfigFileError.html" title="Thrown by the ConfigFile class when encountering a serious system error while loading...">ConfigFileError</a> on error, but it is not an error if the config does not exist. Never use this if you have a <a class="el" href="classBarry_1_1DatabaseDatabase.html">DatabaseDatabase</a> object! This ctor is only for temporary loading of config data. </p> <p>Definition at line <a class="el" href="configfile_8cc_source.html#l00056">56</a> of file <a class="el" href="configfile_8cc_source.html">configfile.cc</a>.</p> <p>References <a class="el" href="configfile_8cc_source.html#l00121">Load()</a>.</p> <p><div class="dynheader"> Here is the call graph for this function:</div> <div class="dynsection"> <div class="center"><img src="classBarry_1_1ConfigFile_a77c215fe70a81595f6d79402cdabeecd_cgraph.png" border="0" usemap="#classBarry_1_1ConfigFile_a77c215fe70a81595f6d79402cdabeecd_cgraph_map" alt=""></div> <map name="classBarry_1_1ConfigFile_a77c215fe70a81595f6d79402cdabeecd_cgraph_map" id="classBarry_1_1ConfigFile_a77c215fe70a81595f6d79402cdabeecd_cgraph"> <area shape="rect" id="node3" href="classBarry_1_1ConfigFile.html#a7c1c8e24d85b013ba83159c0f7a2a12d" title="Attempt to load the configuration file, but do not fail if not available." alt="" coords="245,5,408,35"/><area shape="rect" id="node5" href="classBarry_1_1ConfigFile.html#af06a343c8df13c801348ed0b4d781b46" title="Checks that the path in path exists, and if not, creates it." alt="" coords="457,5,652,35"/></map> </div> </p> </div> </div> <a class="anchor" id="a0c2f123cc6772f9a2d63a9996fe5d209"></a><!-- doxytag: member="Barry::ConfigFile::ConfigFile" ref="a0c2f123cc6772f9a2d63a9996fe5d209" args="(Barry::Pin pin, const Barry::DatabaseDatabase &db)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">Barry::ConfigFile::ConfigFile </td> <td>(</td> <td class="paramtype"><a class="el" href="classBarry_1_1Pin.html">Barry::Pin</a> </td> <td class="paramname"> <em>pin</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">const <a class="el" href="classBarry_1_1DatabaseDatabase.html">Barry::DatabaseDatabase</a> & </td> <td class="paramname"> <em>db</em></td><td> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td><td></td> </tr> </table> </div> <div class="memdoc"> <p>Opens and loads config file for given pin, and calls Enlighten Throws <a class="el" href="classBarry_1_1ConfigFileError.html" title="Thrown by the ConfigFile class when encountering a serious system error while loading...">ConfigFileError</a> on error. </p> <p>Should never fail unless passed a bad pin, or if unable to get current user info.</p> <p>Should never fail unless passed a bad pin. </p> <p>Definition at line <a class="el" href="configfile_8cc_source.html#l00072">72</a> of file <a class="el" href="configfile_8cc_source.html">configfile.cc</a>.</p> <p>References <a class="el" href="configfile_8cc_source.html#l00223">Enlighten()</a>, and <a class="el" href="configfile_8cc_source.html#l00121">Load()</a>.</p> <p><div class="dynheader"> Here is the call graph for this function:</div> <div class="dynsection"> <div class="center"><img src="classBarry_1_1ConfigFile_a0c2f123cc6772f9a2d63a9996fe5d209_cgraph.png" border="0" usemap="#classBarry_1_1ConfigFile_a0c2f123cc6772f9a2d63a9996fe5d209_cgraph_map" alt=""></div> <map name="classBarry_1_1ConfigFile_a0c2f123cc6772f9a2d63a9996fe5d209_cgraph_map" id="classBarry_1_1ConfigFile_a0c2f123cc6772f9a2d63a9996fe5d209_cgraph"> <area shape="rect" id="node3" href="classBarry_1_1ConfigFile.html#a7e238ad959a35f9d31644e3221d6edec" title="Compares a given databasedatabase from a real device with the current config." alt="" coords="245,5,429,35"/><area shape="rect" id="node5" href="classBarry_1_1ConfigFile.html#a7c1c8e24d85b013ba83159c0f7a2a12d" title="Attempt to load the configuration file, but do not fail if not available." alt="" coords="256,58,419,89"/><area shape="rect" id="node7" href="classBarry_1_1ConfigFile.html#af06a343c8df13c801348ed0b4d781b46" title="Checks that the path in path exists, and if not, creates it." alt="" coords="479,58,673,89"/></map> </div> </p> </div> </div> <hr/><h2>Member Function Documentation</h2> <a class="anchor" id="af06a343c8df13c801348ed0b4d781b46"></a><!-- doxytag: member="Barry::ConfigFile::CheckPath" ref="af06a343c8df13c801348ed0b4d781b46" args="(const std::string &path, std::string *perr=0)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">bool Barry::ConfigFile::CheckPath </td> <td>(</td> <td class="paramtype">const std::string & </td> <td class="paramname"> <em>path</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">std::string * </td> <td class="paramname"> <em>perr</em> = <code>0</code></td><td> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td><td><code> [static]</code></td> </tr> </table> </div> <div class="memdoc"> <p>Checks that the path in path exists, and if not, creates it. </p> <p>Returns false if unable to create path, true if ok. </p> <p>Definition at line <a class="el" href="configfile_8cc_source.html#l00286">286</a> of file <a class="el" href="configfile_8cc_source.html">configfile.cc</a>.</p> <p>Referenced by <a class="el" href="configfile_8cc_source.html#l00121">Load()</a>, <a class="el" href="configfile_8cc_source.html#l00413">Barry::GlobalConfigFile::Save()</a>, and <a class="el" href="configfile_8cc_source.html#l00182">Save()</a>.</p> <p><div class="dynheader"> Here is the caller graph for this function:</div> <div class="dynsection"> <div class="center"><img src="classBarry_1_1ConfigFile_af06a343c8df13c801348ed0b4d781b46_icgraph.png" border="0" usemap="#classBarry_1_1ConfigFile_af06a343c8df13c801348ed0b4d781b46_icgraph_map" alt=""></div> <map name="classBarry_1_1ConfigFile_af06a343c8df13c801348ed0b4d781b46_icgraph_map" id="classBarry_1_1ConfigFile_af06a343c8df13c801348ed0b4d781b46_icgraph"> <area shape="rect" id="node3" href="classBarry_1_1ConfigFile.html#a7c1c8e24d85b013ba83159c0f7a2a12d" title="Attempt to load the configuration file, but do not fail if not available." alt="" coords="271,5,433,35"/><area shape="rect" id="node7" href="classBarry_1_1GlobalConfigFile.html#a51eb5ad1d623f66e4bb3c7b8d43eeebb" title="Save the current global config, overwriting or creating as needed." alt="" coords="251,58,453,89"/><area shape="rect" id="node9" href="classBarry_1_1ConfigFile.html#a94b2a621e4a027c9463e99095b49fc03" title="Saves current device's config, overwriting or creating a config file." alt="" coords="271,111,433,142"/><area shape="rect" id="node5" href="classBarry_1_1ConfigFile.html#a77c215fe70a81595f6d79402cdabeecd" title="Loads config file for the given pin, and ends up in an unenlightened state." alt="" coords="501,5,693,35"/></map> </div> </p> </div> </div> <a class="anchor" id="a7e238ad959a35f9d31644e3221d6edec"></a><!-- doxytag: member="Barry::ConfigFile::Enlighten" ref="a7e238ad959a35f9d31644e3221d6edec" args="(const Barry::DatabaseDatabase &db)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">void Barry::ConfigFile::Enlighten </td> <td>(</td> <td class="paramtype">const <a class="el" href="classBarry_1_1DatabaseDatabase.html">Barry::DatabaseDatabase</a> & </td> <td class="paramname"> <em>db</em></td> <td> ) </td> <td></td> </tr> </table> </div> <div class="memdoc"> <p>Compares a given databasedatabase from a real device with the current config. </p> <p>If not yet configured, initialize with valid defaults. </p> <p>Definition at line <a class="el" href="configfile_8cc_source.html#l00223">223</a> of file <a class="el" href="configfile_8cc_source.html">configfile.cc</a>.</p> <p>Referenced by <a class="el" href="configfile_8cc_source.html#l00072">ConfigFile()</a>.</p> <p><div class="dynheader"> Here is the caller graph for this function:</div> <div class="dynsection"> <div class="center"><img src="classBarry_1_1ConfigFile_a7e238ad959a35f9d31644e3221d6edec_icgraph.png" border="0" usemap="#classBarry_1_1ConfigFile_a7e238ad959a35f9d31644e3221d6edec_icgraph_map" alt=""></div> <map name="classBarry_1_1ConfigFile_a7e238ad959a35f9d31644e3221d6edec_icgraph_map" id="classBarry_1_1ConfigFile_a7e238ad959a35f9d31644e3221d6edec_icgraph"> <area shape="rect" id="node3" href="classBarry_1_1ConfigFile.html#a0c2f123cc6772f9a2d63a9996fe5d209" title="Opens and loads config file for given pin, and calls Enlighten Throws ConfigFileError..." alt="" coords="237,5,429,35"/></map> </div> </p> </div> </div> <a class="anchor" id="a7c1c8e24d85b013ba83159c0f7a2a12d"></a><!-- doxytag: member="Barry::ConfigFile::Load" ref="a7c1c8e24d85b013ba83159c0f7a2a12d" args="()" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">void Barry::ConfigFile::Load </td> <td>(</td> <td class="paramname"></td> <td> ) </td> <td><code> [protected]</code></td> </tr> </table> </div> <div class="memdoc"> <p>Attempt to load the configuration file, but do not fail if not available. </p> <p>Definition at line <a class="el" href="configfile_8cc_source.html#l00121">121</a> of file <a class="el" href="configfile_8cc_source.html">configfile.cc</a>.</p> <p>References <a class="el" href="configfile_8cc_source.html#l00286">CheckPath()</a>.</p> <p>Referenced by <a class="el" href="configfile_8cc_source.html#l00056">ConfigFile()</a>.</p> <p><div class="dynheader"> Here is the call graph for this function:</div> <div class="dynsection"> <div class="center"><img src="classBarry_1_1ConfigFile_a7c1c8e24d85b013ba83159c0f7a2a12d_cgraph.png" border="0" usemap="#classBarry_1_1ConfigFile_a7c1c8e24d85b013ba83159c0f7a2a12d_cgraph_map" alt=""></div> <map name="classBarry_1_1ConfigFile_a7c1c8e24d85b013ba83159c0f7a2a12d_cgraph_map" id="classBarry_1_1ConfigFile_a7c1c8e24d85b013ba83159c0f7a2a12d_cgraph"> <area shape="rect" id="node3" href="classBarry_1_1ConfigFile.html#af06a343c8df13c801348ed0b4d781b46" title="Checks that the path in path exists, and if not, creates it." alt="" coords="217,5,412,35"/></map> </div> </p> <p><div class="dynheader"> Here is the caller graph for this function:</div> <div class="dynsection"> <div class="center"><img src="classBarry_1_1ConfigFile_a7c1c8e24d85b013ba83159c0f7a2a12d_icgraph.png" border="0" usemap="#classBarry_1_1ConfigFile_a7c1c8e24d85b013ba83159c0f7a2a12d_icgraph_map" alt=""></div> <map name="classBarry_1_1ConfigFile_a7c1c8e24d85b013ba83159c0f7a2a12d_icgraph_map" id="classBarry_1_1ConfigFile_a7c1c8e24d85b013ba83159c0f7a2a12d_icgraph"> <area shape="rect" id="node3" href="classBarry_1_1ConfigFile.html#a77c215fe70a81595f6d79402cdabeecd" title="Loads config file for the given pin, and ends up in an unenlightened state." alt="" coords="216,5,408,35"/></map> </div> </p> </div> </div> <a class="anchor" id="a94b2a621e4a027c9463e99095b49fc03"></a><!-- doxytag: member="Barry::ConfigFile::Save" ref="a94b2a621e4a027c9463e99095b49fc03" args="()" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">bool Barry::ConfigFile::Save </td> <td>(</td> <td class="paramname"></td> <td> ) </td> <td></td> </tr> </table> </div> <div class="memdoc"> <p>Saves current device's config, overwriting or creating a config file. </p> <p>Definition at line <a class="el" href="configfile_8cc_source.html#l00182">182</a> of file <a class="el" href="configfile_8cc_source.html">configfile.cc</a>.</p> <p>References <a class="el" href="configfile_8cc_source.html#l00286">CheckPath()</a>.</p> <p><div class="dynheader"> Here is the call graph for this function:</div> <div class="dynsection"> <div class="center"><img src="classBarry_1_1ConfigFile_a94b2a621e4a027c9463e99095b49fc03_cgraph.png" border="0" usemap="#classBarry_1_1ConfigFile_a94b2a621e4a027c9463e99095b49fc03_cgraph_map" alt=""></div> <map name="classBarry_1_1ConfigFile_a94b2a621e4a027c9463e99095b49fc03_cgraph_map" id="classBarry_1_1ConfigFile_a94b2a621e4a027c9463e99095b49fc03_cgraph"> <area shape="rect" id="node3" href="classBarry_1_1ConfigFile.html#af06a343c8df13c801348ed0b4d781b46" title="Checks that the path in path exists, and if not, creates it." alt="" coords="217,5,412,35"/></map> </div> </p> </div> </div> <a class="anchor" id="a9b1e30ff7cd571b3506f041ece85b014"></a><!-- doxytag: member="Barry::ConfigFile::SetBackupList" ref="a9b1e30ff7cd571b3506f041ece85b014" args="(const DBListType &list)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">void Barry::ConfigFile::SetBackupList </td> <td>(</td> <td class="paramtype">const <a class="el" href="classBarry_1_1ConfigFile_1_1DBListType.html">DBListType</a> & </td> <td class="paramname"> <em>list</em></td> <td> ) </td> <td></td> </tr> </table> </div> <div class="memdoc"> <p>Sets list with new config. </p> <p>Definition at line <a class="el" href="configfile_8cc_source.html#l00251">251</a> of file <a class="el" href="configfile_8cc_source.html">configfile.cc</a>.</p> </div> </div> <hr/>The documentation for this class was generated from the following files:<ul> <li><a class="el" href="configfile_8h_source.html">configfile.h</a></li> <li><a class="el" href="configfile_8cc_source.html">configfile.cc</a></li> </ul> </div> <hr class="footer"/><address style="text-align: right;"><small>Generated by <a href="http://www.doxygen.org/index.html"> <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.2-20100208 </small></address> </body> </html>