#include <thmlrtf.h>
Inheritance diagram for ThMLRTF:


Public Methods | |
| ThMLRTF () | |
Protected Methods | |
| virtual bool | handleToken (char **buf, const char *token, DualStringMap &userData) |
| This function is called for every token encountered in the input text. More... | |
Definition at line 30 of file thmlrtf.h.
|
||||||||||||||||
|
This function is called for every token encountered in the input text.
Reimplemented from SWBasicFilter. Definition at line 150 of file thmlrtf.cpp. References SWBasicFilter::pushString().
00150 {
00151 if (!substituteToken(buf, token)) {
00152 // manually process if it wasn't a simple substitution
00153 if (!strncmp(token, "sync type=\"Strongs\" value=\"", 27)) {
00154 if (token[27] == 'H' || token[27] == 'G' || token[27] == 'A') {
00155 pushString(buf, " {\\fs15 <");
00156 for (unsigned int i = 28; token[i] != '\"'; i++)
00157 *(*buf)++ = token[i];
00158 pushString(buf, ">}");
00159 }
00160 else if (token[27] == 'T') {
00161 pushString(buf, " {\\fs15 (");
00162 for (unsigned int i = 28; token[i] != '\"'; i++)
00163 *(*buf)++ = token[i];
00164 pushString(buf, ")}");
00165 }
00166 }
00167 else if (!strncmp(token, "sync type=\"morph\" ", 18)) {
00168 pushString(buf, " {\\fs15 (");
00169 for (const char *tok = token + 5; *tok; tok++) {
00170 if (!strncmp(tok, "value=\"", 7)) {
00171 tok += 7;
00172 for (;*tok != '\"'; tok++)
00173 *(*buf)++ = *tok;
00174 break;
00175 }
00176 }
00177
00178 pushString(buf, ")}");
00179 }
00180 else if (!strncmp(token, "sync type=\"lemma\" value=\"", 25)) {
00181 pushString(buf, "{\\fs15 (");
00182 for (unsigned int i = 25; token[i] != '\"'; i++)
00183 *(*buf)++ = token[i];
00184 pushString(buf, ")}");
00185 }
00186 else if (!strncmp(token, "scripRef", 8)) {
00187 // pushString(buf, "{\\cf2 #");
00188 pushString(buf, "<a href=\"\">");
00189 }
00190 else if (!strncmp(token, "/scripRef", 9)) {
00191 pushString(buf, "</a>");
00192 }
00193 else if (!strncmp(token, "div", 3)) {
00194 *(*buf)++ = '{';
00195 if (!strncmp(token, "div class=\"title\"", 17)) {
00196 pushString(buf, "\\par\\i1\\b1 ");
00197 userData["sechead"] = "true";
00198 }
00199 else if (!strncmp(token, "div class=\"sechead\"", 19)) {
00200 pushString(buf, "\\par\\i1\\b1 ");
00201 userData["sechead"] = "true";
00202 }
00203 }
00204 else if (!strncmp(token, "/div", 4)) {
00205 *(*buf)++ = '}';
00206 if (userData["sechead"] == "true") {
00207 pushString(buf, "\\par ");
00208 userData["sechead"] == "false";
00209 }
00210 }
00211 else if (!strncmp(token, "note", 4)) {
00212 pushString(buf, " {\\i1\\fs15 (");
00213 }
00214
00215 else {
00216 return false; // we still didn't handle token
00217 }
00218 }
00219 return true;
00220 }
|
1.2.15