SWOptionFilter Class Reference

#include <swoptfilter.h>

Inheritance diagram for SWOptionFilter:
Inheritance graph
[legend]
Collaboration diagram for SWOptionFilter:
Collaboration graph
[legend]

List of all members.

Public Member Functions

virtual const char * getHeader () const
virtual const char * getOptionName ()
virtual const char * getOptionTip ()
virtual const char * getOptionValue ()
virtual StringList getOptionValues ()
virtual char processText (SWBuf &text, const SWKey *key=0, const SWModule *module=0)=0
virtual void setOptionValue (const char *ival)
 SWOptionFilter (const char *oName, const char *oTip, const StringList *oValues)
 SWOptionFilter ()
virtual ~SWOptionFilter ()

Protected Attributes

bool option
SWBuf optionValue
const char * optName
const char * optTip
const StringListoptValues

Detailed Description

Base class for all option filters.

Definition at line 38 of file swoptfilter.h.


Constructor & Destructor Documentation

SWORD_NAMESPACE_START SWOptionFilter::SWOptionFilter (  ) 

Definition at line 28 of file swoptfilter.cpp.

00028                                {
00029     static StringList empty;
00030     static const char *empty2 = "";
00031     optName   = empty2;
00032     optTip    = empty2;
00033     optValues = &empty;
00034 }

SWOptionFilter::SWOptionFilter ( const char *  oName,
const char *  oTip,
const StringList oValues 
)

Definition at line 36 of file swoptfilter.cpp.

00036                                                                                              {
00037     optName   = oName;
00038     optTip    = oTip;
00039     optValues = oValues;
00040 }

SWOptionFilter::~SWOptionFilter (  )  [virtual]

Definition at line 43 of file swoptfilter.cpp.

00043                                 {
00044 }


Member Function Documentation

virtual const char* SWFilter::getHeader (  )  const [inline, virtual, inherited]

This method can supply a header associated with the processing done with this filter. A typical example is a suggested CSS style block for classed containers.

Reimplemented in GBFXHTML, OSISXHTML, and ThMLXHTML.

Definition at line 58 of file swfilter.h.

00058 { return ""; }

virtual const char* SWOptionFilter::getOptionName (  )  [inline, virtual]

gets the name of the option of this filter

Returns:
option name

Reimplemented in OSISVariants, ThMLVariants, and UTF8Transliterator.

Definition at line 55 of file swoptfilter.h.

00055 { return optName; }

virtual const char* SWOptionFilter::getOptionTip (  )  [inline, virtual]

gets a short explanation of the option of this filter; it could be presented to the user in frontend programs

Returns:
option tip/explanation

Reimplemented in OSISVariants, ThMLVariants, and UTF8Transliterator.

Definition at line 61 of file swoptfilter.h.

00061 { return optTip; }

const char * SWOptionFilter::getOptionValue (  )  [virtual]
Returns:
The value of the current option.

Reimplemented in OSISVariants, ThMLVariants, and UTF8Transliterator.

Definition at line 57 of file swoptfilter.cpp.

00057                                            {
00058     return optionValue;
00059 }

virtual StringList SWOptionFilter::getOptionValues (  )  [inline, virtual]

returns a list of the possible option values

Returns:
list of option values

Reimplemented in OSISVariants, ThMLVariants, and UTF8Transliterator.

Definition at line 67 of file swoptfilter.h.

00067 { return *optValues; }

virtual char SWFilter::processText ( SWBuf text,
const SWKey key = 0,
const SWModule module = 0 
) [pure virtual, inherited]
void SWOptionFilter::setOptionValue ( const char *  ival  )  [virtual]

sets the value of the option of this filter, e.g maybe a strong's filter mioght be set to "on" / "off" - that would mean to show or not to show the strongs in the text, see also getOptionValues()

Parameters:
ival the new option value

Reimplemented in OSISVariants, ThMLVariants, and UTF8Transliterator.

Definition at line 47 of file swoptfilter.cpp.

00047                                                     {
00048     for (StringList::const_iterator loop = optValues->begin(); loop != optValues->end(); loop++) {
00049         if (!stricmp(loop->c_str(), ival)) {
00050             optionValue = *loop;
00051             option = (!strnicmp(ival, "On", 2));    // convenience for boolean filters
00052             break;
00053         }
00054     }
00055 }


Member Data Documentation

bool SWOptionFilter::option [protected]

Reimplemented in OSISVariants, ThMLVariants, and UTF8Transliterator.

Definition at line 44 of file swoptfilter.h.

Definition at line 40 of file swoptfilter.h.

const char* SWOptionFilter::optName [protected]

Reimplemented in OSISVariants, ThMLVariants, and UTF8Transliterator.

Definition at line 41 of file swoptfilter.h.

const char* SWOptionFilter::optTip [protected]

Reimplemented in OSISVariants, ThMLVariants, and UTF8Transliterator.

Definition at line 42 of file swoptfilter.h.

Definition at line 43 of file swoptfilter.h.


The documentation for this class was generated from the following files:

Generated on 18 Mar 2013 for The SWORD Project by  doxygen 1.6.1