#include <swmodule.h>
Inheritance diagram for SWModule::
Public Methods | |
SWModule (const char *imodname=0, const char *imoddesc=0, SWDisplay *idisp=0, char *imodtype=0, SWTextEncoding encoding=ENC_UNKNOWN, SWTextDirection dir=DIRECTION_LTR, SWTextMarkup markup=FMT_UNKNOWN, const char *modlang=0) | |
Initializes data for instance of SWModule. More... | |
virtual | ~SWModule () |
Cleans up instance of SWModule. | |
virtual char | Error () |
Gets and clears error status. More... | |
virtual const bool | isUnicode () const |
virtual const int | getEntrySize () const |
virtual char | SetKey (const SWKey *ikey) |
Sets a key to this module for position to a particular record or set of records. More... | |
virtual char | SetKey (const SWKey &ikey) |
Sets the key of this module. More... | |
virtual SWKey & | Key () const |
Gets the current module key. More... | |
virtual char | Key (const SWKey &ikey) |
Sets the current key of the module to ikey, and returns the keytext. More... | |
virtual const char * | KeyText (const char *imodtype=0) |
Sets/gets module KeyText. More... | |
virtual char | Display () |
Calls this modules display object and passes itself. More... | |
virtual SWDisplay * | Disp (SWDisplay *idisp=0) |
Sets/gets display driver. More... | |
virtual char * | Name (const char *imodname=0) |
Sets/gets module name. More... | |
virtual char * | Description (const char *imoddesc=0) |
Sets/gets module description. More... | |
virtual char * | Type (const char *imodtype=0) |
Sets/gets module type. More... | |
virtual char | Direction (signed char newdir=-1) |
Sets/gets module direction. More... | |
virtual char | Encoding (signed char enc=-1) |
Sets/gets module encoding. More... | |
virtual char | Markup (signed char enc=-1) |
Sets/gets module markup. More... | |
virtual char * | Lang (const char *imodlang=0) |
Sets/gets module language. More... | |
virtual ListKey & | Search (const char *istr, int searchType=0, int flags=0, SWKey *scope=0, bool *justCheckIfSupported=0, void(*percent)(char, void *)=&nullPercent, void *percentUserData=0) |
Searches a module for a string. More... | |
virtual signed char | createSearchFramework () |
virtual bool | hasSearchFramework () |
virtual bool | isSearchOptimallySupported (const char *istr, int searchType, int flags, SWKey *scope) |
Check if the search is optimally supported (e.g. More... | |
virtual SWKey * | CreateKey () |
Allocates a key of specific type for module The different reimplementatiosn of SWModule (e.g. More... | |
virtual | operator char * () |
Renders and returns the current module text. More... | |
virtual char * | getRawEntry ()=0 |
This function is reimplemented by the different kinds of module objects. More... | |
virtual | operator SWKey & () |
Cast operator to cast to a SWKey reference. More... | |
virtual | operator SWKey * () |
Operator to cast to an SWKey pointer. More... | |
virtual bool | isWritable () |
Is the module writable? :). More... | |
virtual SWModule & | setentry (const char *inbuf, long len) |
Modify the current module entry text only if module isWritable. More... | |
virtual SWModule & | operator<< (const char *) |
Modify the current module entry text only if module isWritable. More... | |
virtual SWModule & | operator<< (const SWKey *) |
Link the current module entry to another module entry only if module isWritable. More... | |
virtual void | deleteEntry () |
Delete current module entry - only if module isWritable. | |
virtual SWModule & | operator-= (int decrement) |
Decrements module key a number of entries. More... | |
virtual SWModule & | operator+= (int increment) |
Increments module key a number of entries. More... | |
virtual SWModule & | operator++ (int) |
Increments module key by 1 entry. | |
virtual SWModule & | operator-- (int) |
Decrements module key by 1 entry. | |
virtual SWModule & | operator= (SW_POSITION p) |
Positions this modules to an entry. More... | |
virtual SWModule & | AddRenderFilter (SWFilter *newfilter) |
Adds a RenderFilter to this module's. More... | |
virtual SWModule & | RemoveRenderFilter (SWFilter *oldfilter) |
Removes a RenderFilter from this module's. More... | |
virtual SWModule & | ReplaceRenderFilter (SWFilter *oldfilter, SWFilter *newfilter) |
Replaces a RenderFilter in this module's. More... | |
virtual void | renderFilter (char *buf, long size, SWKey *key) |
RenderFilter a text buffer. More... | |
virtual SWModule & | AddEncodingFilter (SWFilter *newfilter) |
Adds an EncodingFilter to this module's. More... | |
virtual SWModule & | RemoveEncodingFilter (SWFilter *oldfilter) |
Removes an EncodingFilter from this module's. More... | |
virtual SWModule & | ReplaceEncodingFilter (SWFilter *oldfilter, SWFilter *newfilter) |
Replaces an EncodingFilter in this module's. More... | |
virtual void | encodingFilter (char *buf, long size, SWKey *key) |
encodingFilter a text buffer. More... | |
virtual SWModule & | AddStripFilter (SWFilter *newfilter) |
Adds a StripFilter to this module's stripfilters queue. More... | |
virtual void | stripFilter (char *buf, long size, SWKey *key) |
StripFilter a text buffer. More... | |
virtual SWModule & | AddRawFilter (SWFilter *newfilter) |
Adds a RawFilter to this module's rawfilters queue. More... | |
virtual void | filterBuffer (FilterList *filters, char *buf, long size, SWKey *key) |
FilterBuffer a text buffer. More... | |
virtual void | rawFilter (char *buf, long size, SWKey *key) |
RawFilter a text buffer. More... | |
virtual SWModule & | AddOptionFilter (SWFilter *newfilter) |
Adds an OptionFilter to this module's optionfilters queue. More... | |
virtual void | optionFilter (char *buf, long size, SWKey *key) |
OptionFilter a text buffer. More... | |
virtual const char * | StripText (char *buf=0, int len=-1) |
calls all StripFilters on buffer or current text. More... | |
virtual const char * | RenderText (char *buf=0, int len=-1) |
calls all RenderFilters on buffer or current text. More... | |
virtual const char * | StripText (SWKey *tmpKey) |
calls all StripFilters on current text. More... | |
virtual const char * | RenderText (SWKey *tmpKey) |
calls all RenderFilters on current text. More... | |
Static Public Methods | |
void | nullPercent (char percent, void *userData) |
This is the default callback function for searching. More... | |
signed char | createModule (const char *) |
Creates a new module. More... | |
Public Attributes | |
bool | terminateSearch |
Set this bool to false to terminate the search which is executed by this module (Search). More... | |
Protected Attributes | |
char | error |
SWKey * | key |
the current key. | |
ListKey | listkey |
char * | modname |
char * | moddesc |
char * | modtype |
char * | modlang |
char | direction |
char | markup |
char | encoding |
SWDisplay * | disp |
this module's display object. | |
char * | entrybuf |
FilterList * | stripFilters |
executed to remove all markup (for searches). | |
FilterList * | rawFilters |
executed immediately upon fileread. | |
FilterList * | renderFilters |
executed to format for display. | |
FilterList * | optionFilters |
executed to change markup to user prefs. | |
FilterList * | encodingFilters |
executed to decode text for display. | |
bool | render |
int | entrySize |
Static Protected Attributes | |
SWDisplay | rawdisp |
It provides functions to look up a text passage, to search in the module, to switch on/off the state of optional things like Strong's numbers or footnotes.
SWModule has also functions to write to the data files. This might be useful in future for frontend authors to support user-created modules.
Definition at line 57 of file swmodule.h.
|
Initializes data for instance of SWModule.
|
|
Adds an EncodingFilter to this module's.
Definition at line 430 of file swmodule.h. |
|
Adds an OptionFilter to this module's optionfilters queue.
Definition at line 515 of file swmodule.h. |
|
Adds a RawFilter to this module's rawfilters queue.
Definition at line 484 of file swmodule.h. |
|
Adds a RenderFilter to this module's.
Definition at line 393 of file swmodule.h. |
|
Adds a StripFilter to this module's stripfilters queue.
Definition at line 467 of file swmodule.h. |
|
Allocates a key of specific type for module The different reimplementatiosn of SWModule (e.g. SWText) support SWKey implementations, which support special. This functions returns a SWKey object which works with the current implementation of SWModule. For example for the SWText class it returns a VerseKey object.
|
|
Sets/gets module description.
|
|
Sets/gets module direction.
|
|
Sets/gets display driver.
|
|
Calls this modules display object and passes itself.
|
|
Sets/gets module encoding.
|
|
Gets and clears error status.
|
|
Sets the current key of the module to ikey, and returns the keytext.
Definition at line 168 of file swmodule.h. |
|
Gets the current module key.
Definition at line 159 of file swmodule.h. |
|
Sets/gets module KeyText.
Reimplemented in SWLD. |
|
Sets/gets module language.
|
|
Sets/gets module markup.
|
|
Sets/gets module name.
|
|
Removes an EncodingFilter from this module's.
Definition at line 438 of file swmodule.h. |
|
Removes a RenderFilter from this module's.
Definition at line 401 of file swmodule.h. |
|
calls all RenderFilters on current text.
|
|
calls all RenderFilters on buffer or current text.
|
|
Replaces an EncodingFilter in this module's.
Definition at line 447 of file swmodule.h. |
|
Replaces a RenderFilter in this module's.
Definition at line 410 of file swmodule.h. |
|
Searches a module for a string.
Referenced by isSearchOptimallySupported().
|
|
Sets the key of this module. Similair to
|
|
Sets a key to this module for position to a particular record or set of records.
Referenced by Key().
|
|
calls all StripFilters on current text.
|
|
calls all StripFilters on buffer or current text.
|
|
Sets/gets module type.
|
|
Creates a new module.
Definition at line 328 of file swmodule.h. |
|
encodingFilter a text buffer.
Definition at line 460 of file swmodule.h. |
|
FilterBuffer a text buffer.
Definition at line 495 of file swmodule.h. Referenced by encodingFilter(), optionFilter(), rawFilter(), renderFilter(), and stripFilter().
|
|
Definition at line 141 of file swmodule.h. |
|
This function is reimplemented by the different kinds of module objects.
|
|
Check if the search is optimally supported (e.g. if index files are presnt and working) This function checks whether the search framework may work in the best way.
Definition at line 274 of file swmodule.h. |
|
Definition at line 137 of file swmodule.h. |
|
Is the module writable? :).
Definition at line 321 of file swmodule.h. |
|
This is the default callback function for searching. This function is a placeholder and does nothing. You can define your own function for search progress evaluation, and pass it over to Search. |
|
Cast operator to cast to a SWKey reference. This operator may be used to cast this module to a SWKey object.
Definition at line 301 of file swmodule.h. |
|
Operator to cast to an SWKey pointer. This function may be used to cast this object to an SWKey pointer. //we assume here that SWModule* module is already defined and valid. SWKey* currentKey = (SWKey*)module; // do something with currentKey (e.g. print out on screen) Definition at line 312 of file swmodule.h. |
|
Renders and returns the current module text.
|
|
Increments module key a number of entries.
|
|
Decrements module key a number of entries.
|
|
Link the current module entry to another module entry only if module isWritable.
Definition at line 349 of file swmodule.h. |
|
Modify the current module entry text only if module isWritable.
Definition at line 342 of file swmodule.h. |
|
Positions this modules to an entry.
|
|
OptionFilter a text buffer.
Definition at line 525 of file swmodule.h. |
|
RawFilter a text buffer.
Definition at line 507 of file swmodule.h. |
|
RenderFilter a text buffer.
Definition at line 423 of file swmodule.h. |
|
Modify the current module entry text only if module isWritable.
Definition at line 335 of file swmodule.h. |
|
StripFilter a text buffer.
Definition at line 477 of file swmodule.h. |
|
Set this bool to false to terminate the search which is executed by this module (Search). This is useful for threaded applications to terminate the search in another thread. Definition at line 112 of file swmodule.h. |