Sophie

Sophie

distrib > Mandriva > 9.1 > ppc > by-pkgid > a74ec78bdb789d910d054e3918f3f007 > files > 240

libsword1-devel-1.5.5-2mdk.ppc.rpm

<!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>ThMLHTML 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> &nbsp; <a class="qindex" href="namespaces.html">Namespace List</a> &nbsp; <a class="qindex" href="hierarchy.html">Class Hierarchy</a> &nbsp; <a class="qindex" href="classes.html">Alphabetical List</a> &nbsp; <a class="qindex" href="annotated.html">Compound List</a> &nbsp; <a class="qindex" href="files.html">File List</a> &nbsp; <a class="qindex" href="functions.html">Compound Members</a> &nbsp; </center>
<hr><h1>ThMLHTML  Class Reference</h1>this filter converts ThML text to HTML text. 
<a href="#_details">More...</a>
<p>
<code>#include &lt;<a class="el" href="thmlhtml_8h-source.html">thmlhtml.h</a>&gt;</code>
<p>
Inheritance diagram for ThMLHTML:<p><center><img src="class_th_m_l_h_t_m_l__inherit__graph.png" border="0" usemap="#_th_m_l_h_t_m_l__inherit__map" alt="Inheritance graph"></center>
<map name="_th_m_l_h_t_m_l__inherit__map">
<area href="class_s_w_basic_filter.html" shape="rect" coords="14,15,110,34" alt="">
</map>
<center><font size="2">[<a href="graph_legend.html">legend</a>]</font></center>Collaboration diagram for ThMLHTML:<p><center><img src="class_th_m_l_h_t_m_l__coll__graph.png" border="0" usemap="#_th_m_l_h_t_m_l__coll__map" alt="Collaboration graph"></center>
<map name="_th_m_l_h_t_m_l__coll__map">
<area href="class_s_w_basic_filter.html" shape="rect" coords="206,481,302,500" alt="">
<area href="class_s_w_key.html" shape="rect" coords="150,196,206,215" alt="">
<area href="class_s_w_module.html" shape="rect" coords="179,391,254,409" alt="">
<area href="class_list_key.html" shape="rect" coords="75,293,129,312" alt="">
<area href="class_s_w_object.html" shape="rect" coords="226,105,298,124" alt="">
<area href="class_s_w_display.html" shape="rect" coords="309,196,383,215" alt="">
<area href="class_s_w_class.html" shape="rect" coords="151,15,215,33" alt="">
</map>
<center><font size="2">[<a href="graph_legend.html">legend</a>]</font></center><a href="class_th_m_l_h_t_m_l-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><a name="a0" doxytag="ThMLHTML::ThMLHTML"></a>
&nbsp;</td><td valign=bottom><b>ThMLHTML</b> ()</td></tr>
<tr><td colspan=2><br><h2>Protected Methods</h2></td></tr>
<tr><td nowrap align=right valign=top>virtual bool&nbsp;</td><td valign=bottom><a class="el" href="class_th_m_l_h_t_m_l.html#b0">handleToken</a> (char **buf, const char *token, DualStringMap &amp;userData)</td></tr>
<tr><td>&nbsp;</td><td><font size=-1><em>This function is called for every token encountered in the input text.</em> <a href="#b0">More...</a><em></em></font><br><br></td></tr>
</table>
<hr><a name="_details"></a><h2>Detailed Description</h2>
this filter converts ThML text to HTML text.
<p>

<p>
Definition at line <a class="el" href="thmlhtml_8h-source.html#l00028">28</a> of file <a class="el" href="thmlhtml_8h-source.html">thmlhtml.h</a>.<hr><h2>Member Function Documentation</h2>
<a name="b0" doxytag="ThMLHTML::handleToken"></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 ThMLHTML::handleToken </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top">char **&nbsp;</td>
          <td class="mdname" nowrap>&nbsp; <em>buf</em>, </td>
        </tr>
        <tr>
          <td></td>
          <td></td>
          <td class="md" nowrap>const char *&nbsp;</td>
          <td class="mdname" nowrap>&nbsp; <em>token</em>, </td>
        </tr>
        <tr>
          <td></td>
          <td></td>
          <td class="md" nowrap>DualStringMap &amp;&nbsp;</td>
          <td class="mdname" nowrap>&nbsp; <em>userData</em></td>
        </tr>
        <tr>
          <td></td>
          <td class="md">)&nbsp;</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>
      &nbsp;
    </td>
    <td>

<p>
This function is called for every token encountered in the input text.
<p>
<dl compact><dt><b>
Parameters: </b><dd>
<table border=0 cellspacing=2 cellpadding=0>
<tr><td valign=top><em>buf</em>&nbsp;</td><td>
the output buffer (FIXME: what is its size?) </td></tr>
<tr><td valign=top><em>token</em>&nbsp;</td><td>
the token (e.g. <code>"p align='left'"</code> </td></tr>
<tr><td valign=top><em>userData</em>&nbsp;</td><td>
FIXME: document this </td></tr>
</table>
</dl><dl compact><dt><b>
Returns: </b><dd>
<code>false</code> if was not handled and should be handled in the default way (by just substituting). </dl>
<p>
Reimplemented from <a class="el" href="class_s_w_basic_filter.html#b13">SWBasicFilter</a>.
<p>
Definition at line <a class="el" href="thmlhtml_8cpp-source.html#l00137">137</a> of file <a class="el" href="thmlhtml_8cpp-source.html">thmlhtml.cpp</a>.
<p>
References <a class="el" href="swmodule_8cpp-source.html#l00667">SWModule::getConfigEntry</a>(), and <a class="el" href="swbasicfilter_8cpp-source.html#l00110">SWBasicFilter::pushString</a>().
<p>
<div class="fragment"><pre>00137                                                                                  {
00138         <font class="keywordflow">if</font> (!substituteToken(buf, token)) {
00139         <font class="comment">// manually process if it wasn't a simple substitution</font>
00140                 <font class="keywordflow">if</font> (!strncmp(token, <font class="stringliteral">"sync type=\"Strongs\" value=\""</font>, 27)) {
00141                         <font class="keywordflow">if</font> (token[27] == <font class="charliteral">'H'</font> || token[27] == <font class="charliteral">'G'</font> || token[27] == <font class="charliteral">'A'</font>) {
00142                                 <a class="code" href="class_s_w_basic_filter.html#b12">pushString</a>(buf, <font class="stringliteral">"&lt;small&gt;&lt;em&gt;"</font>);
00143                                 <font class="keywordflow">for</font> (<font class="keyword">const</font> <font class="keywordtype">char</font> *tok = token + 5; *tok; tok++)
00144                                         <font class="keywordflow">if</font>(*tok != <font class="charliteral">'\"'</font>)
00145                                                 *(*buf)++ = *tok;
00146                                 <a class="code" href="class_s_w_basic_filter.html#b12">pushString</a>(buf, <font class="stringliteral">"&lt;/em&gt;&lt;/small&gt;"</font>);
00147                         }
00148                         <font class="keywordflow">else</font> <font class="keywordflow">if</font> (token[27] == <font class="charliteral">'T'</font>) {
00149                                 <a class="code" href="class_s_w_basic_filter.html#b12">pushString</a>(buf, <font class="stringliteral">"&lt;small&gt;&lt;i&gt;"</font>);
00150                                 <font class="keywordflow">for</font> (<font class="keywordtype">unsigned</font> <font class="keywordtype">int</font> i = 29; token[i] != <font class="charliteral">'\"'</font>; i++)
00151                                         *(*buf)++ = token[i];
00152                                 <a class="code" href="class_s_w_basic_filter.html#b12">pushString</a>(buf, <font class="stringliteral">"&lt;/i&gt;&lt;/small&gt;"</font>);
00153                         }
00154                 }
00155                 <font class="keywordflow">else</font> <font class="keywordflow">if</font> (!strncmp(token, <font class="stringliteral">"sync type=\"morph\" value=\""</font>, 25)) {
00156                         <a class="code" href="class_s_w_basic_filter.html#b12">pushString</a>(buf, <font class="stringliteral">"&lt;small&gt;&lt;em&gt;"</font>);
00157                         <font class="keywordflow">for</font> (<font class="keywordtype">unsigned</font> <font class="keywordtype">int</font> i = 25; token[i] != <font class="charliteral">'\"'</font>; i++)
00158                                 *(*buf)++ = token[i];
00159                         <a class="code" href="class_s_w_basic_filter.html#b12">pushString</a>(buf, <font class="stringliteral">"&lt;/em&gt;&lt;/small&gt;"</font>);
00160                 }
00161                 <font class="keywordflow">else</font> <font class="keywordflow">if</font> (!strncmp(token, <font class="stringliteral">"sync type=\"lemma\" value=\""</font>, 25)) {
00162                         <a class="code" href="class_s_w_basic_filter.html#b12">pushString</a>(buf, <font class="stringliteral">"&lt;small&gt;&lt;em&gt;("</font>);
00163                         <font class="keywordflow">for</font> (<font class="keywordtype">unsigned</font> <font class="keywordtype">int</font> i = 25; token[i] != <font class="charliteral">'\"'</font>; i++)
00164                                 *(*buf)++ = token[i];
00165                         <a class="code" href="class_s_w_basic_filter.html#b12">pushString</a>(buf, <font class="stringliteral">")&lt;/em&gt;&lt;/small&gt;"</font>);
00166                 }
00167                 <font class="keywordflow">else</font> <font class="keywordflow">if</font> (!strncmp(token, <font class="stringliteral">"scripRef"</font>, 8)) {
00168                         <a class="code" href="class_s_w_basic_filter.html#b12">pushString</a>(buf, <font class="stringliteral">"&lt;a href=\""</font>);
00169                         <font class="keywordflow">for</font> (<font class="keyword">const</font> <font class="keywordtype">char</font> *tok = token + 9; *tok; tok++)
00170                                 <font class="keywordflow">if</font>(*tok != <font class="charliteral">'\"'</font>)
00171                                         *(*buf)++ = *tok;
00172                         *(*buf)++ = <font class="charliteral">'\"'</font>;
00173                         *(*buf)++ = <font class="charliteral">'&gt;'</font>;
00174                 }
00175                 <font class="keywordflow">else</font> <font class="keywordflow">if</font> (!strncmp(token, <font class="stringliteral">"img "</font>, 4)) {
00176                         <font class="keyword">const</font> <font class="keywordtype">char</font> *src = strstr(token, <font class="stringliteral">"src"</font>);
00177                         <font class="keywordflow">if</font> (!src)               <font class="comment">// assert we have a src attribute</font>
00178                                 <font class="keywordflow">return</font> <font class="keyword">false</font>;
00179 
00180                         *(*buf)++ = <font class="charliteral">'&lt;'</font>;
00181                         <font class="keywordflow">for</font> (<font class="keyword">const</font> <font class="keywordtype">char</font> *c = token; *c; c++) {
00182                                 <font class="keywordflow">if</font> (c == src) {
00183                                         <font class="keywordflow">for</font> (;((*c) &amp;&amp; (*c != <font class="charliteral">'"'</font>)); c++)
00184                                                 *(*buf)++ = *c;
00185 
00186                                         <font class="keywordflow">if</font> (!*c) { c--; <font class="keywordflow">continue</font>; }
00187 
00188                                         *(*buf)++ = <font class="charliteral">'"'</font>;
00189                                         <font class="keywordflow">if</font> (*(c+1) == <font class="charliteral">'/'</font>) {
00190                                                 <a class="code" href="class_s_w_basic_filter.html#b12">pushString</a>(buf, <font class="stringliteral">"file:"</font>);
00191                                                 <a class="code" href="class_s_w_basic_filter.html#b12">pushString</a>(buf, module-&gt;<a class="code" href="class_s_w_module.html#a6">getConfigEntry</a>(<font class="stringliteral">"AbsoluteDataPath"</font>));
00192                                                 <font class="keywordflow">if</font> (*((*buf)-1) == <font class="charliteral">'/'</font>)
00193                                                         c++;            <font class="comment">// skip '/'</font>
00194                                         }
00195                                         <font class="keywordflow">continue</font>;
00196                                 }
00197                                 *(*buf)++ = *c;
00198                         }
00199                         *(*buf)++ = <font class="charliteral">'&gt;'</font>;
00200                 }
00201                 <font class="keywordflow">else</font> <font class="keywordflow">if</font>(!strncmp(token, <font class="stringliteral">"note"</font>, 4)) {
00202                         <a class="code" href="class_s_w_basic_filter.html#b12">pushString</a>(buf, <font class="stringliteral">" &lt;font color=\"#800000\"&gt;&lt;small&gt;("</font>);
00203                 }
00204 
00205                 <font class="keywordflow">else</font> {
00206                         <font class="keywordflow">return</font> <font class="keyword">false</font>;  <font class="comment">// we still didn't handle token</font>
00207                 }
00208         }
00209         <font class="keywordflow">return</font> <font class="keyword">true</font>;
00210 }
</pre></div>    </td>
  </tr>
</table>
<hr>The documentation for this class was generated from the following files:<ul>
<li><a class="el" href="thmlhtml_8h-source.html">thmlhtml.h</a><li><a class="el" href="thmlhtml_8cpp-source.html">thmlhtml.cpp</a></ul>
<hr><address align="right"><small>Generated on Thu Jun 20 22:13:04 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>