#include <swbasicfilter.h>
Inheritance diagram for SWBasicFilter:
Public Methods | |
SWBasicFilter () | |
virtual char | ProcessText (char *text, int maxlen, const SWKey *, const SWModule *=0) |
virtual | ~SWBasicFilter () |
Protected Types | |
typedef map< string, string > | DualStringMap |
Protected Methods | |
void | setEscapeStart (const char *escStart) |
Sets the beginning of escape sequence (by default "&"). | |
void | setEscapeEnd (const char *escEnd) |
Sets the end of escape sequence (by default ";"). | |
void | setTokenStart (const char *tokenStart) |
Sets the beginning of token start sequence (by default "<"). | |
void | setTokenEnd (const char *tokenEnd) |
Sets the end of token start sequence (by default ">"). | |
void | setPassThruUnknownToken (bool val) |
Sets whether pass thru unknown tokens unchanged or just ignore (remove) them. More... | |
void | setPassThruUnknownEscapeString (bool val) |
Sets whether pass thru unknown escape sequences unchanged or just ignore (remove) them. More... | |
void | setTokenCaseSensitive (bool val) |
void | setEscapeStringCaseSensitive (bool val) |
void | addTokenSubstitute (const char *findString, const char *replaceString) |
void | addEscapeStringSubstitute (const char *findString, const char *replaceString) |
bool | substituteToken (char **buf, const char *token) |
bool | substituteEscapeString (char **buf, const char *escString) |
void | pushString (char **buf, const char *format,...) |
Like sprintf. | |
virtual bool | handleToken (char **buf, const char *token, DualStringMap &userData) |
This function is called for every token encountered in the input text. More... | |
virtual bool | handleEscapeString (char **buf, const char *escString, DualStringMap &userData) |
This function is called for every escape sequence encountered in the input text. More... | |
Protected Attributes | |
const SWModule * | module |
const SWKey * | key |
char * | resultBuffer |
DualStringMap | tokenSubMap |
DualStringMap | escSubMap |
Private Attributes | |
char * | tokenStart |
char * | tokenEnd |
char * | escStart |
char * | escEnd |
bool | escStringCaseSensitive |
bool | tokenCaseSensitive |
bool | passThruUnknownToken |
bool | passThruUnknownEsc |
This filter has facilities for handling SGML/HTML/XML like tokens and escape strings (like SGML entities). It has the facility for just substituting the given tokens and escape strings to other strings and for "manual" custom token handling.
In this class the functions with arguments looking as char **buf
write a character sequnce at address specified by *buf
address and change *buf
to point past the last char of the written sequence.
Definition at line 45 of file swbasicfilter.h.
|
This function is called for every escape sequence encountered in the input text.
Definition at line 166 of file swbasicfilter.cpp.
00166 { 00167 return substituteEscapeString(buf, escString); 00168 } |
|
This function is called for every token encountered in the input text.
Reimplemented in GBFHTMLHREF, ThMLHTML, ThMLHTMLHREF, and ThMLRTF. Definition at line 161 of file swbasicfilter.cpp.
00161 { 00162 return substituteToken(buf, token); 00163 } |
|
Sets whether pass thru unknown escape sequences unchanged or just ignore (remove) them. Default is false. Definition at line 54 of file swbasicfilter.cpp.
00054 { 00055 passThruUnknownEsc = val; 00056 } |
|
Sets whether pass thru unknown tokens unchanged or just ignore (remove) them. Default is false. Definition at line 49 of file swbasicfilter.cpp.
00049 { 00050 passThruUnknownToken = val; 00051 } |