1
/******************************************************************************
3
* gbfheadings - SWFilter descendant to hide or show headings
9
#include <gbfheadings.h>
18
const char oName[] = "Headings";
19
const char oTip[] = "Toggles Headings On and Off if they exist";
21
const SWBuf choices[3] = {"On", "Off", ""};
22
const StringList oValues(&choices[0], &choices[2]);
24
GBFHeadings::GBFHeadings() : SWOptionFilter(oName, oTip, &oValues) {
25
setOptionValue("Off");
29
GBFHeadings::~GBFHeadings() {
33
char GBFHeadings::processText (SWBuf &text, const SWKey *key, const SWModule *module) {
34
if (!option) { // if we don't want headings
35
char token[2048]; // cheese. Fix.
44
for (text = ""; *from; from++) {
48
// memset(token, 0, 2048);
54
if (*from == '>') { // process tokens
57
case 'T': // Reference
59
case 'S': // Begin heading
62
case 's': // end heading
66
continue; // skip token
68
// if not a heading token, keep token in text
71
for (char *tok = token; *tok; tok++)
79
token[tokpos++] = *from;