<!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>SWMgr class Reference</title> <link href="doxygen.css" rel="stylesheet" type="text/css"> </head><body> <!-- Generated by Doxygen 1.2.15 --> <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="functions.html">Compound Members</a> </center> <hr><h1>SWMgr Class Reference</h1>SWMgr is the main class of the Sword library. <a href="#_details">More...</a> <p> <code>#include <<a class="el" href="swmgr_8h-source.html">swmgr.h</a>></code> <p> Collaboration diagram for SWMgr:<p><center><img src="class_s_w_mgr__coll__graph.png" border="0" usemap="#_s_w_mgr__coll__map" alt="Collaboration graph"></center> <map name="_s_w_mgr__coll__map"> <area href="class_s_w_config.html" shape="rect" coords="14,15,83,34" alt=""> </map> <center><font size="2">[<a href="graph_legend.html">legend</a>]</font></center><a href="class_s_w_mgr-members.html">List of all members.</a><table border=0 cellpadding=0 cellspacing=0> <tr><td colspan=2><br><h2>Public Methods</h2></td></tr> <tr><td nowrap align=right valign=top> </td><td valign=bottom><a class="el" href="class_s_w_mgr.html#a0">SWMgr</a> (<a class="el" href="class_s_w_config.html">SWConfig</a> *iconfig=0, <a class="el" href="class_s_w_config.html">SWConfig</a> *isysconfig=0, bool autoload=true, SWFilterMgr *filterMgr=0)</td></tr> <tr><td> </td><td><font size=-1><em>Constructor of SWMgr.</em> <a href="#a0">More...</a><em></em></font><br><br></td></tr> <tr><td nowrap align=right valign=top> </td><td valign=bottom><a class="el" href="class_s_w_mgr.html#a1">SWMgr</a> (SWFilterMgr *filterMgr)</td></tr> <tr><td nowrap align=right valign=top> </td><td valign=bottom><a class="el" href="class_s_w_mgr.html#a2">SWMgr</a> (const char *iConfigPath, bool autoload=true, SWFilterMgr *filterMgr=0)</td></tr> <tr><td nowrap align=right valign=top>virtual </td><td valign=bottom><a class="el" href="class_s_w_mgr.html#a3">~SWMgr</a> ()</td></tr> <tr><td> </td><td><font size=-1><em>The destructor of SWMgr.</em> <a href="#a3">More...</a><em></em></font><br><br></td></tr> <tr><td nowrap align=right valign=top>virtual void </td><td valign=bottom><a class="el" href="class_s_w_mgr.html#a4">InstallScan</a> (const char *dir)</td></tr> <tr><td> </td><td><font size=-1><em>Installs a scan for modules in the directory givan as parameter.</em> <a href="#a4">More...</a><em></em></font><br><br></td></tr> <tr><td nowrap align=right valign=top>virtual signed char </td><td valign=bottom><a class="el" href="class_s_w_mgr.html#a5">Load</a> ()</td></tr> <tr><td> </td><td><font size=-1><em>Load the modules.</em> <a href="#a5">More...</a><em></em></font><br><br></td></tr> <tr><td nowrap align=right valign=top>virtual void </td><td valign=bottom><a class="el" href="class_s_w_mgr.html#a6">setGlobalOption</a> (const char *option, const char *value)</td></tr> <tr><td> </td><td><font size=-1><em>Set a global option Set a global option using the parameters.</em> <a href="#a6">More...</a><em></em></font><br><br></td></tr> <tr><td nowrap align=right valign=top>virtual const char * </td><td valign=bottom><a class="el" href="class_s_w_mgr.html#a7">getGlobalOption</a> (const char *option)</td></tr> <tr><td> </td><td><font size=-1><em>Gives the value of the given option.</em> <a href="#a7">More...</a><em></em></font><br><br></td></tr> <tr><td nowrap align=right valign=top>virtual const char * </td><td valign=bottom><a class="el" href="class_s_w_mgr.html#a8">getGlobalOptionTip</a> (const char *option)</td></tr> <tr><td> </td><td><font size=-1><em>Gives a description for the given option.</em> <a href="#a8">More...</a><em></em></font><br><br></td></tr> <tr><td nowrap align=right valign=top>virtual OptionsList </td><td valign=bottom><a class="el" href="class_s_w_mgr.html#a9">getGlobalOptions</a> ()</td></tr> <tr><td> </td><td><font size=-1><em>A list of all availble options with the currently set values.</em> <a href="#a9">More...</a><em></em></font><br><br></td></tr> <tr><td nowrap align=right valign=top><a name="a10" doxytag="SWMgr::getGlobalOptionValues"></a> virtual OptionsList </td><td valign=bottom><b>getGlobalOptionValues</b> (const char *option)</td></tr> <tr><td nowrap align=right valign=top>virtual signed char </td><td valign=bottom><a class="el" href="class_s_w_mgr.html#a11">setCipherKey</a> (const char *modName, const char *key)</td></tr> <tr><td> </td><td><font size=-1><em>Sets the cipher key for the given module.</em> <a href="#a11">More...</a><em></em></font><br><br></td></tr> <tr><td colspan=2><br><h2>Static Public Methods</h2></td></tr> <tr><td nowrap align=right valign=top><a name="d0" doxytag="SWMgr::findConfig"></a> void </td><td valign=bottom><b>findConfig</b> (char *configType, char **<a class="el" href="class_s_w_mgr.html#m3">prefixPath</a>, char **configPath)</td></tr> <tr><td colspan=2><br><h2>Public Attributes</h2></td></tr> <tr><td nowrap align=right valign=top><a class="el" href="class_s_w_config.html">SWConfig</a> * </td><td valign=bottom><a class="el" href="class_s_w_mgr.html#m0">config</a></td></tr> <tr><td> </td><td><font size=-1><em>The global config object.</em> <a href="#m0">More...</a><em></em></font><br><br></td></tr> <tr><td nowrap align=right valign=top><a name="m1" doxytag="SWMgr::sysconfig"></a> <a class="el" href="class_s_w_config.html">SWConfig</a> * </td><td valign=bottom><b>sysconfig</b></td></tr> <tr><td nowrap align=right valign=top>ModMap </td><td valign=bottom><a class="el" href="class_s_w_mgr.html#m2">Modules</a></td></tr> <tr><td> </td><td><font size=-1><em>The map of available modules.</em> <a href="#m2">More...</a><em></em></font><br><br></td></tr> <tr><td nowrap align=right valign=top><a name="m3" doxytag="SWMgr::prefixPath"></a> char * </td><td valign=bottom><a class="el" href="class_s_w_mgr.html#m3">prefixPath</a></td></tr> <tr><td> </td><td><font size=-1><em>The path to your Sword directory.</em></font><br><br></td></tr> <tr><td nowrap align=right valign=top><a name="m4" doxytag="SWMgr::configPath"></a> char * </td><td valign=bottom><b>configPath</b></td></tr> <tr><td colspan=2><br><h2>Static Public Attributes</h2></td></tr> <tr><td nowrap align=right valign=top>bool </td><td valign=bottom><a class="el" href="class_s_w_mgr.html#p0">debug</a> = false</td></tr> <tr><td> </td><td><font size=-1><em>Enable / Disable debug output on runtime Set this to true to get more verbose output of SWMgr at runtime.</em> <a href="#p0">More...</a><em></em></font><br><br></td></tr> <tr><td nowrap align=right valign=top><a name="p1" doxytag="SWMgr::globalConfPath"></a> const char * </td><td valign=bottom><b>globalConfPath</b> = "/etc/sword.conf:/usr/local/etc/sword.conf"</td></tr> <tr><td colspan=2><br><h2>Protected Methods</h2></td></tr> <tr><td nowrap align=right valign=top><a name="b0" doxytag="SWMgr::CreateMods"></a> void </td><td valign=bottom><b>CreateMods</b> ()</td></tr> <tr><td nowrap align=right valign=top><a name="b1" doxytag="SWMgr::CreateMod"></a> <a class="el" href="class_s_w_module.html">SWModule</a> * </td><td valign=bottom><b>CreateMod</b> (string name, string driver, ConfigEntMap &section)</td></tr> <tr><td nowrap align=right valign=top><a name="b2" doxytag="SWMgr::DeleteMods"></a> void </td><td valign=bottom><b>DeleteMods</b> ()</td></tr> <tr><td nowrap align=right valign=top><a name="b3" doxytag="SWMgr::init"></a> virtual void </td><td valign=bottom><b>init</b> ()</td></tr> <tr><td nowrap align=right valign=top><a name="b4" doxytag="SWMgr::AddModToConfig"></a> virtual char </td><td valign=bottom><b>AddModToConfig</b> (int conffd, const char *fname)</td></tr> <tr><td nowrap align=right valign=top><a name="b5" doxytag="SWMgr::loadConfigDir"></a> virtual void </td><td valign=bottom><b>loadConfigDir</b> (const char *ipath)</td></tr> <tr><td nowrap align=right valign=top><a name="b6" doxytag="SWMgr::AddGlobalOptions"></a> virtual void </td><td valign=bottom><b>AddGlobalOptions</b> (<a class="el" href="class_s_w_module.html">SWModule</a> *module, ConfigEntMap &section, ConfigEntMap::iterator start, ConfigEntMap::iterator end)</td></tr> <tr><td nowrap align=right valign=top><a name="b7" doxytag="SWMgr::AddLocalOptions"></a> virtual void </td><td valign=bottom><b>AddLocalOptions</b> (<a class="el" href="class_s_w_module.html">SWModule</a> *module, ConfigEntMap &section, ConfigEntMap::iterator start, ConfigEntMap::iterator end)</td></tr> <tr><td nowrap align=right valign=top>virtual void </td><td valign=bottom><a class="el" href="class_s_w_mgr.html#b8">AddEncodingFilters</a> (<a class="el" href="class_s_w_module.html">SWModule</a> *module, ConfigEntMap &section)</td></tr> <tr><td> </td><td><font size=-1><em>Adds the encoding filters which are defined in "section" to the <a class="el" href="class_s_w_module.html">SWModule</a> object "module".</em> <a href="#b8">More...</a><em></em></font><br><br></td></tr> <tr><td nowrap align=right valign=top>virtual void </td><td valign=bottom><a class="el" href="class_s_w_mgr.html#b9">AddRenderFilters</a> (<a class="el" href="class_s_w_module.html">SWModule</a> *module, ConfigEntMap &section)</td></tr> <tr><td> </td><td><font size=-1><em>Adds the render filters which are defined in "section" to the <a class="el" href="class_s_w_module.html">SWModule</a> object "module".</em> <a href="#b9">More...</a><em></em></font><br><br></td></tr> <tr><td nowrap align=right valign=top>virtual void </td><td valign=bottom><a class="el" href="class_s_w_mgr.html#b10">AddStripFilters</a> (<a class="el" href="class_s_w_module.html">SWModule</a> *module, ConfigEntMap &section)</td></tr> <tr><td> </td><td><font size=-1><em>Adds the strip filters which are defined in "section" to the <a class="el" href="class_s_w_module.html">SWModule</a> object "module".</em> <a href="#b10">More...</a><em></em></font><br><br></td></tr> <tr><td nowrap align=right valign=top>virtual void </td><td valign=bottom><a class="el" href="class_s_w_mgr.html#b11">AddRawFilters</a> (<a class="el" href="class_s_w_module.html">SWModule</a> *module, ConfigEntMap &section)</td></tr> <tr><td> </td><td><font size=-1><em>Adds the raw filters which are defined in "section" to the <a class="el" href="class_s_w_module.html">SWModule</a> object "module".</em> <a href="#b11">More...</a><em></em></font><br><br></td></tr> <tr><td colspan=2><br><h2>Protected Attributes</h2></td></tr> <tr><td nowrap align=right valign=top><a name="n0" doxytag="SWMgr::filterMgr"></a> SWFilterMgr * </td><td valign=bottom><b>filterMgr</b></td></tr> <tr><td nowrap align=right valign=top><a name="n1" doxytag="SWMgr::myconfig"></a> <a class="el" href="class_s_w_config.html">SWConfig</a> * </td><td valign=bottom><b>myconfig</b></td></tr> <tr><td nowrap align=right valign=top><a name="n2" doxytag="SWMgr::mysysconfig"></a> <a class="el" href="class_s_w_config.html">SWConfig</a> * </td><td valign=bottom><b>mysysconfig</b></td></tr> <tr><td nowrap align=right valign=top><a name="n3" doxytag="SWMgr::homeConfig"></a> <a class="el" href="class_s_w_config.html">SWConfig</a> * </td><td valign=bottom><b>homeConfig</b></td></tr> <tr><td nowrap align=right valign=top><a name="n4" doxytag="SWMgr::configType"></a> char </td><td valign=bottom><b>configType</b></td></tr> <tr><td nowrap align=right valign=top><a name="n5" doxytag="SWMgr::optionFilters"></a> FilterMap </td><td valign=bottom><b>optionFilters</b></td></tr> <tr><td nowrap align=right valign=top><a name="n6" doxytag="SWMgr::cipherFilters"></a> FilterMap </td><td valign=bottom><b>cipherFilters</b></td></tr> <tr><td nowrap align=right valign=top><a name="n7" doxytag="SWMgr::gbfplain"></a> SWFilter * </td><td valign=bottom><b>gbfplain</b></td></tr> <tr><td nowrap align=right valign=top><a name="n8" doxytag="SWMgr::thmlplain"></a> SWFilter * </td><td valign=bottom><b>thmlplain</b></td></tr> <tr><td nowrap align=right valign=top><a name="n9" doxytag="SWMgr::cleanupFilters"></a> FilterList </td><td valign=bottom><b>cleanupFilters</b></td></tr> <tr><td nowrap align=right valign=top><a name="n10" doxytag="SWMgr::options"></a> OptionsList </td><td valign=bottom><b>options</b></td></tr> <tr><td colspan=2><br><h2>Private Methods</h2></td></tr> <tr><td nowrap align=right valign=top><a name="c0" doxytag="SWMgr::commonInit"></a> void </td><td valign=bottom><b>commonInit</b> (<a class="el" href="class_s_w_config.html">SWConfig</a> *iconfig, <a class="el" href="class_s_w_config.html">SWConfig</a> *isysconfig, bool autoload, SWFilterMgr *filterMgr)</td></tr> </table> <hr><a name="_details"></a><h2>Detailed Description</h2> SWMgr is the main class of the Sword library. <p> SWmgr manages the installed modules, the filters and global options like footnotes or strong numbers. The class SWMgr is the most important class of Sword. It is used to manage the installed modules. It also manages the filters (Render-, Strip- and Rawfilters). <p> To get the <a class="el" href="class_s_w_module.html">SWModule</a> objects of the instalelled modules use <a class="el" href="class_s_w_mgr.html#m2">Modules</a> for this. <dl compact><dt><b> See also: </b><dd> <a class="el" href="class_s_w_mgr.html#b11">AddRawFilters</a>(), <a class="el" href="class_s_w_mgr.html#b9">AddRenderFilters</a>(), <a class="el" href="class_s_w_mgr.html#b10">AddStripFilters</a>() </dl><dl compact><dt><b> Version: </b><dd> </dl><dl compact><dt><b> Id: </b><dd> swmgr.h,v 1.42 2002/03/22 05:26:34 scribe Exp </dl> <p> <p> Definition at line <a class="el" href="swmgr_8h-source.html#l00069">69</a> of file <a class="el" href="swmgr_8h-source.html">swmgr.h</a>.<hr><h2>Constructor & Destructor Documentation</h2> <a name="a0" doxytag="SWMgr::SWMgr"></a><p> <table width="100%" cellpadding="2" cellspacing="0" border="0"> <tr> <td class="md"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> SWMgr::SWMgr </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top"><a class="el" href="class_s_w_config.html">SWConfig</a> * </td> <td class="mdname" nowrap> <em>iconfig</em> = 0, </td> </tr> <tr> <td></td> <td></td> <td class="md" nowrap><a class="el" href="class_s_w_config.html">SWConfig</a> * </td> <td class="mdname" nowrap> <em>isysconfig</em> = 0, </td> </tr> <tr> <td></td> <td></td> <td class="md" nowrap>bool </td> <td class="mdname" nowrap> <em>autoload</em> = true, </td> </tr> <tr> <td></td> <td></td> <td class="md" nowrap>SWFilterMgr * </td> <td class="mdname" nowrap> <em>filterMgr</em> = 0</td> </tr> <tr> <td></td> <td class="md">) </td> <td class="md" colspan="2"></td> </tr> </table> </td> </tr> </table> <table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td> <p> Constructor of SWMgr. <p> <dl compact><dt><b> Parameters: </b><dd> <table border=0 cellspacing=2 cellpadding=0> <tr><td valign=top><em>iconfig</em> </td><td> </td></tr> <tr><td valign=top><em>isysconfig</em> </td><td> </td></tr> <tr><td valign=top><em>autoload</em> </td><td> If this bool is true the constructor starts loading the installed modules. If you reimplemented SWMgr you can set autoload=false to load the modules with your own reimplemented function. </td></tr> <tr><td valign=top><em>filterMgr</em> </td><td> an SWFilterMgr subclass to use to manager filters on modules THIS WILL BE DELETED BY SWMgr </td></tr> </table> </dl> <p> Definition at line <a class="el" href="swmgr_8cpp-source.html#l00179">179</a> of file <a class="el" href="swmgr_8cpp-source.html">swmgr.cpp</a>. <p> <div class="fragment"><pre>00179 { 00180 commonInit(iconfig, isysconfig, autoload, filterMgr); 00181 } </pre></div> </td> </tr> </table> <a name="a1" doxytag="SWMgr::SWMgr"></a><p> <table width="100%" cellpadding="2" cellspacing="0" border="0"> <tr> <td class="md"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> SWMgr::SWMgr </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top">SWFilterMgr * </td> <td class="mdname1" valign="top" nowrap> <em>filterMgr</em> </td> <td class="md" valign="top">) </td> <td class="md" nowrap></td> </tr> </table> </td> </tr> </table> <table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td> <p> <dl compact><dt><b> Parameters: </b><dd> <table border=0 cellspacing=2 cellpadding=0> <tr><td valign=top><em>filterMgr</em> </td><td> an SWFilterMgr subclass to use to manager filters on modules THIS WILL BE DELETED BY SWMgr </td></tr> </table> </dl> <p> Definition at line <a class="el" href="swmgr_8cpp-source.html#l00174">174</a> of file <a class="el" href="swmgr_8cpp-source.html">swmgr.cpp</a>. <p> <div class="fragment"><pre>00174 { 00175 commonInit(0, 0, <font class="keyword">true</font>, filterMgr); 00176 } </pre></div> </td> </tr> </table> <a name="a2" doxytag="SWMgr::SWMgr"></a><p> <table width="100%" cellpadding="2" cellspacing="0" border="0"> <tr> <td class="md"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> SWMgr::SWMgr </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top">const char * </td> <td class="mdname" nowrap> <em>iConfigPath</em>, </td> </tr> <tr> <td></td> <td></td> <td class="md" nowrap>bool </td> <td class="mdname" nowrap> <em>autoload</em> = true, </td> </tr> <tr> <td></td> <td></td> <td class="md" nowrap>SWFilterMgr * </td> <td class="mdname" nowrap> <em>filterMgr</em> = 0</td> </tr> <tr> <td></td> <td class="md">) </td> <td class="md" colspan="2"></td> </tr> </table> </td> </tr> </table> <table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td> <p> <dl compact><dt><b> Parameters: </b><dd> <table border=0 cellspacing=2 cellpadding=0> <tr><td valign=top><em>autoload</em> </td><td> If this bool is true the constructor starts loading the installed modules. If you reimplemented SWMgr you can set autoload=false to load the modules with your own reimplemented function. </td></tr> <tr><td valign=top><em>filterMgr</em> </td><td> an SWFilterMgr subclass to use to manager filters on modules THIS WILL BE DELETED BY SWMgr </td></tr> </table> </dl> <p> Definition at line <a class="el" href="swmgr_8cpp-source.html#l00207">207</a> of file <a class="el" href="swmgr_8cpp-source.html">swmgr.cpp</a>. <p> References <a class="el" href="swmgr_8h-source.html#l00145">config</a>, <a class="el" href="swmgr_8cpp-source.html#l00536">Load</a>(), and <a class="el" href="swmgr_8h-source.html#l00176">prefixPath</a>. <p> <div class="fragment"><pre>00207 { 00208 00209 string path; 00210 00211 this->filterMgr = filterMgr; 00212 <font class="keywordflow">if</font> (filterMgr) 00213 filterMgr->setParentMgr(<font class="keyword">this</font>); 00214 00215 init(); 00216 00217 path = iConfigPath; 00218 <font class="keywordflow">if</font> ((iConfigPath[strlen(iConfigPath)-1] != <font class="charliteral">'\\'</font>) && (iConfigPath[strlen(iConfigPath)-1] != <font class="charliteral">'/'</font>)) 00219 path += <font class="stringliteral">"/"</font>; 00220 <font class="keywordflow">if</font> (FileMgr::existsFile(path.c_str(), <font class="stringliteral">"mods.conf"</font>)) { 00221 stdstr(&<a class="code" href="class_s_w_mgr.html#m3">prefixPath</a>, path.c_str()); 00222 path += <font class="stringliteral">"mods.conf"</font>; 00223 stdstr(&configPath, path.c_str()); 00224 } 00225 <font class="keywordflow">else</font> { 00226 <font class="keywordflow">if</font> (FileMgr::existsDir(path.c_str(), <font class="stringliteral">"mods.d"</font>)) { 00227 stdstr(&<a class="code" href="class_s_w_mgr.html#m3">prefixPath</a>, path.c_str()); 00228 path += <font class="stringliteral">"mods.d"</font>; 00229 stdstr(&configPath, path.c_str()); 00230 configType = 1; 00231 } 00232 } 00233 00234 <a class="code" href="class_s_w_mgr.html#m0">config</a> = 0; 00235 sysconfig = 0; 00236 00237 <font class="keywordflow">if</font> (autoload && configPath) 00238 <a class="code" href="class_s_w_mgr.html#a5">Load</a>(); 00239 } </pre></div> </td> </tr> </table> <a name="a3" doxytag="SWMgr::~SWMgr"></a><p> <table width="100%" cellpadding="2" cellspacing="0" border="0"> <tr> <td class="md"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> SWMgr::~SWMgr </td> <td class="md" valign="top">( </td> <td class="mdname1" valign="top" nowrap> </td> <td class="md" valign="top">) </td> <td class="md" nowrap><code> [virtual]</code></td> </tr> </table> </td> </tr> </table> <table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td> <p> The destructor of SWMgr. <p> This function cleans up the modules and deletes the created object. Destroy the SWMgr at last object in your application, because otherwise you may experience crashes because the <a class="el" href="class_s_w_module.html">SWModule</a> objects become invalid. <p> Definition at line <a class="el" href="swmgr_8cpp-source.html#l00242">242</a> of file <a class="el" href="swmgr_8cpp-source.html">swmgr.cpp</a>. <p> References <a class="el" href="swmgr_8h-source.html#l00176">prefixPath</a>. <p> <div class="fragment"><pre>00242 { 00243 00244 DeleteMods(); 00245 00246 <font class="keywordflow">for</font> (FilterList::iterator it = cleanupFilters.begin(); it != cleanupFilters.end(); it++) 00247 <font class="keyword">delete</font> (*it); 00248 00249 <font class="keywordflow">if</font> (homeConfig) 00250 <font class="keyword">delete</font> homeConfig; 00251 00252 <font class="keywordflow">if</font> (myconfig) 00253 <font class="keyword">delete</font> myconfig; 00254 00255 <font class="keywordflow">if</font> (prefixPath) 00256 <font class="keyword">delete</font> [] <a class="code" href="class_s_w_mgr.html#m3">prefixPath</a>; 00257 00258 <font class="keywordflow">if</font> (configPath) 00259 <font class="keyword">delete</font> [] configPath; 00260 00261 <font class="keywordflow">if</font> (filterMgr) 00262 <font class="keyword">delete</font> filterMgr; 00263 } </pre></div> </td> </tr> </table> <hr><h2>Member Function Documentation</h2> <a name="b8" doxytag="SWMgr::AddEncodingFilters"></a><p> <table width="100%" cellpadding="2" cellspacing="0" border="0"> <tr> <td class="md"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> void SWMgr::AddEncodingFilters </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top"><a class="el" href="class_s_w_module.html">SWModule</a> * </td> <td class="mdname" nowrap> <em>module</em>, </td> </tr> <tr> <td></td> <td></td> <td class="md" nowrap>ConfigEntMap & </td> <td class="mdname" nowrap> <em>section</em></td> </tr> <tr> <td></td> <td class="md">) </td> <td class="md" colspan="2"><code> [protected, virtual]</code></td> </tr> </table> </td> </tr> </table> <table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td> <p> Adds the encoding filters which are defined in "section" to the <a class="el" href="class_s_w_module.html">SWModule</a> object "module". <p> <dl compact><dt><b> Parameters: </b><dd> <table border=0 cellspacing=2 cellpadding=0> <tr><td valign=top><em>module</em> </td><td> To this module the encoding filter(s) are added </td></tr> <tr><td valign=top><em>section</em> </td><td> We use this section to get a list of filters we should apply to the module </td></tr> </table> </dl> <p> Definition at line <a class="el" href="swmgr_8cpp-source.html#l00808">808</a> of file <a class="el" href="swmgr_8cpp-source.html">swmgr.cpp</a>. <p> <div class="fragment"><pre>00808 { 00809 00810 <font class="keywordflow">if</font> (filterMgr) 00811 filterMgr->AddEncodingFilters(module, section); 00812 } </pre></div> </td> </tr> </table> <a name="b11" doxytag="SWMgr::AddRawFilters"></a><p> <table width="100%" cellpadding="2" cellspacing="0" border="0"> <tr> <td class="md"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> void SWMgr::AddRawFilters </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top"><a class="el" href="class_s_w_module.html">SWModule</a> * </td> <td class="mdname" nowrap> <em>module</em>, </td> </tr> <tr> <td></td> <td></td> <td class="md" nowrap>ConfigEntMap & </td> <td class="mdname" nowrap> <em>section</em></td> </tr> <tr> <td></td> <td class="md">) </td> <td class="md" colspan="2"><code> [protected, virtual]</code></td> </tr> </table> </td> </tr> </table> <table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td> <p> Adds the raw filters which are defined in "section" to the <a class="el" href="class_s_w_module.html">SWModule</a> object "module". <p> <dl compact><dt><b> Parameters: </b><dd> <table border=0 cellspacing=2 cellpadding=0> <tr><td valign=top><em>module</em> </td><td> To this module the raw filter(s) are added </td></tr> <tr><td valign=top><em>section</em> </td><td> We use this section to get a list of filters we should apply to the module </td></tr> </table> </dl> <p> Definition at line <a class="el" href="swmgr_8cpp-source.html#l00791">791</a> of file <a class="el" href="swmgr_8cpp-source.html">swmgr.cpp</a>. <p> References <a class="el" href="swmodule_8h-source.html#l00505">SWModule::AddRawFilter</a>(), and <a class="el" href="swmodule_8cpp-source.html#l00135">SWModule::Name</a>(). <p> <div class="fragment"><pre>00791 { 00792 string sourceformat, cipherKey; 00793 ConfigEntMap::iterator entry; 00794 00795 cipherKey = ((entry = section.find(<font class="stringliteral">"CipherKey"</font>)) != section.end()) ? (*entry).second : (string)<font class="stringliteral">""</font>; 00796 <font class="keywordflow">if</font> (!cipherKey.empty()) { 00797 SWFilter *cipherFilter = <font class="keyword">new</font> CipherFilter(cipherKey.c_str()); 00798 cipherFilters.insert(FilterMap::value_type(module-><a class="code" href="class_s_w_module.html#a15">Name</a>(), cipherFilter)); 00799 cleanupFilters.push_back(cipherFilter); 00800 module-><a class="code" href="class_s_w_module.html#a51">AddRawFilter</a>(cipherFilter); 00801 } 00802 00803 <font class="keywordflow">if</font> (filterMgr) 00804 filterMgr->AddRawFilters(module, section); 00805 } </pre></div> </td> </tr> </table> <a name="b9" doxytag="SWMgr::AddRenderFilters"></a><p> <table width="100%" cellpadding="2" cellspacing="0" border="0"> <tr> <td class="md"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> void SWMgr::AddRenderFilters </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top"><a class="el" href="class_s_w_module.html">SWModule</a> * </td> <td class="mdname" nowrap> <em>module</em>, </td> </tr> <tr> <td></td> <td></td> <td class="md" nowrap>ConfigEntMap & </td> <td class="mdname" nowrap> <em>section</em></td> </tr> <tr> <td></td> <td class="md">) </td> <td class="md" colspan="2"><code> [protected, virtual]</code></td> </tr> </table> </td> </tr> </table> <table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td> <p> Adds the render filters which are defined in "section" to the <a class="el" href="class_s_w_module.html">SWModule</a> object "module". <p> <dl compact><dt><b> Parameters: </b><dd> <table border=0 cellspacing=2 cellpadding=0> <tr><td valign=top><em>module</em> </td><td> To this module the render filter(s) are added </td></tr> <tr><td valign=top><em>section</em> </td><td> We use this section to get a list of filters we should apply to the module </td></tr> </table> </dl> <p> Definition at line <a class="el" href="swmgr_8cpp-source.html#l00815">815</a> of file <a class="el" href="swmgr_8cpp-source.html">swmgr.cpp</a>. <p> <div class="fragment"><pre>00815 { 00816 string sourceformat; 00817 ConfigEntMap::iterator entry; 00818 00819 sourceformat = ((entry = section.find(<font class="stringliteral">"SourceType"</font>)) != section.end()) ? (*entry).second : (string)<font class="stringliteral">""</font>; 00820 00821 <font class="comment">// Temporary: To support old module types</font> 00822 <font class="comment">// TODO: Remove at 1.6.0 release?</font> 00823 <font class="keywordflow">if</font> (sourceformat.empty()) { 00824 sourceformat = ((entry = section.find(<font class="stringliteral">"ModDrv"</font>)) != section.end()) ? (*entry).second : (string)<font class="stringliteral">""</font>; 00825 <font class="keywordflow">if</font> (!stricmp(sourceformat.c_str(), <font class="stringliteral">"RawGBF"</font>)) 00826 sourceformat = <font class="stringliteral">"GBF"</font>; 00827 <font class="keywordflow">else</font> sourceformat = <font class="stringliteral">""</font>; 00828 } 00829 00830 <font class="comment">// process module - eg. follows</font> 00831 <font class="comment">// if (!stricmp(sourceformat.c_str(), "GBF")) {</font> 00832 <font class="comment">// module->AddRenderFilter(gbftortf);</font> 00833 <font class="comment">// }</font> 00834 00835 <font class="keywordflow">if</font> (filterMgr) 00836 filterMgr->AddRenderFilters(module, section); 00837 00838 } </pre></div> </td> </tr> </table> <a name="b10" doxytag="SWMgr::AddStripFilters"></a><p> <table width="100%" cellpadding="2" cellspacing="0" border="0"> <tr> <td class="md"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> void SWMgr::AddStripFilters </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top"><a class="el" href="class_s_w_module.html">SWModule</a> * </td> <td class="mdname" nowrap> <em>module</em>, </td> </tr> <tr> <td></td> <td></td> <td class="md" nowrap>ConfigEntMap & </td> <td class="mdname" nowrap> <em>section</em></td> </tr> <tr> <td></td> <td class="md">) </td> <td class="md" colspan="2"><code> [protected, virtual]</code></td> </tr> </table> </td> </tr> </table> <table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td> <p> Adds the strip filters which are defined in "section" to the <a class="el" href="class_s_w_module.html">SWModule</a> object "module". <p> <dl compact><dt><b> Parameters: </b><dd> <table border=0 cellspacing=2 cellpadding=0> <tr><td valign=top><em>module</em> </td><td> To this module the strip filter(s) are added </td></tr> <tr><td valign=top><em>section</em> </td><td> We use this section to get a list of filters we should apply to the module </td></tr> </table> </dl> <p> Definition at line <a class="el" href="swmgr_8cpp-source.html#l00841">841</a> of file <a class="el" href="swmgr_8cpp-source.html">swmgr.cpp</a>. <p> References <a class="el" href="swmodule_8h-source.html#l00488">SWModule::AddStripFilter</a>(). <p> <div class="fragment"><pre>00842 { 00843 string sourceformat; 00844 ConfigEntMap::iterator entry; 00845 00846 sourceformat = ((entry = section.find(<font class="stringliteral">"SourceType"</font>)) != section.end()) ? (*entry).second : (string)<font class="stringliteral">""</font>; 00847 <font class="comment">// Temporary: To support old module types</font> 00848 <font class="keywordflow">if</font> (sourceformat.empty()) { 00849 sourceformat = ((entry = section.find(<font class="stringliteral">"ModDrv"</font>)) != section.end()) ? (*entry).second : (string)<font class="stringliteral">""</font>; 00850 <font class="keywordflow">if</font> (!stricmp(sourceformat.c_str(), <font class="stringliteral">"RawGBF"</font>)) 00851 sourceformat = <font class="stringliteral">"GBF"</font>; 00852 <font class="keywordflow">else</font> sourceformat = <font class="stringliteral">""</font>; 00853 } 00854 00855 <font class="keywordflow">if</font> (!stricmp(sourceformat.c_str(), <font class="stringliteral">"GBF"</font>)) { 00856 module-><a class="code" href="class_s_w_module.html#a49">AddStripFilter</a>(gbfplain); 00857 } 00858 <font class="keywordflow">else</font> <font class="keywordflow">if</font> (!stricmp(sourceformat.c_str(), <font class="stringliteral">"ThML"</font>)) { 00859 module-><a class="code" href="class_s_w_module.html#a49">AddStripFilter</a>(thmlplain); 00860 } 00861 00862 <font class="keywordflow">if</font> (filterMgr) 00863 filterMgr->AddStripFilters(module, section); 00864 00865 } </pre></div> </td> </tr> </table> <a name="a7" doxytag="SWMgr::getGlobalOption"></a><p> <table width="100%" cellpadding="2" cellspacing="0" border="0"> <tr> <td class="md"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> const char * SWMgr::getGlobalOption </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top">const char * </td> <td class="mdname1" valign="top" nowrap> <em>option</em> </td> <td class="md" valign="top">) </td> <td class="md" nowrap><code> [virtual]</code></td> </tr> </table> </td> </tr> </table> <table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td> <p> Gives the value of the given option. <p> <dl compact><dt><b> Parameters: </b><dd> <table border=0 cellspacing=2 cellpadding=0> <tr><td valign=top><em>The</em> </td><td> option, which should be used to return the value of it </td></tr> </table> </dl><dl compact><dt><b> Returns: </b><dd> The value of the given option </dl> <p> Definition at line <a class="el" href="swmgr_8cpp-source.html#l00988">988</a> of file <a class="el" href="swmgr_8cpp-source.html">swmgr.cpp</a>. <p> <div class="fragment"><pre>00989 { 00990 <font class="keywordflow">for</font> (FilterMap::iterator it = optionFilters.begin(); it != optionFilters.end(); it++) { 00991 <font class="keywordflow">if</font> ((*it).second->getOptionName()) { 00992 <font class="keywordflow">if</font> (!stricmp(option, (*it).second->getOptionName())) 00993 <font class="keywordflow">return</font> (*it).second->getOptionValue(); 00994 } 00995 } 00996 <font class="keywordflow">return</font> 0; 00997 } </pre></div> </td> </tr> </table> <a name="a9" doxytag="SWMgr::getGlobalOptions"></a><p> <table width="100%" cellpadding="2" cellspacing="0" border="0"> <tr> <td class="md"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> OptionsList SWMgr::getGlobalOptions </td> <td class="md" valign="top">( </td> <td class="mdname1" valign="top" nowrap> </td> <td class="md" valign="top">) </td> <td class="md" nowrap><code> [virtual]</code></td> </tr> </table> </td> </tr> </table> <table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td> <p> A list of all availble options with the currently set values. <p> <dl compact><dt><b> Returns: </b><dd> This function returns a list of global options. </dl> <p> Definition at line <a class="el" href="swmgr_8cpp-source.html#l01012">1012</a> of file <a class="el" href="swmgr_8cpp-source.html">swmgr.cpp</a>. <p> <div class="fragment"><pre>01013 { 01014 <font class="keywordflow">return</font> options; 01015 } </pre></div> </td> </tr> </table> <a name="a8" doxytag="SWMgr::getGlobalOptionTip"></a><p> <table width="100%" cellpadding="2" cellspacing="0" border="0"> <tr> <td class="md"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> const char * SWMgr::getGlobalOptionTip </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top">const char * </td> <td class="mdname1" valign="top" nowrap> <em>option</em> </td> <td class="md" valign="top">) </td> <td class="md" nowrap><code> [virtual]</code></td> </tr> </table> </td> </tr> </table> <table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td> <p> Gives a description for the given option. <p> <dl compact><dt><b> Parameters: </b><dd> <table border=0 cellspacing=2 cellpadding=0> <tr><td valign=top><em>option</em> </td><td> The option, which should be used </td></tr> </table> </dl><dl compact><dt><b> Returns: </b><dd> A description of the given option </dl><dl compact><dt><b> See also: </b><dd> <a class="el" href="class_s_w_mgr.html#a6">setGlobalOption</a>, <a class="el" href="class_s_w_mgr.html#a7">getGlobalOption</a>, <a class="el" href="class_s_w_mgr.html#a9">getGlobalOptions</a> </dl> <p> Definition at line <a class="el" href="swmgr_8cpp-source.html#l01000">1000</a> of file <a class="el" href="swmgr_8cpp-source.html">swmgr.cpp</a>. <p> <div class="fragment"><pre>01001 { 01002 <font class="keywordflow">for</font> (FilterMap::iterator it = optionFilters.begin(); it != optionFilters.end(); it++) { 01003 <font class="keywordflow">if</font> ((*it).second->getOptionName()) { 01004 <font class="keywordflow">if</font> (!stricmp(option, (*it).second->getOptionName())) 01005 <font class="keywordflow">return</font> (*it).second->getOptionTip(); 01006 } 01007 } 01008 <font class="keywordflow">return</font> 0; 01009 } </pre></div> </td> </tr> </table> <a name="a4" doxytag="SWMgr::InstallScan"></a><p> <table width="100%" cellpadding="2" cellspacing="0" border="0"> <tr> <td class="md"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> void SWMgr::InstallScan </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top">const char * </td> <td class="mdname1" valign="top" nowrap> <em>dir</em> </td> <td class="md" valign="top">) </td> <td class="md" nowrap><code> [virtual]</code></td> </tr> </table> </td> </tr> </table> <table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td> <p> Installs a scan for modules in the directory givan as parameter. <p> <dl compact><dt><b> Parameters: </b><dd> <table border=0 cellspacing=2 cellpadding=0> <tr><td valign=top><em>dir</em> </td><td> The directory where new modules should be searched. </td></tr> </table> </dl> <p> Definition at line <a class="el" href="swmgr_8cpp-source.html#l00914">914</a> of file <a class="el" href="swmgr_8cpp-source.html">swmgr.cpp</a>. <p> References <a class="el" href="swmgr_8h-source.html#l00145">config</a>, and <a class="el" href="swconfig_8h-source.html#l00052">SWConfig::filename</a>. <p> Referenced by <a class="el" href="swmgr_8cpp-source.html#l00536">Load</a>(). <p> <div class="fragment"><pre>00915 { 00916 DIR *dir; 00917 <font class="keyword">struct </font>dirent *ent; 00918 <font class="keywordtype">int</font> conffd = 0; 00919 string newmodfile; 00920 string targetName; 00921 00922 <font class="keywordflow">if</font> (!access(dirname, 04)) { 00923 <font class="keywordflow">if</font> ((dir = opendir(dirname))) { 00924 rewinddir(dir); 00925 <font class="keywordflow">while</font> ((ent = readdir(dir))) { 00926 <font class="keywordflow">if</font> ((strcmp(ent->d_name, <font class="stringliteral">"."</font>)) && (strcmp(ent->d_name, <font class="stringliteral">".."</font>))) { 00927 newmodfile = dirname; 00928 <font class="keywordflow">if</font> ((dirname[strlen(dirname)-1] != <font class="charliteral">'\\'</font>) && (dirname[strlen(dirname)-1] != <font class="charliteral">'/'</font>)) 00929 newmodfile += <font class="stringliteral">"/"</font>; 00930 newmodfile += ent->d_name; 00931 <font class="keywordflow">if</font> (configType) { 00932 <font class="keywordflow">if</font> (<a class="code" href="class_s_w_mgr.html#m0">config</a> > 0) 00933 close(conffd); 00934 targetName = configPath; 00935 <font class="keywordflow">if</font> ((configPath[strlen(configPath)-1] != <font class="charliteral">'\\'</font>) && (configPath[strlen(configPath)-1] != <font class="charliteral">'/'</font>)) 00936 targetName += <font class="stringliteral">"/"</font>; 00937 targetName += ent->d_name; 00938 conffd = open(targetName.c_str(), O_WRONLY|O_CREAT, S_IREAD|S_IWRITE); 00939 } 00940 <font class="keywordflow">else</font> { 00941 <font class="keywordflow">if</font> (conffd < 1) { 00942 conffd = open(<a class="code" href="class_s_w_mgr.html#m0">config</a>-><a class="code" href="class_s_w_config.html#m0">filename</a>.c_str(), O_WRONLY|O_APPEND); 00943 <font class="keywordflow">if</font> (conffd > 0) 00944 lseek(conffd, 0L, SEEK_END); 00945 } 00946 } 00947 AddModToConfig(conffd, newmodfile.c_str()); 00948 unlink(newmodfile.c_str()); 00949 } 00950 } 00951 <font class="keywordflow">if</font> (conffd > 0) 00952 close(conffd); 00953 closedir(dir); 00954 } 00955 } 00956 } </pre></div> </td> </tr> </table> <a name="a5" doxytag="SWMgr::Load"></a><p> <table width="100%" cellpadding="2" cellspacing="0" border="0"> <tr> <td class="md"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> signed char SWMgr::Load </td> <td class="md" valign="top">( </td> <td class="mdname1" valign="top" nowrap> </td> <td class="md" valign="top">) </td> <td class="md" nowrap><code> [virtual]</code></td> </tr> </table> </td> </tr> </table> <table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td> <p> Load the modules. <p> Reimplement this function to use your own Load function, for example to use your own filters. <p> Definition at line <a class="el" href="swmgr_8cpp-source.html#l00536">536</a> of file <a class="el" href="swmgr_8cpp-source.html">swmgr.cpp</a>. <p> References <a class="el" href="swmgr_8h-source.html#l00145">config</a>, <a class="el" href="swmgr_8cpp-source.html#l00914">InstallScan</a>(), <a class="el" href="swconfig_8cpp-source.html#l00064">SWConfig::Load</a>(), <a class="el" href="swmgr_8h-source.html#l00172">Modules</a>, <a class="el" href="swmgr_8h-source.html#l00176">prefixPath</a>, and <a class="el" href="swconfig_8h-source.html#l00056">SWConfig::Sections</a>. <p> Referenced by <a class="el" href="swmgr_8cpp-source.html#l00207">SWMgr</a>(). <p> <div class="fragment"><pre>00536 { 00537 <font class="keywordtype">signed</font> <font class="keywordtype">char</font> ret = 0; 00538 00539 <font class="keywordflow">if</font> (!<a class="code" href="class_s_w_mgr.html#m0">config</a>) { <font class="comment">// If we weren't passed a config object at construction, find a config file</font> 00540 <font class="keywordflow">if</font> (!configPath) <font class="comment">// If we weren't passed a config path at construction...</font> 00541 findConfig(&configType, &<a class="code" href="class_s_w_mgr.html#m3">prefixPath</a>, &configPath); 00542 <font class="keywordflow">if</font> (configPath) { 00543 <font class="keywordflow">if</font> (configType) 00544 loadConfigDir(configPath); 00545 <font class="keywordflow">else</font> <a class="code" href="class_s_w_mgr.html#m0">config</a> = myconfig = <font class="keyword">new</font> <a class="code" href="class_s_w_config.html">SWConfig</a>(configPath); 00546 } 00547 } 00548 00549 <font class="keywordflow">if</font> (config) { 00550 SectionMap::iterator Sectloop, Sectend; 00551 ConfigEntMap::iterator Entryloop, Entryend; 00552 00553 DeleteMods(); 00554 00555 <font class="keywordflow">for</font> (Sectloop = <a class="code" href="class_s_w_mgr.html#m0">config</a>-><a class="code" href="class_s_w_config.html#m1">Sections</a>.lower_bound(<font class="stringliteral">"Globals"</font>), Sectend = <a class="code" href="class_s_w_mgr.html#m0">config</a>-><a class="code" href="class_s_w_config.html#m1">Sections</a>.upper_bound(<font class="stringliteral">"Globals"</font>); Sectloop != Sectend; Sectloop++) { <font class="comment">// scan thru all 'Globals' sections</font> 00556 <font class="keywordflow">for</font> (Entryloop = (*Sectloop).second.lower_bound(<font class="stringliteral">"AutoInstall"</font>), Entryend = (*Sectloop).second.upper_bound(<font class="stringliteral">"AutoInstall"</font>); Entryloop != Entryend; Entryloop++) <font class="comment">// scan thru all AutoInstall entries</font> 00557 <a class="code" href="class_s_w_mgr.html#a4">InstallScan</a>((*Entryloop).second.c_str()); <font class="comment">// Scan AutoInstall entry directory for new modules and install</font> 00558 } 00559 <font class="keywordflow">if</font> (configType) { <font class="comment">// force reload on config object because we may have installed new modules</font> 00560 <font class="keyword">delete</font> myconfig; 00561 <a class="code" href="class_s_w_mgr.html#m0">config</a> = myconfig = 0; 00562 loadConfigDir(configPath); 00563 } 00564 <font class="keywordflow">else</font> <a class="code" href="class_s_w_mgr.html#m0">config</a>-><a class="code" href="class_s_w_config.html#a2">Load</a>(); 00565 00566 CreateMods(); 00567 00568 <font class="comment">// augment config with ~/.sword/mods.d if it exists ---------------------</font> 00569 <font class="keywordtype">char</font> *envhomedir = getenv (<font class="stringliteral">"HOME"</font>); 00570 <font class="keywordflow">if</font> (envhomedir != NULL && configType != 2) { <font class="comment">// 2 = user only</font> 00571 string path = envhomedir; 00572 <font class="keywordflow">if</font> ((envhomedir[strlen(envhomedir)-1] != <font class="charliteral">'\\'</font>) && (envhomedir[strlen(envhomedir)-1] != <font class="charliteral">'/'</font>)) 00573 path += <font class="stringliteral">"/"</font>; 00574 path += <font class="stringliteral">".sword/"</font>; 00575 <font class="keywordflow">if</font> (FileMgr::existsDir(path.c_str(), <font class="stringliteral">"mods.d"</font>)) { 00576 <font class="keywordtype">char</font> *savePrefixPath = 0; 00577 <font class="keywordtype">char</font> *saveConfigPath = 0; 00578 <a class="code" href="class_s_w_config.html">SWConfig</a> *saveConfig = 0; 00579 stdstr(&savePrefixPath, <a class="code" href="class_s_w_mgr.html#m3">prefixPath</a>); 00580 stdstr(&<a class="code" href="class_s_w_mgr.html#m3">prefixPath</a>, path.c_str()); 00581 path += <font class="stringliteral">"mods.d"</font>; 00582 stdstr(&saveConfigPath, configPath); 00583 stdstr(&configPath, path.c_str()); 00584 saveConfig = <a class="code" href="class_s_w_mgr.html#m0">config</a>; 00585 <a class="code" href="class_s_w_mgr.html#m0">config</a> = myconfig = 0; 00586 loadConfigDir(configPath); 00587 00588 CreateMods(); 00589 00590 stdstr(&<a class="code" href="class_s_w_mgr.html#m3">prefixPath</a>, savePrefixPath); 00591 <font class="keyword">delete</font> []savePrefixPath; 00592 stdstr(&configPath, saveConfigPath); 00593 <font class="keyword">delete</font> []saveConfigPath; 00594 (*saveConfig) += *<a class="code" href="class_s_w_mgr.html#m0">config</a>; 00595 homeConfig = myconfig; 00596 <a class="code" href="class_s_w_mgr.html#m0">config</a> = myconfig = saveConfig; 00597 } 00598 } 00599 <font class="comment">// -------------------------------------------------------------------------</font> 00600 <font class="keywordflow">if</font> ( !<a class="code" href="class_s_w_mgr.html#m2">Modules</a>.size() ) <font class="comment">// config exists, but no modules</font> 00601 ret = 1; 00602 00603 } 00604 <font class="keywordflow">else</font> { 00605 SWLog::systemlog->LogError(<font class="stringliteral">"SWMgr: Can't find 'mods.conf' or 'mods.d'. Try setting:\n\tSWORD_PATH=<directory containing mods.conf>\n\tOr see the README file for a full description of setup options (%s)"</font>, (configPath) ? configPath : <font class="stringliteral">"<configPath is null>"</font>); 00606 ret = -1; 00607 } 00608 00609 <font class="keywordflow">return</font> ret; 00610 } </pre></div> </td> </tr> </table> <a name="a11" doxytag="SWMgr::setCipherKey"></a><p> <table width="100%" cellpadding="2" cellspacing="0" border="0"> <tr> <td class="md"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> signed char SWMgr::setCipherKey </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top">const char * </td> <td class="mdname" nowrap> <em>modName</em>, </td> </tr> <tr> <td></td> <td></td> <td class="md" nowrap>const char * </td> <td class="mdname" nowrap> <em>key</em></td> </tr> <tr> <td></td> <td class="md">) </td> <td class="md" colspan="2"><code> [virtual]</code></td> </tr> </table> </td> </tr> </table> <table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td> <p> Sets the cipher key for the given module. <p> This function updates the key at runtime, but it does not write to the config file. To write the new unlock key to the config file use code like this: <p> <div class="fragment"><pre> SectionMap::iterator section; ConfigEntMap::iterator entry; DIR *dir = opendir(configPath); <font class="keyword">struct </font>dirent *ent; <font class="keywordtype">char</font>* modFile; <font class="keywordflow">if</font> (dir) { <font class="comment">// find and update .conf file</font> rewinddir(dir); <font class="keywordflow">while</font> ((ent = readdir(dir))) { <font class="keywordflow">if</font> ((strcmp(ent->d_name, <font class="stringliteral">"."</font>)) && (strcmp(ent->d_name, <font class="stringliteral">".."</font>))) { modFile = m_backend->configPath; modFile += <font class="stringliteral">"/"</font>; modFile += ent->d_name; <a class="code" href="class_s_w_config.html">SWConfig</a> *myConfig = <font class="keyword">new</font> <a class="code" href="class_s_w_config.html">SWConfig</a>( modFile ); section = myConfig-><a class="code" href="class_s_w_config.html#m1">Sections</a>.find( m_module->Name() ); <font class="keywordflow">if</font> ( section != myConfig-><a class="code" href="class_s_w_config.html#m1">Sections</a>.end() ) { entry = section->second.find(<font class="stringliteral">"CipherKey"</font>); <font class="keywordflow">if</font> (entry != section->second.end()) { entry->second = unlockKey;<font class="comment">//set cipher key</font> myConfig-><a class="code" href="class_s_w_config.html#a3">Save</a>();<font class="comment">//save config file</font> } } <font class="keyword">delete</font> myConfig; } } } closedir(dir); </pre></div><dl compact><dt><b> Parameters: </b><dd> <table border=0 cellspacing=2 cellpadding=0> <tr><td valign=top><em>modName</em> </td><td> For this module we change the unlockKey </td></tr> </table> </dl><dl compact><dt><b> an key This is the new unlck key we use for te module.</b><dd> </dl> <p> Definition at line <a class="el" href="swmgr_8cpp-source.html#l01033">1033</a> of file <a class="el" href="swmgr_8cpp-source.html">swmgr.cpp</a>. <p> References <a class="el" href="swmgr_8h-source.html#l00172">Modules</a>. <p> <div class="fragment"><pre>01033 { 01034 FilterMap::iterator it; 01035 ModMap::iterator it2; 01036 01037 <font class="comment">// check for filter that already exists</font> 01038 it = cipherFilters.find(modName); 01039 <font class="keywordflow">if</font> (it != cipherFilters.end()) { 01040 ((CipherFilter *)(*it).second)->getCipher()->setCipherKey(key); 01041 <font class="keywordflow">return</font> 0; 01042 } 01043 <font class="comment">// check if module exists</font> 01044 <font class="keywordflow">else</font> { 01045 it2 = <a class="code" href="class_s_w_mgr.html#m2">Modules</a>.find(modName); 01046 <font class="keywordflow">if</font> (it2 != <a class="code" href="class_s_w_mgr.html#m2">Modules</a>.end()) { 01047 SWFilter *cipherFilter = <font class="keyword">new</font> CipherFilter(key); 01048 cipherFilters.insert(FilterMap::value_type(modName, cipherFilter)); 01049 cleanupFilters.push_back(cipherFilter); 01050 (*it2).second->AddRawFilter(cipherFilter); 01051 <font class="keywordflow">return</font> 0; 01052 } 01053 } 01054 <font class="keywordflow">return</font> -1; 01055 } </pre></div> </td> </tr> </table> <a name="a6" doxytag="SWMgr::setGlobalOption"></a><p> <table width="100%" cellpadding="2" cellspacing="0" border="0"> <tr> <td class="md"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> void SWMgr::setGlobalOption </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top">const char * </td> <td class="mdname" nowrap> <em>option</em>, </td> </tr> <tr> <td></td> <td></td> <td class="md" nowrap>const char * </td> <td class="mdname" nowrap> <em>value</em></td> </tr> <tr> <td></td> <td class="md">) </td> <td class="md" colspan="2"><code> [virtual]</code></td> </tr> </table> </td> </tr> </table> <table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td> <p> Set a global option Set a global option using the parameters. <p> A global option could be for example footnotes. <dl compact><dt><b> Parameters: </b><dd> <table border=0 cellspacing=2 cellpadding=0> <tr><td valign=top><em>option</em> </td><td> The name of the option, for which you want to change the value. Well known and often used values are "Footnotes" or "Strongs" </td></tr> <tr><td valign=top><em>value</em> </td><td> The value. Common values are "On" and "Off" </td></tr> </table> </dl> <p> Definition at line <a class="el" href="swmgr_8cpp-source.html#l00977">977</a> of file <a class="el" href="swmgr_8cpp-source.html">swmgr.cpp</a>. <p> <div class="fragment"><pre>00978 { 00979 <font class="keywordflow">for</font> (FilterMap::iterator it = optionFilters.begin(); it != optionFilters.end(); it++) { 00980 <font class="keywordflow">if</font> ((*it).second->getOptionName()) { 00981 <font class="keywordflow">if</font> (!stricmp(option, (*it).second->getOptionName())) 00982 (*it).second->setOptionValue(value); 00983 } 00984 } 00985 } </pre></div> </td> </tr> </table> <hr><h2>Member Data Documentation</h2> <a name="m0" doxytag="SWMgr::config"></a><p> <table width="100%" cellpadding="2" cellspacing="0" border="0"> <tr> <td class="md"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> <a class="el" href="class_s_w_config.html">SWConfig</a>* SWMgr::config </table> </td> </tr> </table> <table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td> <p> The global config object. <p> This is the global config object. It contains all items of all modules, so lookups of entries should use this config object. If you want to save a cipher key or other things to the module config file, DO NOT USE this object, because it would corrupt your config files after config->Save(). <p> If you want to write to the modules config file read the informtaion of <a class="el" href="class_s_w_mgr.html#a11">setCipherKey</a>() for an example of this. <p> Definition at line <a class="el" href="swmgr_8h-source.html#l00145">145</a> of file <a class="el" href="swmgr_8h-source.html">swmgr.h</a>. <p> Referenced by <a class="el" href="swmgr_8cpp-source.html#l00914">InstallScan</a>(), <a class="el" href="swmgr_8cpp-source.html#l00536">Load</a>(), and <a class="el" href="swmgr_8cpp-source.html#l00207">SWMgr</a>(). </td> </tr> </table> <a name="p0" doxytag="SWMgr::debug"></a><p> <table width="100%" cellpadding="2" cellspacing="0" border="0"> <tr> <td class="md"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> bool SWMgr::debug = false<code> [static]</code> </table> </td> </tr> </table> <table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td> <p> Enable / Disable debug output on runtime Set this to true to get more verbose output of SWMgr at runtime. <p> Set it to false to get no debug output. The default is "false". <p> Definition at line <a class="el" href="swmgr_8cpp-source.html#l00081">81</a> of file <a class="el" href="swmgr_8cpp-source.html">swmgr.cpp</a>. </td> </tr> </table> <a name="m2" doxytag="SWMgr::Modules"></a><p> <table width="100%" cellpadding="2" cellspacing="0" border="0"> <tr> <td class="md"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> ModMap SWMgr::Modules </table> </td> </tr> </table> <table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td> <p> The map of available modules. <p> This map contains thew list of available modules in Sword. Here's an example how to got through the map and how toc ehck for the module type. <p> <div class="fragment"><pre> ModMap::iterator it; <a class="code" href="class_s_w_module.html">SWModule</a>* curMod = 0; <font class="keywordflow">for</font> (it = <a class="code" href="class_s_w_mgr.html#m2">Modules</a>.begin(); it != <a class="code" href="class_s_w_mgr.html#m2">Modules</a>.end(); it++) { curMod = (*it).second; <font class="keywordflow">if</font> (!strcmp(curMod-><a class="code" href="class_s_w_module.html#a17">Type</a>(), <font class="stringliteral">"Biblical Texts"</font>)) { <font class="comment">//do something with curMod</font> } <font class="keywordflow">else</font> <font class="keywordflow">if</font> (!strcmp(curMod-><a class="code" href="class_s_w_module.html#a17">Type</a>(), <font class="stringliteral">"Commentaries"</font>)) { <font class="comment">//do something with curMod</font> } <font class="keywordflow">else</font> <font class="keywordflow">if</font> (!strcmp(curMod-><a class="code" href="class_s_w_module.html#a17">Type</a>(), <font class="stringliteral">"Lexicons / Dictionaries"</font>)) { <font class="comment">//do something with curMod</font> } } </pre></div> <p> Definition at line <a class="el" href="swmgr_8h-source.html#l00172">172</a> of file <a class="el" href="swmgr_8h-source.html">swmgr.h</a>. <p> Referenced by <a class="el" href="swmgr_8cpp-source.html#l00536">Load</a>(), and <a class="el" href="swmgr_8cpp-source.html#l01033">setCipherKey</a>(). </td> </tr> </table> <hr>The documentation for this class was generated from the following files:<ul> <li><a class="el" href="swmgr_8h-source.html">swmgr.h</a><li><a class="el" href="swmgr_8cpp-source.html">swmgr.cpp</a></ul> <hr><address align="right"><small>Generated on Thu Jun 20 22:13:03 2002 for The Sword Project 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.15 </small></address> </body> </html>