<!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>EncodingFilterMgr 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>EncodingFilterMgr Class Reference</h1>This class is like a normal <a class="el" href="class_s_w_mgr.html">SWMgr</a>, but you can additonally specify which encoding you want to use. <a href="#_details">More...</a> <p> <code>#include <<a class="el" href="encfiltmgr_8h-source.html">encfiltmgr.h</a>></code> <p> Inheritance diagram for EncodingFilterMgr:<p><center><img src="class_encoding_filter_mgr__inherit__graph.png" border="0" usemap="#_encoding_filter_mgr__inherit__map" alt="Inheritance graph"></center> <map name="_encoding_filter_mgr__inherit__map"> <area href="class_markup_filter_mgr.html" shape="rect" coords="18,84,127,103" alt=""> </map> <center><font size="2">[<a href="graph_legend.html">legend</a>]</font></center><a href="class_encoding_filter_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_encoding_filter_mgr.html#a0">EncodingFilterMgr</a> (char encoding=ENC_UTF8)</td></tr> <tr><td> </td><td><font size=-1><em>Constructor of SWEncodingMgr.</em> <a href="#a0">More...</a><em></em></font><br><br></td></tr> <tr><td nowrap align=right valign=top><a name="a1" doxytag="EncodingFilterMgr::~EncodingFilterMgr"></a> </td><td valign=bottom><a class="el" href="class_encoding_filter_mgr.html#a1">~EncodingFilterMgr</a> ()</td></tr> <tr><td> </td><td><font size=-1><em>The destructor of SWEncodingMgr.</em></font><br><br></td></tr> <tr><td nowrap align=right valign=top>char </td><td valign=bottom><a class="el" href="class_encoding_filter_mgr.html#a2">Encoding</a> (char enc)</td></tr> <tr><td> </td><td><font size=-1><em>Markup sets/gets the encoding after initialization.</em> <a href="#a2">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_encoding_filter_mgr.html#a3">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="#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_encoding_filter_mgr.html#a4">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="#a4">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="EncodingFilterMgr::latin1utf8"></a> SWFilter * </td><td valign=bottom><b>latin1utf8</b></td></tr> <tr><td nowrap align=right valign=top><a name="n1" doxytag="EncodingFilterMgr::scsuutf8"></a> SWFilter * </td><td valign=bottom><b>scsuutf8</b></td></tr> <tr><td nowrap align=right valign=top><a name="n2" doxytag="EncodingFilterMgr::targetenc"></a> SWFilter * </td><td valign=bottom><b>targetenc</b></td></tr> <tr><td nowrap align=right valign=top><a name="n3" doxytag="EncodingFilterMgr::encoding"></a> char </td><td valign=bottom><b>encoding</b></td></tr> </table> <hr><a name="_details"></a><h2>Detailed Description</h2> This class is like a normal <a class="el" href="class_s_w_mgr.html">SWMgr</a>, but you can additonally specify which encoding you want to use. <p> <p> Definition at line <a class="el" href="encfiltmgr_8h-source.html#l00033">33</a> of file <a class="el" href="encfiltmgr_8h-source.html">encfiltmgr.h</a>.<hr><h2>Constructor & Destructor Documentation</h2> <a name="a0" doxytag="EncodingFilterMgr::EncodingFilterMgr"></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"> EncodingFilterMgr::EncodingFilterMgr </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top">char </td> <td class="mdname1" valign="top" nowrap> <em>encoding</em> = ENC_UTF8 </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> Constructor of SWEncodingMgr. <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 <a class="el" href="class_s_w_mgr.html">SWMgr</a> you can set autoload=false to load the modules with your own reimplemented function. </td></tr> <tr><td valign=top><em>encoding</em> </td><td> The desired encoding. </td></tr> </table> </dl> <p> Definition at line <a class="el" href="encfiltmgr_8cpp-source.html#l00041">41</a> of file <a class="el" href="encfiltmgr_8cpp-source.html">encfiltmgr.cpp</a>. <p> <div class="fragment"><pre>00042 : SWFilterMgr() { 00043 00044 scsuutf8 = <font class="keyword">new</font> <a class="code" href="class_s_c_s_u_u_t_f8.html">SCSUUTF8</a>(); 00045 latin1utf8 = <font class="keyword">new</font> <a class="code" href="class_latin1_u_t_f8.html">Latin1UTF8</a>(); 00046 00047 encoding = enc; 00048 00049 <font class="keywordflow">switch</font> (encoding) { 00050 <font class="keywordflow">case</font> ENC_LATIN1: 00051 targetenc = <font class="keyword">new</font> <a class="code" href="class_u_t_f8_latin1.html">UTF8Latin1</a>(); 00052 <font class="keywordflow">break</font>; 00053 <font class="keywordflow">case</font> ENC_UTF16: 00054 targetenc = <font class="keyword">new</font> <a class="code" href="class_u_t_f8_u_t_f16.html">UTF8UTF16</a>(); 00055 <font class="keywordflow">break</font>; 00056 <font class="keywordflow">case</font> ENC_RTF: 00057 targetenc = <font class="keyword">new</font> <a class="code" href="class_unicode_r_t_f.html">UnicodeRTF</a>(); 00058 <font class="keywordflow">break</font>; 00059 <font class="keywordflow">case</font> ENC_HTML: 00060 targetenc = <font class="keyword">new</font> <a class="code" href="class_u_t_f8_h_t_m_l.html">UTF8HTML</a>(); 00061 <font class="keywordflow">break</font>; 00062 <font class="keywordflow">default</font>: <font class="comment">// i.e. case ENC_UTF8</font> 00063 targetenc = NULL; 00064 } 00065 } </pre></div> </td> </tr> </table> <hr><h2>Member Function Documentation</h2> <a name="a4" doxytag="EncodingFilterMgr::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 EncodingFilterMgr::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> [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="encfiltmgr_8cpp-source.html#l00092">92</a> of file <a class="el" href="encfiltmgr_8cpp-source.html">encfiltmgr.cpp</a>. <p> References <a class="el" href="swmodule_8h-source.html#l00451">SWModule::AddEncodingFilter</a>(). <p> <div class="fragment"><pre>00092 { 00093 <font class="keywordflow">if</font> (targetenc) 00094 module-><a class="code" href="class_s_w_module.html#a45">AddEncodingFilter</a>(targetenc); 00095 } </pre></div> </td> </tr> </table> <a name="a3" doxytag="EncodingFilterMgr::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 EncodingFilterMgr::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> [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="encfiltmgr_8cpp-source.html#l00079">79</a> of file <a class="el" href="encfiltmgr_8cpp-source.html">encfiltmgr.cpp</a>. <p> References <a class="el" href="swmodule_8h-source.html#l00505">SWModule::AddRawFilter</a>(). <p> <div class="fragment"><pre>00079 { 00080 00081 ConfigEntMap::iterator entry; 00082 00083 string encoding = ((entry = section.find(<font class="stringliteral">"Encoding"</font>)) != section.end()) ? (*entry).second : (string)<font class="stringliteral">""</font>; 00084 <font class="keywordflow">if</font> (encoding.empty() || !stricmp(encoding.c_str(), <font class="stringliteral">"Latin-1"</font>)) { 00085 module-><a class="code" href="class_s_w_module.html#a51">AddRawFilter</a>(latin1utf8); 00086 } 00087 <font class="keywordflow">else</font> <font class="keywordflow">if</font> (!stricmp(encoding.c_str(), <font class="stringliteral">"SCSU"</font>)) { 00088 module-><a class="code" href="class_s_w_module.html#a51">AddRawFilter</a>(scsuutf8); 00089 } 00090 } </pre></div> </td> </tr> </table> <a name="a2" doxytag="EncodingFilterMgr::Encoding"></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"> char EncodingFilterMgr::Encoding </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top">char </td> <td class="mdname1" valign="top" nowrap> <em>enc</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> Markup sets/gets the encoding after initialization. <p> <dl compact><dt><b> Parameters: </b><dd> <table border=0 cellspacing=2 cellpadding=0> <tr><td valign=top><em>m</em> </td><td> The new encoding or ENC_UNKNOWN if you just want to get the current markup. </td></tr> </table> </dl><dl compact><dt><b> Returns: </b><dd> The current (possibly changed) encoding format. </dl> <p> Definition at line <a class="el" href="encfiltmgr_8cpp-source.html#l00104">104</a> of file <a class="el" href="encfiltmgr_8cpp-source.html">encfiltmgr.cpp</a>. <p> <div class="fragment"><pre>00104 { 00105 <font class="keywordflow">if</font> (enc && enc != encoding) { 00106 encoding = enc; 00107 SWFilter * oldfilter = targetenc; 00108 00109 <font class="keywordflow">switch</font> (encoding) { 00110 <font class="keywordflow">case</font> ENC_LATIN1: 00111 targetenc = <font class="keyword">new</font> <a class="code" href="class_u_t_f8_latin1.html">UTF8Latin1</a>(); 00112 <font class="keywordflow">break</font>; 00113 <font class="keywordflow">case</font> ENC_UTF16: 00114 targetenc = <font class="keyword">new</font> <a class="code" href="class_u_t_f8_u_t_f16.html">UTF8UTF16</a>(); 00115 <font class="keywordflow">break</font>; 00116 <font class="keywordflow">case</font> ENC_RTF: 00117 targetenc = <font class="keyword">new</font> <a class="code" href="class_unicode_r_t_f.html">UnicodeRTF</a>(); 00118 <font class="keywordflow">break</font>; 00119 <font class="keywordflow">case</font> ENC_HTML: 00120 targetenc = <font class="keyword">new</font> <a class="code" href="class_u_t_f8_h_t_m_l.html">UTF8HTML</a>(); 00121 <font class="keywordflow">break</font>; 00122 <font class="keywordflow">default</font>: <font class="comment">// i.e. case ENC_UTF8</font> 00123 targetenc = NULL; 00124 } 00125 00126 ModMap::const_iterator module; 00127 00128 <font class="keywordflow">if</font> (oldfilter != targetenc) { 00129 <font class="keywordflow">if</font> (oldfilter) { 00130 <font class="keywordflow">if</font> (!targetenc) { 00131 <font class="keywordflow">for</font> (module = getParentMgr()->Modules.begin(); module != getParentMgr()->Modules.end(); module++) 00132 module->second->RemoveRenderFilter(oldfilter); 00133 } 00134 <font class="keywordflow">else</font> { 00135 <font class="keywordflow">for</font> (module = getParentMgr()->Modules.begin(); module != getParentMgr()->Modules.end(); module++) 00136 module->second->ReplaceRenderFilter(oldfilter, targetenc); 00137 } 00138 <font class="keyword">delete</font> oldfilter; 00139 } 00140 <font class="keywordflow">else</font> <font class="keywordflow">if</font> (targetenc) { 00141 <font class="keywordflow">for</font> (module = getParentMgr()->Modules.begin(); module != getParentMgr()->Modules.end(); module++) 00142 module->second->AddRenderFilter(targetenc); 00143 } 00144 } 00145 00146 } 00147 <font class="keywordflow">return</font> encoding; 00148 } </pre></div> </td> </tr> </table> <hr>The documentation for this class was generated from the following files:<ul> <li><a class="el" href="encfiltmgr_8h-source.html">encfiltmgr.h</a><li><a class="el" href="encfiltmgr_8cpp-source.html">encfiltmgr.cpp</a></ul> <hr><address align="right"><small>Generated on Thu Jun 20 22:13:02 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>