42 return new MyUserData(module, key);
57 MyUserData *userData = (MyUserData *) baseUserData;
61 if (!strncmp(token,
"sync ", 5)) {
62 buf +=
"<a href=\"!DIATHEKE_URL!";
64 char typ[32]; typ[0] = 0;
65 char val[32]; val[0] = 0;
66 char cls[32]; cls[0] = 0;
67 for (
unsigned int j = 5; j < strlen(token); j++) {
68 if (!strncmp(token+j,
"type=\"", 6)) {
71 for (;token[j] !=
'\"'; j++)
75 else if (!strncmp(token+j,
"value=\"", 7)) {
78 for (;token[j] !=
'\"'; j++)
82 else if (!strncmp(token+j,
"class=\"", 7)) {
85 for (;token[j] !=
'\"'; j++)
93 else if (*typ && *val) {
98 else if (*val ==
'H') {
103 else if (!
strnicmp(typ,
"Morph", 5)) {
107 else if (*val ==
'H') {
126 else if (!strncmp(token,
"scripRef p", 10) || !strncmp(token,
"scripRef v", 10)) {
127 userData->properties[
"inscriptRef"] =
"true";
128 buf +=
"<a href=\"!DIATHEKE_URL!";
129 for (i = 9; i < strlen(token); i++) {
130 if (!strncmp(token+i,
"version=\"", 9)) {
132 for (;token[i] !=
'\"'; i++)
136 if (!strncmp(token+i,
"passage=\"", 9)) {
139 for (;token[i] !=
'\"'; i++) {
140 if (token[i] ==
' ') buf +=
'+';
141 else buf += token[i];
150 else if (!strcmp(token,
"scripRef")) {
151 userData->properties[
"inscriptRef"] =
"false";
153 userData->properties[
"suspendTextPassThru"] =
"true";
157 else if (!strcmp(token,
"/scripRef")) {
158 if (userData->properties[
"inscriptRef"] ==
"true") {
159 userData->properties[
"inscriptRef"] =
"false";
164 buf +=
"<a href=\"!DIATHEKE_URL!verse=";
166 char* vref = (
char*)userData->properties[
"lastTextNode"].c_str();
168 if (*vref ==
' ') buf +=
'+';
173 buf += userData->properties[
"lastTextNode"].c_str();
175 userData->properties[
"suspendTextPassThru"] =
"false";
180 else if (!strncmp(token,
"div class=\"sechead\"", 19)) {
181 userData->properties[
"SecHead"] =
"true";
182 buf +=
"<br /><b><i>";
184 else if (!strncmp(token,
"div class=\"title\"", 19)) {
185 userData->properties[
"SecHead"] =
"true";
186 buf +=
"<br /><b><i>";
188 else if (!strncmp(token,
"/div", 4)) {
189 if (userData->properties[
"SecHead"] ==
"true") {
190 buf +=
"</i></b><br />";
191 userData->properties[
"SecHead"] =
"false";
195 else if(!strncmp(token,
"note", 4)) {
196 buf +=
" <small><font color=\"#008000\">{";
201 for (i = 0; i < strlen(token); i++) {
#define SWORD_NAMESPACE_START
SWBuf & appendFormatted(const char *format,...)
void setTokenEnd(const char *tokenEnd)
void setTokenCaseSensitive(bool val)
bool substituteToken(SWBuf &buf, const char *token)
void setTokenStart(const char *tokenStart)
virtual bool handleToken(SWBuf &buf, const char *token, BasicFilterUserData *userData)
BasicFilterUserData(const SWModule *module, const SWKey *key)
SWORD_NAMESPACE_START typedef std::map< SWBuf, SWBuf > DualStringMap
void addTokenSubstitute(const char *findString, const char *replaceString)
int strnicmp(const char *s1, const char *s2, int len)
#define SWORD_NAMESPACE_END
virtual BasicFilterUserData * createUserData(const SWModule *module, const SWKey *key)