zLD Class Reference

#include <zld.h>

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

List of all members.

Public Member Functions

SWDEPRECATED SWModuleAddEncodingFilter (SWFilter *newFilter)
virtual SWModuleaddEncodingFilter (SWFilter *newFilter)
SWDEPRECATED SWModuleAddOptionFilter (SWOptionFilter *newFilter)
virtual SWModuleaddOptionFilter (SWOptionFilter *newFilter)
SWDEPRECATED SWModuleAddRawFilter (SWFilter *newFilter)
virtual SWModuleaddRawFilter (SWFilter *newfilter)
SWDEPRECATED SWModuleAddRenderFilter (SWFilter *newFilter)
virtual SWModuleaddRenderFilter (SWFilter *newFilter)
SWDEPRECATED SWModuleAddStripFilter (SWFilter *newFilter)
virtual SWModuleaddStripFilter (SWFilter *newFilter)
SWDEPRECATED SWKeyCreateKey () const
virtual SWKeycreateKey () const
virtual signed char createSearchFramework (void(*percent)(char, void *)=&nullPercent, void *percentUserData=0)
virtual void decrement (int steps=1)
virtual void deleteEntry ()
virtual void deleteSearchFramework ()
SWDEPRECATED const char * Description (const char *imoddesc)
SWDEPRECATED const char * Description () const
SWDEPRECATED char Direction (signed char newdir=-1)
SWDEPRECATED SWDisplayDisp (SWDisplay *idisp=0)
SWDEPRECATED char Display ()
virtual char display ()
SWDEPRECATED char Encoding (signed char enc=-1)
virtual void encodingFilter (SWBuf &buf, const SWKey *key) const
virtual SWDEPRECATED char Error ()
virtual void filterBuffer (FilterList *filters, SWBuf &buf, const SWKey *key) const
virtual void filterBuffer (OptionFilterList *filters, SWBuf &buf, const SWKey *key) const
signed char findKeyIndex (const char *ikey, long *idxoff, long away=0) const
virtual void flush ()
virtual const ConfigEntMapgetConfig () const
virtual const char * getConfigEntry (const char *key) const
const char * getDescription () const
virtual char getDirection () const
virtual SWDisplaygetDisplay () const
char getEncoding () const
virtual AttributeTypeListgetEntryAttributes () const
virtual long getEntryCount () const
virtual long getEntryForKey (const char *key) const
virtual int getEntrySize () const
virtual long getIndex () const
virtual SWKeygetKey () const
virtual char * getKeyForEntry (long entry) const
virtual const char * getKeyText () const
const char * getLanguage () const
char getMarkup () const
const char * getName () const
const char * getRawEntry () const
virtual SWBufgetRawEntryBuf () const
virtual const FilterListgetRenderFilters () const
virtual const char * getRenderHeader () const
SWDEPRECATED bool getSkipConsecutiveLinks ()
void getText (long index, char **idxbuf, char **buf) const
const char * getType () const
virtual bool hasEntry (const SWKey *k) const
virtual bool hasSearchFramework ()
virtual void increment (int steps=1)
SWDEPRECATED long Index (long iindex)
SWDEPRECATED long Index () const
virtual bool isLinked (const SWKey *, const SWKey *) const
virtual bool isProcessEntryAttributes () const
virtual bool isSearchOptimallySupported (const char *istr, int searchType, int flags, SWKey *scope)
virtual bool isSkipConsecutiveLinks ()
virtual bool isUnicode () const
virtual bool isWritable () const
SWDEPRECATED SWKeyKey () const
SWDEPRECATED char Key (const SWKey &ikey)
SWDEPRECATED const char * KeyText (const char *ikeytext=0)
SWDEPRECATED const char * Lang (char *imodlang=0)
virtual long lastAccess ()
void linkEntry (const char *destkey, const char *srckey)
virtual void linkEntry (const SWKey *linkKey)
SWDEPRECATED char Markup (signed char imarkup=-1)
SWDEPRECATED const char * Name (const char *imodname)
SWDEPRECATED const char * Name () const
virtual void optionFilter (SWBuf &buf, const SWKey *key) const
virtual char popError ()
SWDEPRECATED void processEntryAttributes (bool val) const
virtual void rawFilter (SWBuf &buf, const SWKey *key) const
virtual void rawZFilter (SWBuf &buf, char direction=0) const
SWDEPRECATED SWModuleRemoveEncodingFilter (SWFilter *oldFilter)
virtual SWModuleremoveEncodingFilter (SWFilter *oldFilter)
SWDEPRECATED SWModuleRemoveRenderFilter (SWFilter *oldFilter)
virtual SWModuleremoveRenderFilter (SWFilter *oldFilter)
virtual void renderFilter (SWBuf &buf, const SWKey *key) const
SWDEPRECATED const char * RenderText (const char *buf=0, int len=-1, bool render=true)
virtual const char * renderText (const SWKey *tmpKey)
virtual const char * renderText (const char *buf=0, int len=-1, bool render=true)
SWDEPRECATED SWModuleReplaceEncodingFilter (SWFilter *oldFilter, SWFilter *newFilter)
virtual SWModulereplaceEncodingFilter (SWFilter *oldFilter, SWFilter *newFilter)
SWDEPRECATED SWModuleReplaceRenderFilter (SWFilter *oldFilter, SWFilter *newFilter)
virtual SWModulereplaceRenderFilter (SWFilter *oldFilter, SWFilter *newFilter)
virtual long resourceConsumption ()
SWDEPRECATED ListKeySearch (const char *istr, int searchType=0, int flags=0, SWKey *scope=0, bool *justCheckIfSupported=0, void(*percent)(char, void *)=&nullPercent, void *percentUserData=0)
virtual ListKeysearch (const char *istr, int searchType=0, int flags=0, SWKey *scope=0, bool *justCheckIfSupported=0, void(*percent)(char, void *)=&nullPercent, void *percentUserData=0)
virtual void setConfig (ConfigEntMap *config)
virtual void setDisplay (SWDisplay *idisp)
virtual void setEntry (const char *inbuf, long len=-1)
virtual void setIndex (long iindex)
SWDEPRECATED char SetKey (const SWKey &ikey)
SWDEPRECATED char SetKey (const SWKey *ikey)
char setKey (const SWKey &ikey)
virtual char setKey (const SWKey *ikey)
virtual void setPosition (SW_POSITION pos)
virtual void setProcessEntryAttributes (bool val) const
virtual void setSkipConsecutiveLinks (bool val)
void setText (const char *ikey, const char *buf, long len=-1)
void setType (const char *imodtype)
virtual void stripFilter (SWBuf &buf, const SWKey *key) const
SWDEPRECATED const char * StripText (const char *buf=0, int len=-1)
virtual const char * stripText (const SWKey *tmpKey)
virtual const char * stripText (const char *buf=0, int len=-1)
SWDEPRECATED const char * Type (const char *imodtype)
SWDEPRECATED const char * Type () const
 zLD (const char *ipath, const char *iname=0, const char *idesc=0, long blockCount=200, SWCompress *icomp=0, SWDisplay *idisp=0, SWTextEncoding encoding=ENC_UNKNOWN, SWTextDirection dir=DIRECTION_LTR, SWTextMarkup markup=FMT_UNKNOWN, const char *ilang=0, bool caseSensitive=false, bool strongsPadding=true)
virtual ~zLD ()

Static Public Member Functions

static char createModule (const char *path)
static void nullPercent (char percent, void *userData)

Public Attributes

char nl
bool terminateSearch

Protected Member Functions

void flushCache () const
void getCompressedText (long block, long entry, char **buf) const
void getKeyFromDatOffset (long ioffset, char **buf) const
void getKeyFromIdxOffset (long ioffset, char **buf) const

Static Protected Member Functions

static void prepText (SWBuf &buf)
static void strongsPad (char *buf)

Protected Attributes

ConfigEntMapconfig
FileDescdatfd
char direction
SWDisplaydisp
char encoding
FilterListencodingFilters
char * entkeytxt
AttributeTypeList entryAttributes
SWBuf entryBuf
long entryIndex
int entrySize
char error
FileDescidxfd
SWKeykey
ListKey listKey
char markup
char * moddesc
char * modlang
char * modname
char * modtype
OptionFilterListoptionFilters
ConfigEntMap ownConfig
bool procEntAttr
FilterListrawFilters
FilterListrenderFilters
bool skipConsecutiveLinks
FilterListstripFilters
bool strongsPadding
FileDesczdtfd
FileDesczdxfd

Static Protected Attributes

static const int IDXENTRYSIZE = 8
static StdOutDisplay rawdisp
static const int ZDXENTRYSIZE = 8

Private Member Functions

char getEntry (long away=0) const

Detailed Description

Definition at line 33 of file zld.h.


Constructor & Destructor Documentation

SWORD_NAMESPACE_START zLD::zLD ( const char *  ipath,
const char *  iname = 0,
const char *  idesc = 0,
long  blockCount = 200,
SWCompress icomp = 0,
SWDisplay idisp = 0,
SWTextEncoding  encoding = ENC_UNKNOWN,
SWTextDirection  dir = DIRECTION_LTR,
SWTextMarkup  markup = FMT_UNKNOWN,
const char *  ilang = 0,
bool  caseSensitive = false,
bool  strongsPadding = true 
)

Definition at line 41 of file zld.cpp.

00041                                                                                                                                                                                                                                               : zStr(ipath, -1, blockCount, icomp, caseSensitive), SWLD(iname, idesc, idisp, enc, dir, mark, ilang, strongsPadding) {
00042 
00043 }

zLD::~zLD (  )  [virtual]

Definition at line 50 of file zld.cpp.

00050           {
00051     flushCache();
00052 }


Member Function Documentation

SWDEPRECATED SWModule& SWModule::AddEncodingFilter ( SWFilter newFilter  )  [inline, inherited]

Definition at line 530 of file swmodule.h.

00530 { return addEncodingFilter(newFilter); }

virtual SWModule& SWModule::addEncodingFilter ( SWFilter newFilter  )  [inline, virtual, inherited]

Adds an EncodingFilter to this module's

See also:
encodingFilters queue. Encoding Filters are called immediately when the module is read from data source, to assure we have desired internal data stream (e.g. UTF-8 for text modules)
Parameters:
newfilter the filter to add
Returns:
*this

Definition at line 526 of file swmodule.h.

00526                                                              {
00527         encodingFilters->push_back(newFilter);
00528         return *this;
00529     }

SWDEPRECATED SWModule& SWModule::AddOptionFilter ( SWOptionFilter newFilter  )  [inline, inherited]

Definition at line 615 of file swmodule.h.

00615 { return addOptionFilter(newFilter); }

virtual SWModule& SWModule::addOptionFilter ( SWOptionFilter newFilter  )  [inline, virtual, inherited]

Adds an OptionFilter to this module's optionFilters queue. Option Filters are used to turn options in the text on or off, or so some other state (e.g. Strong's Number, Footnotes, Cross References, etc.)

Parameters:
newfilter the filter to add
Returns:
*this

Definition at line 611 of file swmodule.h.

00611                                                                  {
00612         optionFilters->push_back(newFilter);
00613         return *this;
00614     }

SWDEPRECATED SWModule& SWModule::AddRawFilter ( SWFilter newFilter  )  [inline, inherited]

Definition at line 585 of file swmodule.h.

00585 { return addRawFilter(newFilter); }

virtual SWModule& SWModule::addRawFilter ( SWFilter newfilter  )  [inline, virtual, inherited]

Adds a RawFilter to this module's rawFilters queue

Parameters:
newFilter the filter to add
Returns:
*this

Definition at line 581 of file swmodule.h.

00581                                                         {
00582         rawFilters->push_back(newfilter);
00583         return *this;
00584     }

SWDEPRECATED SWModule& SWModule::AddRenderFilter ( SWFilter newFilter  )  [inline, inherited]

Definition at line 476 of file swmodule.h.

00476 { return addRenderFilter(newFilter); }

virtual SWModule& SWModule::addRenderFilter ( SWFilter newFilter  )  [inline, virtual, inherited]

Adds a RenderFilter to this module's renderFilters queue. Render Filters are called when the module is asked to produce renderable text.

Parameters:
newfilter the filter to add
Returns:
*this

Definition at line 472 of file swmodule.h.

00472                                                            {
00473         renderFilters->push_back(newFilter);
00474         return *this;
00475     }

SWDEPRECATED SWModule& SWModule::AddStripFilter ( SWFilter newFilter  )  [inline, inherited]

Definition at line 575 of file swmodule.h.

00575 { return addStripFilter(newFilter); }

virtual SWModule& SWModule::addStripFilter ( SWFilter newFilter  )  [inline, virtual, inherited]

Adds a StripFilter to this module's stripFilters queue. Strip filters are called when a module is asked to render an entry without any markup (like when searching).

Parameters:
newfilter the filter to add
Returns:
*this

Definition at line 571 of file swmodule.h.

00571                                                           {
00572         stripFilters->push_back(newFilter);
00573         return *this;
00574     }

SWDEPRECATED SWKey* SWModule::CreateKey (  )  const [inline, inherited]

Definition at line 400 of file swmodule.h.

00400 { return createKey(); }

SWKey * SWLD::createKey (  )  const [virtual, inherited]

Allocates a key of specific type for module The different reimplementations 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.

See also:
VerseKey, ListKey, SWText, SWLD, SWCom
Returns:
pointer to allocated key. Caller is responsible for deleting the object

Reimplemented from SWModule.

Definition at line 58 of file swld.cpp.

00058 { return new StrKey(); }

static char zLD::createModule ( const char *  path  )  [inline, static]

Reimplemented from zStr.

Definition at line 48 of file zld.h.

00048                                                {
00049         return zStr::createModule(path);
00050     }

signed char SWModule::createSearchFramework ( void(*)(char, void *)  percent = &nullPercent,
void *  percentUserData = 0 
) [virtual, inherited]

ask the object to build any indecies it wants for optimal searching

Reimplemented from SWSearchable.

Definition at line 941 of file swmodule.cpp.

00941                                                                                                 {
00942 
00943 #ifdef USELUCENE
00944     SWBuf target = getConfigEntry("AbsoluteDataPath");
00945     if (!target.endsWith("/") && !target.endsWith("\\")) {
00946         target.append('/');
00947     }
00948     target.append("lucene");
00949     int status = FileMgr::createParent(target+"/dummy");
00950     if (status) return -1;
00951 
00952     SWKey *saveKey = 0;
00953     SWKey *searchKey = 0;
00954     SWKey textkey;
00955     SWBuf c;
00956 
00957     const int MAX_CONV_SIZE = 1024 * 1024;
00958 
00959     // turn all filters to default values
00960     StringList filterSettings;
00961     for (OptionFilterList::iterator filter = optionFilters->begin(); filter != optionFilters->end(); filter++) {
00962         filterSettings.push_back((*filter)->getOptionValue());
00963         (*filter)->setOptionValue(*((*filter)->getOptionValues().begin()));
00964 
00965         if ( (!strcmp("Greek Accents", (*filter)->getOptionName())) ||
00966             (!strcmp("Hebrew Vowel Points", (*filter)->getOptionName())) ||
00967             (!strcmp("Arabic Vowel Points", (*filter)->getOptionName()))
00968            ) {
00969             (*filter)->setOptionValue("Off");
00970         }
00971     }
00972 
00973 
00974     // be sure we give CLucene enough file handles
00975     FileMgr::getSystemFileMgr()->flush();
00976 
00977     // save key information so as not to disrupt original
00978     // module position
00979     if (!key->isPersist()) {
00980         saveKey = createKey();
00981         *saveKey = *key;
00982     }
00983     else    saveKey = key;
00984 
00985     searchKey = (key->isPersist())?key->clone():0;
00986     if (searchKey) {
00987         searchKey->setPersist(1);
00988         setKey(*searchKey);
00989     }
00990 
00991     RAMDirectory *ramDir = 0;
00992     IndexWriter *coreWriter = 0;
00993     IndexWriter *fsWriter = 0;
00994     Directory *d = 0;
00995 
00996     const TCHAR *stopWords[] = { 0 };
00997     standard::StandardAnalyzer *an = new standard::StandardAnalyzer(stopWords);
00998     bool includeKeyInSearch = getConfig().has("SearchOption", "IncludeKeyInSearch");
00999 
01000     ramDir = new RAMDirectory();
01001     coreWriter = new IndexWriter(ramDir, an, true);
01002     coreWriter->setMaxFieldLength(MAX_CONV_SIZE);
01003 
01004 
01005 
01006 
01007     char perc = 1;
01008     VerseKey *vkcheck = 0;
01009     vkcheck = SWDYNAMIC_CAST(VerseKey, key);
01010     VerseKey *chapMax = 0;
01011         if (vkcheck) chapMax = (VerseKey *)vkcheck->clone();
01012 
01013     TreeKeyIdx *tkcheck = 0;
01014     tkcheck = SWDYNAMIC_CAST(TreeKeyIdx, key);
01015 
01016 
01017     *this = BOTTOM;
01018     long highIndex = key->getIndex();
01019     if (!highIndex)
01020         highIndex = 1;      // avoid division by zero errors.
01021 
01022     bool savePEA = isProcessEntryAttributes();
01023     setProcessEntryAttributes(true);
01024 
01025     // prox chapter blocks
01026     // position module at the beginning
01027     *this = TOP;
01028 
01029     SWBuf proxBuf;
01030     SWBuf proxLem;
01031     SWBuf proxMorph;
01032     SWBuf strong;
01033     SWBuf morph;
01034 
01035     char err = popError();
01036     while (!err) {
01037         long mindex = key->getIndex();
01038 
01039         proxBuf = "";
01040         proxLem = "";
01041         proxMorph = "";
01042 
01043         // computer percent complete so we can report to our progress callback
01044         float per = (float)mindex / highIndex;
01045         // between 5%-98%
01046         per *= 93; per += 5;
01047         char newperc = (char)per;
01048         if (newperc > perc) {
01049             perc = newperc;
01050             (*percent)(perc, percentUserData);
01051         }
01052 
01053         // get "content" field
01054         const char *content = stripText();
01055 
01056         bool good = false;
01057 
01058         // start out entry
01059         Document *doc = new Document();
01060         // get "key" field
01061         SWBuf keyText = (vkcheck) ? vkcheck->getOSISRef() : getKeyText();
01062         if (content && *content) {
01063             good = true;
01064 
01065 
01066             // build "strong" field
01067             AttributeTypeList::iterator words;
01068             AttributeList::iterator word;
01069             AttributeValue::iterator strongVal;
01070             AttributeValue::iterator morphVal;
01071 
01072             strong="";
01073             morph="";
01074             words = getEntryAttributes().find("Word");
01075             if (words != getEntryAttributes().end()) {
01076                 for (word = words->second.begin();word != words->second.end(); word++) {
01077                     int partCount = atoi(word->second["PartCount"]);
01078                     if (!partCount) partCount = 1;
01079                     for (int i = 0; i < partCount; i++) {
01080                         SWBuf tmp = "Lemma";
01081                         if (partCount > 1) tmp.appendFormatted(".%d", i+1);
01082                         strongVal = word->second.find(tmp);
01083                         if (strongVal != word->second.end()) {
01084                             // cheeze.  skip empty article tags that weren't assigned to any text
01085                             if (strongVal->second == "G3588") {
01086                                 if (word->second.find("Text") == word->second.end())
01087                                     continue;   // no text? let's skip
01088                             }
01089                             strong.append(strongVal->second);
01090                             morph.append(strongVal->second);
01091                             morph.append('@');
01092                             SWBuf tmp = "Morph";
01093                             if (partCount > 1) tmp.appendFormatted(".%d", i+1);
01094                             morphVal = word->second.find(tmp);
01095                             if (morphVal != word->second.end()) {
01096                                 morph.append(morphVal->second);
01097                             }
01098                             strong.append(' ');
01099                             morph.append(' ');
01100                         }
01101                     }
01102                 }
01103             }
01104 
01105             doc->add(*_CLNEW Field(_T("key"), (wchar_t *)utf8ToWChar(keyText).getRawData(), Field::STORE_YES | Field::INDEX_UNTOKENIZED));
01106 
01107             if (includeKeyInSearch) {
01108                 c = keyText;
01109                 c += " ";
01110                 c += content;
01111                 content = c.c_str();
01112             }
01113 
01114             doc->add(*_CLNEW Field(_T("content"), (wchar_t *)utf8ToWChar(content).getRawData(), Field::STORE_NO | Field::INDEX_TOKENIZED));
01115 
01116             if (strong.length() > 0) {
01117                 doc->add(*_CLNEW Field(_T("lemma"), (wchar_t *)utf8ToWChar(strong).getRawData(), Field::STORE_NO | Field::INDEX_TOKENIZED));
01118                 doc->add(*_CLNEW Field(_T("morph"), (wchar_t *)utf8ToWChar(morph).getRawData(), Field::STORE_NO | Field::INDEX_TOKENIZED));
01119 //printf("setting fields (%s).\ncontent: %s\nlemma: %s\n", (const char *)*key, content, strong.c_str());
01120             }
01121 
01122 //printf("setting fields (%s).\n", (const char *)*key);
01123 //fflush(stdout);
01124         }
01125         // don't write yet, cuz we have to see if we're the first of a prox block (5:1 or chapter5/verse1
01126 
01127         // for VerseKeys use chapter
01128         if (vkcheck) {
01129             *chapMax = *vkcheck;
01130             // we're the first verse in a chapter
01131             if (vkcheck->getVerse() == 1) {
01132                 *chapMax = MAXVERSE;
01133                 VerseKey saveKey = *vkcheck;
01134                 while ((!err) && (*vkcheck <= *chapMax)) {
01135 //printf("building proxBuf from (%s).\nproxBuf.c_str(): %s\n", (const char *)*key, proxBuf.c_str());
01136 //printf("building proxBuf from (%s).\n", (const char *)*key);
01137 
01138                     content = stripText();
01139                     if (content && *content) {
01140                         // build "strong" field
01141                         strong = "";
01142                         morph = "";
01143                         AttributeTypeList::iterator words;
01144                         AttributeList::iterator word;
01145                         AttributeValue::iterator strongVal;
01146                         AttributeValue::iterator morphVal;
01147 
01148                         words = getEntryAttributes().find("Word");
01149                         if (words != getEntryAttributes().end()) {
01150                             for (word = words->second.begin();word != words->second.end(); word++) {
01151                                 int partCount = atoi(word->second["PartCount"]);
01152                                 if (!partCount) partCount = 1;
01153                                 for (int i = 0; i < partCount; i++) {
01154                                     SWBuf tmp = "Lemma";
01155                                     if (partCount > 1) tmp.appendFormatted(".%d", i+1);
01156                                     strongVal = word->second.find(tmp);
01157                                     if (strongVal != word->second.end()) {
01158                                         // cheeze.  skip empty article tags that weren't assigned to any text
01159                                         if (strongVal->second == "G3588") {
01160                                             if (word->second.find("Text") == word->second.end())
01161                                                 continue;   // no text? let's skip
01162                                         }
01163                                         strong.append(strongVal->second);
01164                                         morph.append(strongVal->second);
01165                                         morph.append('@');
01166                                         SWBuf tmp = "Morph";
01167                                         if (partCount > 1) tmp.appendFormatted(".%d", i+1);
01168                                         morphVal = word->second.find(tmp);
01169                                         if (morphVal != word->second.end()) {
01170                                             morph.append(morphVal->second);
01171                                         }
01172                                         strong.append(' ');
01173                                         morph.append(' ');
01174                                     }
01175                                 }
01176                             }
01177                         }
01178                         proxBuf += content;
01179                         proxBuf.append(' ');
01180                         proxLem += strong;
01181                         proxMorph += morph;
01182                         if (proxLem.length()) {
01183                             proxLem.append("\n");
01184                             proxMorph.append("\n");
01185                         }
01186                     }
01187                     (*this)++;
01188                     err = popError();
01189                 }
01190                 err = 0;
01191                 *vkcheck = saveKey;
01192             }
01193         }
01194 
01195         // for TreeKeys use siblings if we have no children
01196         else if (tkcheck) {
01197             if (!tkcheck->hasChildren()) {
01198                 if (!tkcheck->previousSibling()) {
01199                     do {
01200 //printf("building proxBuf from (%s).\n", (const char *)*key);
01201 //fflush(stdout);
01202 
01203                         content = stripText();
01204                         if (content && *content) {
01205                             // build "strong" field
01206                             strong = "";
01207                             morph = "";
01208                             AttributeTypeList::iterator words;
01209                             AttributeList::iterator word;
01210                             AttributeValue::iterator strongVal;
01211                             AttributeValue::iterator morphVal;
01212 
01213                             words = getEntryAttributes().find("Word");
01214                             if (words != getEntryAttributes().end()) {
01215                                 for (word = words->second.begin();word != words->second.end(); word++) {
01216                                     int partCount = atoi(word->second["PartCount"]);
01217                                     if (!partCount) partCount = 1;
01218                                     for (int i = 0; i < partCount; i++) {
01219                                         SWBuf tmp = "Lemma";
01220                                         if (partCount > 1) tmp.appendFormatted(".%d", i+1);
01221                                         strongVal = word->second.find(tmp);
01222                                         if (strongVal != word->second.end()) {
01223                                             // cheeze.  skip empty article tags that weren't assigned to any text
01224                                             if (strongVal->second == "G3588") {
01225                                                 if (word->second.find("Text") == word->second.end())
01226                                                     continue;   // no text? let's skip
01227                                             }
01228                                             strong.append(strongVal->second);
01229                                             morph.append(strongVal->second);
01230                                             morph.append('@');
01231                                             SWBuf tmp = "Morph";
01232                                             if (partCount > 1) tmp.appendFormatted(".%d", i+1);
01233                                             morphVal = word->second.find(tmp);
01234                                             if (morphVal != word->second.end()) {
01235                                                 morph.append(morphVal->second);
01236                                             }
01237                                             strong.append(' ');
01238                                             morph.append(' ');
01239                                         }
01240                                     }
01241                                 }
01242                             }
01243 
01244                             proxBuf += content;
01245                             proxBuf.append(' ');
01246                             proxLem += strong;
01247                             proxMorph += morph;
01248                             if (proxLem.length()) {
01249                                 proxLem.append("\n");
01250                                 proxMorph.append("\n");
01251                             }
01252                         }
01253                     } while (tkcheck->nextSibling());
01254                     tkcheck->parent();
01255                     tkcheck->firstChild();
01256                 }
01257                 else tkcheck->nextSibling();    // reposition from our previousSibling test
01258             }
01259         }
01260 
01261         if (proxBuf.length() > 0) {
01262 
01263             doc->add(*_CLNEW Field(_T("prox"), (wchar_t *)utf8ToWChar(proxBuf).getRawData(), Field::STORE_NO | Field::INDEX_TOKENIZED));
01264             good = true;
01265         }
01266         if (proxLem.length() > 0) {
01267             doc->add(*_CLNEW Field(_T("proxlem"), (wchar_t *)utf8ToWChar(proxLem).getRawData(), Field::STORE_NO | Field::INDEX_TOKENIZED) );
01268             doc->add(*_CLNEW Field(_T("proxmorph"), (wchar_t *)utf8ToWChar(proxMorph).getRawData(), Field::STORE_NO | Field::INDEX_TOKENIZED) );
01269             good = true;
01270         }
01271         if (good) {
01272 //printf("writing (%s).\n", (const char *)*key);
01273 //fflush(stdout);
01274             coreWriter->addDocument(doc);
01275         }
01276         delete doc;
01277 
01278         (*this)++;
01279         err = popError();
01280     }
01281 
01282     // Optimizing automatically happens with the call to addIndexes
01283     //coreWriter->optimize();
01284     coreWriter->close();
01285 
01286 #ifdef CLUCENE2
01287     d = FSDirectory::getDirectory(target.c_str());
01288 #endif
01289     if (IndexReader::indexExists(target.c_str())) {
01290 #ifndef CLUCENE2
01291         d = FSDirectory::getDirectory(target.c_str(), false);
01292 #endif
01293         if (IndexReader::isLocked(d)) {
01294             IndexReader::unlock(d);
01295         }
01296         fsWriter = new IndexWriter( d, an, false);
01297     }
01298     else {
01299 #ifndef CLUCENE2
01300         d = FSDirectory::getDirectory(target.c_str(), true);
01301 #endif
01302         fsWriter = new IndexWriter(d, an, true);
01303     }
01304 
01305     Directory *dirs[] = { ramDir, 0 };
01306 #ifdef CLUCENE2
01307     lucene::util::ConstValueArray< lucene::store::Directory *>dirsa(dirs, 1);
01308     fsWriter->addIndexes(dirsa);
01309 #else
01310     fsWriter->addIndexes(dirs);
01311 #endif
01312     fsWriter->close();
01313 
01314     delete ramDir;
01315     delete coreWriter;
01316     delete fsWriter;
01317     delete an;
01318 
01319     // reposition module back to where it was before we were called
01320     setKey(*saveKey);
01321 
01322     if (!saveKey->isPersist())
01323         delete saveKey;
01324 
01325     if (searchKey)
01326         delete searchKey;
01327 
01328         delete chapMax;
01329 
01330     setProcessEntryAttributes(savePEA);
01331 
01332     // reset option filters back to original values
01333     StringList::iterator origVal = filterSettings.begin();
01334     for (OptionFilterList::iterator filter = optionFilters->begin(); filter != optionFilters->end(); filter++) {
01335         (*filter)->setOptionValue(*origVal++);
01336     }
01337 
01338     return 0;
01339 #else
01340     return SWSearchable::createSearchFramework(percent, percentUserData);
01341 #endif
01342 }

virtual void zLD::decrement ( int  steps = 1  )  [inline, virtual]

Decrements module key a number of entries

Parameters:
steps Number of entries to jump backward

Reimplemented from SWModule.

Definition at line 44 of file zld.h.

00044 { increment(-steps); }

void zLD::deleteEntry (  )  [virtual]

Delete current module entry - only if module isWritable()

Reimplemented from SWModule.

Definition at line 157 of file zld.cpp.

00157                       {
00158     setText(*key, "");
00159 }

void SWModule::deleteSearchFramework (  )  [virtual, inherited]

Reimplemented from SWSearchable.

Definition at line 926 of file swmodule.cpp.

00926                                      {
00927 #ifdef USELUCENE
00928     SWBuf target = getConfigEntry("AbsoluteDataPath");
00929     if (!target.endsWith("/") && !target.endsWith("\\")) {
00930         target.append('/');
00931     }
00932     target.append("lucene");
00933 
00934     FileMgr::removeDir(target.c_str());
00935 #else
00936     SWSearchable::deleteSearchFramework();
00937 #endif
00938 }

SWDEPRECATED const char* SWModule::Description ( const char *  imoddesc  )  [inline, inherited]

Sets module description

Parameters:
imoddesc Value which to set moddesc; [0]-only get
Returns:
pointer to moddesc

Definition at line 312 of file swmodule.h.

00312 { stdstr(&moddesc, imoddesc); return getDescription(); }

SWDEPRECATED const char* SWModule::Description (  )  const [inline, inherited]

Definition at line 305 of file swmodule.h.

00305 { return getDescription(); }

SWDEPRECATED char SWModule::Direction ( signed char  newdir = -1  )  [inline, inherited]

Definition at line 335 of file swmodule.h.

00335 { char retVal = getDirection(); if (newdir != -1) return direction = newdir; return retVal; }

SWDEPRECATED SWDisplay* SWModule::Disp ( SWDisplay idisp = 0  )  [inline, inherited]
Deprecated:
Use get/setDisplay() instead.

Definition at line 284 of file swmodule.h.

00284 { if (idisp)    setDisplay(idisp); return getDisplay(); }

SWDEPRECATED char SWModule::Display (  )  [inline, inherited]

Definition at line 267 of file swmodule.h.

00267 { return display(); }

char SWModule::display (  )  [virtual, inherited]

Calls this module's display object and passes itself

Returns:
error status

Definition at line 245 of file swmodule.cpp.

00245                        {
00246      disp->display(*this);
00247      return 0;
00248 }

SWDEPRECATED char SWModule::Encoding ( signed char  enc = -1  )  [inline, inherited]

Definition at line 343 of file swmodule.h.

00343 { char retVal = getEncoding(); if (enc != -1) encoding = enc; return retVal; }

virtual void SWModule::encodingFilter ( SWBuf buf,
const SWKey key 
) const [inline, virtual, inherited]

encodingFilter run a buf through this module's Encoding Filters

Parameters:
buf the buffer to filter
key key location from where this buffer was extracted

Definition at line 561 of file swmodule.h.

00561                                                                     {
00562         filterBuffer(encodingFilters, buf, key);
00563     }

virtual SWDEPRECATED char SWModule::Error (  )  [inline, virtual, inherited]

Definition at line 182 of file swmodule.h.

00182 { return popError(); }

virtual void SWModule::filterBuffer ( FilterList filters,
SWBuf buf,
const SWKey key 
) const [virtual, inherited]

FilterBuffer a text buffer

Parameters:
filters the FilterList of filters to iterate
buf the buffer to filter
key key location from where this buffer was extracted
void SWModule::filterBuffer ( OptionFilterList filters,
SWBuf buf,
const SWKey key 
) const [virtual, inherited]

OptionFilterBuffer a text buffer

Parameters:
filters the FilterList of filters to iterate
buf the buffer to filter
key key location from where this buffer was extracted

Definition at line 1349 of file swmodule.cpp.

01349                                                                                          {
01350     OptionFilterList::iterator it;
01351     for (it = filters->begin(); it != filters->end(); it++) {
01352         (*it)->processText(buf, key, this);
01353     }
01354 }

signed char zStr::findKeyIndex ( const char *  ikey,
long *  idxoff,
long  away = 0 
) const [inherited]

Definition at line 190 of file zstr.cpp.

00191 {
00192     char *maxbuf = 0, *trybuf = 0, *key = 0, quitflag = 0;
00193     signed char retval = 0;
00194     __s32 headoff, tailoff, tryoff = 0, maxoff = 0;
00195     __u32 start, size;
00196     int diff = 0;
00197     bool awayFromSubstrCheck = false;
00198 
00199     if (idxfd->getFd() >= 0) {
00200         tailoff = maxoff = idxfd->seek(0, SEEK_END) - IDXENTRYSIZE;
00201         if (*ikey) {
00202             headoff = 0;
00203             stdstr(&key, ikey, 3);
00204             if (!caseSensitive) toupperstr_utf8(key, strlen(key)*3);
00205 
00206             int keylen = strlen(key);
00207             bool substr = false;
00208 
00209             getKeyFromIdxOffset(maxoff, &maxbuf);
00210 
00211             while (headoff < tailoff) {
00212                 tryoff = (lastoff == -1) ? headoff + (((((tailoff / IDXENTRYSIZE) - (headoff / IDXENTRYSIZE))) / 2) * IDXENTRYSIZE) : lastoff;
00213                 lastoff = -1;
00214 
00215                 getKeyFromIdxOffset(tryoff, &trybuf);
00216 
00217                 if (!*trybuf && tryoff) {       // In case of extra entry at end of idx (not first entry)
00218                     tryoff += (tryoff > (maxoff / 2))?-IDXENTRYSIZE:IDXENTRYSIZE;
00219                     retval = -1;
00220                     break;
00221                 }
00222 
00223                 diff = strcmp(key, trybuf);
00224 
00225                 if (!diff)
00226                     break;
00227 
00228                 if (!strncmp(trybuf, key, keylen)) substr = true;
00229 
00230                 if (diff < 0)
00231                     tailoff = (tryoff == headoff) ? headoff : tryoff;
00232                 else headoff = tryoff;
00233 
00234                 if (tailoff == headoff + IDXENTRYSIZE) {
00235                     if (quitflag++)
00236                         headoff = tailoff;
00237                 }
00238             }
00239 
00240             // didn't find exact match
00241             if (headoff >= tailoff) {
00242                 tryoff = headoff;
00243                 if (!substr && ((tryoff != maxoff)||(strncmp(key, maxbuf, keylen)<0))) {
00244                     awayFromSubstrCheck = true;
00245                     away--; // if our entry doesn't startwith our key, prefer the previous entry over the next
00246                 }
00247             }
00248             if (trybuf)
00249                 free(trybuf);
00250             delete [] key;
00251                         if (maxbuf)
00252                             free(maxbuf);
00253         }
00254         else    { tryoff = 0; }
00255 
00256         idxfd->seek(tryoff, SEEK_SET);
00257 
00258         start = size = 0;
00259         retval = (idxfd->read(&start, 4) == 4) ? retval : -1;
00260         retval = (idxfd->read(&size, 4) == 4) ? retval : -1;
00261         start = swordtoarch32(start);
00262         size  = swordtoarch32(size);
00263 
00264         if (idxoff)
00265             *idxoff = tryoff;
00266 
00267         while (away) {
00268             __u32 laststart = start;
00269             __u32 lastsize = size;
00270             __s32 lasttry = tryoff;
00271             tryoff += (away > 0) ? IDXENTRYSIZE : -IDXENTRYSIZE;
00272 
00273             bool bad = false;
00274             if (((long)(tryoff + (away*IDXENTRYSIZE)) < -IDXENTRYSIZE) || (tryoff + (away*IDXENTRYSIZE) > (maxoff+IDXENTRYSIZE)))
00275                 bad = true;
00276             else    if (idxfd->seek(tryoff, SEEK_SET) < 0)
00277                 bad = true;
00278             if (bad) {
00279                 if(!awayFromSubstrCheck)
00280                     retval = -1;
00281                 start = laststart;
00282                 size = lastsize;
00283                 tryoff = lasttry;
00284                 if (idxoff)
00285                     *idxoff = tryoff;
00286                 break;
00287             }
00288             idxfd->read(&start, 4);
00289             idxfd->read(&size, 4);
00290             start = swordtoarch32(start);
00291             size  = swordtoarch32(size);
00292 
00293             if (idxoff)
00294                 *idxoff = tryoff;
00295 
00296 
00297             if (((laststart != start) || (lastsize != size)) && (start >= 0) && (size)) 
00298                 away += (away < 0) ? 1 : -1;
00299         }
00300     
00301         lastoff = tryoff;
00302     }
00303     else {
00304         if (idxoff)
00305             *idxoff = 0;
00306         retval = -1;
00307     }
00308     return retval;
00309 }

virtual void zLD::flush (  )  [inline, virtual]

Reimplemented from SWCacher.

Definition at line 60 of file zld.h.

00060 { flushCache(); }

void zStr::flushCache (  )  const [protected, inherited]

Definition at line 586 of file zstr.cpp.

00586                             {
00587     if (cacheBlock) {
00588         if (cacheDirty) {
00589             __u32 start = 0;
00590             unsigned long size = 0;
00591             __u32 outstart = 0, outsize = 0;
00592 
00593             const char *rawBuf = cacheBlock->getRawData(&size);
00594             compressor->Buf(rawBuf, &size);
00595             compressor->zBuf(&size);
00596 
00597             SWBuf buf;
00598             buf.setSize(size + 5);
00599             memcpy(buf.getRawData(), compressor->zBuf(&size), size); // 1 = encipher
00600             buf.setSize(size);
00601             rawZFilter(buf, 1); // 1 = encipher
00602 
00603             long zdxSize = zdxfd->seek(0, SEEK_END);
00604             unsigned long zdtSize = zdtfd->seek(0, SEEK_END);
00605 
00606             if ((cacheBlockIndex * ZDXENTRYSIZE) > (zdxSize - ZDXENTRYSIZE)) {  // New Block
00607                 start = zdtSize;
00608             }
00609             else {
00610                 zdxfd->seek(cacheBlockIndex * ZDXENTRYSIZE, SEEK_SET);
00611                 zdxfd->read(&start, 4);
00612                 zdxfd->read(&outsize, 4);
00613                 start = swordtoarch32(start);
00614                 outsize = swordtoarch32(outsize);
00615                 if (start + outsize >= zdtSize) {   // last entry, just overwrite
00616                     // start is already set
00617                 }
00618                 else    if (size < outsize) {   // middle entry, but smaller, that's fine and let's preserve bigger size
00619                     size = outsize;
00620                 }
00621                 else {  // middle and bigger-- we have serious problems, for now let's put it at the end = lots of wasted space
00622                     start = zdtSize;
00623                 }
00624             }
00625 
00626 
00627 
00628             outstart = archtosword32(start);
00629             outsize  = archtosword32((__u32)size);
00630 
00631             zdxfd->seek(cacheBlockIndex * ZDXENTRYSIZE, SEEK_SET);
00632             zdtfd->seek(start, SEEK_SET);
00633             zdtfd->write(buf, size);
00634 
00635             // add a new line to make data file easier to read in an editor
00636             zdtfd->write(&nl, 2);
00637             
00638             zdxfd->write(&outstart, 4);
00639             zdxfd->write(&outsize, 4);
00640         }
00641         delete cacheBlock;
00642         cacheBlock = 0;
00643     }
00644     cacheBlockIndex = -1;
00645     cacheDirty = false;
00646 }

void zStr::getCompressedText ( long  block,
long  entry,
char **  buf 
) const [protected, inherited]

Definition at line 389 of file zstr.cpp.

00389                                                                      {
00390 
00391     __u32 size = 0;
00392 
00393     if (cacheBlockIndex != block) {
00394         __u32 start = 0;
00395 
00396         zdxfd->seek(block * ZDXENTRYSIZE, SEEK_SET);
00397         zdxfd->read(&start, 4);
00398         zdxfd->read(&size, 4);
00399         start = swordtoarch32(start);
00400         size = swordtoarch32(size);
00401 
00402         SWBuf buf;
00403         buf.setSize(size + 5);
00404         zdtfd->seek(start, SEEK_SET);
00405         zdtfd->read(buf.getRawData(), size);
00406 
00407         flushCache();
00408 
00409         unsigned long len = size;
00410         buf.setSize(size);
00411         rawZFilter(buf, 0); // 0 = decipher
00412 
00413         compressor->zBuf(&len, buf.getRawData());
00414         char *rawBuf = compressor->Buf(0, &len);
00415         cacheBlock = new EntriesBlock(rawBuf, len);
00416         cacheBlockIndex = block;
00417     }
00418     size = cacheBlock->getEntrySize(entry);
00419     *buf = (*buf) ? (char *)realloc(*buf, size*2 + 1) : (char *)malloc(size*2 + 1);
00420     strcpy(*buf, cacheBlock->getEntry(entry));
00421 }

virtual const ConfigEntMap& SWModule::getConfig (  )  const [inline, virtual, inherited]

Definition at line 193 of file swmodule.h.

00193 { return *config; }

const char * SWModule::getConfigEntry ( const char *  key  )  const [virtual, inherited]

Definition at line 907 of file swmodule.cpp.

00907                                                           {
00908     ConfigEntMap::iterator it = config->find(key);
00909     return (it != config->end()) ? it->second.c_str() : 0;
00910 }

const char * SWModule::getDescription (  )  const [inherited]

Gets module description

Returns:
pointer to moddesc

Definition at line 191 of file swmodule.cpp.

00191                                            {
00192     return moddesc;
00193 }

char SWModule::getDirection (  )  const [virtual, inherited]

Sets/gets module direction

Parameters:
newdir Value which to set direction; [-1]-only get
Returns:
new direction

Definition at line 217 of file swmodule.cpp.

00217                                   {
00218         return direction;
00219 }

SWDisplay * SWModule::getDisplay (  )  const [virtual, inherited]

Gets display driver

Returns:
pointer to SWDisplay class for this module

Definition at line 231 of file swmodule.cpp.

00231                                       {
00232     return disp;
00233 }

char SWModule::getEncoding (  )  const [inline, inherited]

Sets/gets module encoding

Parameters:
enc Value which to set encoding; [-1]-only get
Returns:
Encoding

Definition at line 342 of file swmodule.h.

00342 { return encoding; }

char zLD::getEntry ( long  away = 0  )  const [private]

Definition at line 69 of file zld.cpp.

00069                                   {
00070     char *idxbuf = 0;
00071     char *ebuf = 0;
00072     char retval = 0;
00073     long index;
00074     unsigned long size;
00075     char *buf = new char [ strlen(*key) + 6 ];
00076     strcpy(buf, *key);
00077 
00078     if (strongsPadding) strongsPad(buf);
00079 
00080     entryBuf = "";
00081     if (!(retval = findKeyIndex(buf, &index, away))) {
00082         getText(index, &idxbuf, &ebuf);
00083         size = strlen(ebuf) + 1;
00084         entryBuf = ebuf;
00085 
00086         rawFilter(entryBuf, key);
00087 
00088         entrySize = size;        // support getEntrySize call
00089         if (!key->isPersist())          // If we have our own key
00090             *key = idxbuf;              // reset it to entry index buffer
00091 
00092         stdstr(&entkeytxt, idxbuf); // set entry key text that module 'snapped' to.
00093         free(idxbuf);
00094         free(ebuf);
00095     }
00096         
00097     delete [] buf;
00098     return retval;
00099 }

virtual AttributeTypeList& SWModule::getEntryAttributes (  )  const [inline, virtual, inherited]

Entry Attributes are special data pertaining to the current entry. To see what Entry Attributes exists for a specific entry of a module, the example examples/cmdline/lookup.cpp is a good utility which displays this information. It is also useful as an example of how to access such.

Definition at line 686 of file swmodule.h.

00686 { return entryAttributes; }

long zLD::getEntryCount (  )  const [virtual]

Implements SWLD.

Definition at line 162 of file zld.cpp.

00163 {
00164     if (idxfd < 0) return 0;
00165     return idxfd->seek(0, SEEK_END) / IDXENTRYSIZE;
00166 }

long zLD::getEntryForKey ( const char *  key  )  const [virtual]

Implements SWLD.

Definition at line 169 of file zld.cpp.

00170 {
00171     long offset;
00172     char *buf = new char [ strlen(key) + 6 ];
00173     strcpy(buf, key);
00174 
00175     if (strongsPadding) strongsPad(buf);
00176     
00177     findKeyIndex(buf, &offset);
00178 
00179     delete [] buf;
00180 
00181     return offset/IDXENTRYSIZE;
00182 }

virtual int SWModule::getEntrySize (  )  const [inline, virtual, inherited]
Returns:
The size of the text entry for the module's current key position.

Definition at line 199 of file swmodule.h.

00199 { return entrySize; }

virtual long SWModule::getIndex (  )  const [inline, virtual, inherited]

Reimplemented in SWCom, and SWText.

Definition at line 255 of file swmodule.h.

00255 { return entryIndex; }

SWKey * SWModule::getKey (  )  const [virtual, inherited]

Gets the current module key

Returns:
the current key of this module

Definition at line 257 of file swmodule.cpp.

00257                               {
00258     return key;
00259 }

char * zLD::getKeyForEntry ( long  entry  )  const [virtual]

Implements SWLD.

Definition at line 185 of file zld.cpp.

00186 {
00187     char *key = 0;
00188     getKeyFromIdxOffset(entry * IDXENTRYSIZE, &key);
00189     return key;
00190 }

void zStr::getKeyFromDatOffset ( long  ioffset,
char **  buf 
) const [protected, inherited]

Definition at line 131 of file zstr.cpp.

00132 {
00133     int size;
00134     char ch;
00135     if (datfd > 0) {
00136         datfd->seek(ioffset, SEEK_SET);
00137         for (size = 0; datfd->read(&ch, 1) == 1; size++) {
00138             if ((ch == '\\') || (ch == 10) || (ch == 13))
00139                 break;
00140         }
00141         *buf = (*buf) ? (char *)realloc(*buf, size*2 + 1) : (char *)malloc(size*2 + 1);
00142         if (size) {
00143             datfd->seek(ioffset, SEEK_SET);
00144             datfd->read(*buf, size);
00145         }
00146         (*buf)[size] = 0;
00147         if (!caseSensitive) toupperstr_utf8(*buf, size*2);
00148     }
00149     else {
00150         *buf = (*buf) ? (char *)realloc(*buf, 1) : (char *)malloc(1);
00151         **buf = 0;
00152     }
00153 }

void zStr::getKeyFromIdxOffset ( long  ioffset,
char **  buf 
) const [protected, inherited]

Definition at line 165 of file zstr.cpp.

00166 {
00167     __u32 offset;
00168     
00169     if (idxfd > 0) {
00170         idxfd->seek(ioffset, SEEK_SET);
00171         idxfd->read(&offset, 4);
00172         offset = swordtoarch32(offset);
00173         getKeyFromDatOffset(offset, buf);
00174     }
00175 }

const char * SWLD::getKeyText (  )  const [virtual, inherited]

Sets/gets module KeyText, getting from saved text if key is persistent

Parameters:
ikeytext value which to set keytext; [0] - only get
Returns:
pointer to keytext

Reimplemented from SWModule.

Definition at line 71 of file swld.cpp.

00071                                    {
00072     if (key->isPersist()) {
00073         getRawEntryBuf();   // force module key to snap to entry
00074     }
00075     return entkeytxt;
00076 }

const char* SWModule::getLanguage (  )  const [inline, inherited]

Sets/gets module language

Parameters:
imodlang Value which to set modlang; [0]-only get
Returns:
pointer to modlang

Definition at line 358 of file swmodule.h.

00358 { return modlang; }

char SWModule::getMarkup (  )  const [inline, inherited]

Sets/gets module markup

Parameters:
markup Value which to set markup; [-1]-only get
Returns:
Markup

Definition at line 350 of file swmodule.h.

00350 { return markup; }

const char * SWModule::getName (  )  const [inherited]

Gets module name

Returns:
pointer to modname

Definition at line 177 of file swmodule.cpp.

00177                                     {
00178     return modname;
00179 }

const char* SWModule::getRawEntry (  )  const [inline, inherited]

Definition at line 408 of file swmodule.h.

00408 { return getRawEntryBuf().c_str(); }

SWBuf & zLD::getRawEntryBuf (  )  const [virtual]

This function is reimplemented by the different kinds of module objects

Returns:
the raw module text of the current entry

Implements SWModule.

Definition at line 109 of file zld.cpp.

00109                                  {
00110     if (!getEntry() /*&& !isUnicode()*/) {
00111         prepText(entryBuf);
00112     }
00113 
00114     return entryBuf;
00115 }

virtual const FilterList& SWModule::getRenderFilters (  )  const [inline, virtual, inherited]

Retrieves a container of render filters associated with this module.

Returns:
container of render filters

Definition at line 482 of file swmodule.h.

00482                                                        {
00483         return *renderFilters;
00484     }

const char * SWModule::getRenderHeader (  )  const [virtual, inherited]

Produces any header data which might be useful which associated with the processing done with this filter. A typical example is a suggested CSS style block for classed containers.

SWModule::getRenderHeader() - Produces any header data which might be useful which associated with the processing done with this filter. A typical example is a suggested CSS style block for classed containers.

Definition at line 787 of file swmodule.cpp.

00787                                             {
00788     FilterList::const_iterator first = getRenderFilters().begin();
00789     if (first != getRenderFilters().end()) {
00790         return (*first)->getHeader();
00791     }
00792     return "";
00793 }

SWDEPRECATED bool SWModule::getSkipConsecutiveLinks (  )  [inline, inherited]

Definition at line 675 of file swmodule.h.

00675 { return isSkipConsecutiveLinks(); }

void zStr::getText ( long  index,
char **  idxbuf,
char **  buf 
) const [inherited]

Definition at line 324 of file zstr.cpp.

00324                                                                {
00325     char *ch;
00326     char *idxbuflocal = 0;
00327     getKeyFromIdxOffset(offset, &idxbuflocal);
00328     __u32 start;
00329     __u32 size;
00330 
00331     do {
00332         idxfd->seek(offset, SEEK_SET);
00333         idxfd->read(&start, 4);
00334         idxfd->read(&size, 4);
00335         start = swordtoarch32(start);
00336         size = swordtoarch32(size);
00337 
00338         *buf = (*buf) ? (char *)realloc(*buf, size*2 + 1) : (char *)malloc(size*2 + 1);
00339         *idxbuf = (*idxbuf) ? (char *)realloc(*idxbuf, size*2 + 1) : (char *)malloc(size*2 + 1);
00340         memset(*buf, 0, size + 1);
00341         memset(*idxbuf, 0, size + 1);
00342         datfd->seek(start, SEEK_SET);
00343         datfd->read(*buf, (int)(size));
00344 
00345         for (ch = *buf; *ch; ch++) {        // skip over index string
00346             if (*ch == 10) {
00347                 ch++;
00348                 break;
00349             }
00350         }
00351         memmove(*buf, ch, size - (unsigned long)(ch-*buf));
00352 
00353         // resolve link
00354         if (!strncmp(*buf, "@LINK", 5)) {
00355             for (ch = *buf; *ch; ch++) {        // null before nl
00356                 if (*ch == 10) {
00357                     *ch = 0;
00358                     break;
00359                 }
00360             }
00361             findKeyIndex(*buf + 6, &offset);
00362         }
00363         else break;
00364     }
00365     while (true);   // while we're resolving links
00366 
00367     if (idxbuflocal) {
00368         __u32 localsize = strlen(idxbuflocal);
00369         localsize = (localsize < (size - 1)) ? localsize : (size - 1);
00370         strncpy(*idxbuf, idxbuflocal, localsize);
00371         (*idxbuf)[localsize] = 0;
00372         free(idxbuflocal);
00373     }
00374     __u32 block = 0;
00375     __u32 entry = 0;
00376     memmove(&block, *buf, sizeof(__u32));
00377     memmove(&entry, *buf + sizeof(__u32), sizeof(__u32));
00378     block = swordtoarch32(block);
00379     entry = swordtoarch32(entry);
00380     getCompressedText(block, entry, buf);
00381 }

const char * SWModule::getType (  )  const [inherited]

Gets module type

Returns:
pointer to modtype

Definition at line 205 of file swmodule.cpp.

00205                                     {
00206     return modtype;
00207 }

bool SWLD::hasEntry ( const SWKey k  )  const [virtual, inherited]

Reimplemented from SWModule.

Definition at line 98 of file swld.cpp.

00098                                           {
00099     const char *key_str = *key;
00100     char *buf = new char [ strlen(key_str) + 6 ];
00101     strcpy(buf, key_str);
00102 
00103     if (strongsPadding) strongsPad(buf);
00104     
00105     bool retVal = !strcmp(buf, getKeyForEntry(getEntryForKey(buf)));
00106     delete buf;
00107 
00108     return retVal;
00109 }

bool SWModule::hasSearchFramework (  )  [virtual, inherited]

was SWORD compiled with code to optimize searching for this driver?

Reimplemented from SWSearchable.

Definition at line 918 of file swmodule.cpp.

00918                                   {
00919 #ifdef USELUCENE
00920     return true;
00921 #else
00922     return SWSearchable::hasSearchFramework();
00923 #endif
00924 }

void zLD::increment ( int  steps = 1  )  [virtual]

Increments module key a number of entries

Parameters:
steps Number of entries to jump forward

Reimplemented from SWModule.

Definition at line 126 of file zld.cpp.

00126                              {
00127     char tmperror;
00128 
00129     if (key->isTraversable()) {
00130         *key += steps;
00131         error = key->popError();
00132         steps = 0;
00133     }
00134     
00135     tmperror = (getEntry(steps)) ? KEYERR_OUTOFBOUNDS : 0;
00136     error = (error)?error:tmperror;
00137     *key = entkeytxt;
00138 }

SWDEPRECATED long SWModule::Index ( long  iindex  )  [inline, inherited]

Definition at line 260 of file swmodule.h.

00260 { setIndex(iindex); return getIndex(); }

SWDEPRECATED long SWModule::Index (  )  const [inline, inherited]

Definition at line 258 of file swmodule.h.

00258 { return getIndex(); }

virtual bool SWModule::isLinked ( const SWKey ,
const SWKey  
) const [inline, virtual, inherited]

Reimplemented in RawCom, RawCom4, RawText, RawText4, zCom, and zText.

Definition at line 677 of file swmodule.h.

00677 { return false; }

virtual bool SWModule::isProcessEntryAttributes (  )  const [inline, virtual, inherited]

Whether or not we're processing Entry Attributes

Definition at line 698 of file swmodule.h.

00698 { return procEntAttr; }

bool SWSearchable::isSearchOptimallySupported ( const char *  istr,
int  searchType,
int  flags,
SWKey scope 
) [virtual, inherited]

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.

Returns:
true if the the search is optimally supported, false if it's not working in the best way.

Definition at line 47 of file swsearchable.cpp.

00047                                                                                                        {
00048     bool retVal = false;
00049     search(istr, searchType, flags, scope, &retVal);
00050     return retVal;
00051 }

virtual bool SWModule::isSkipConsecutiveLinks (  )  [inline, virtual, inherited]

Whether or not to only hit one entry when iterating encounters consecutive links when iterating

Definition at line 674 of file swmodule.h.

00674 { return skipConsecutiveLinks; }

virtual bool SWModule::isUnicode (  )  const [inline, virtual, inherited]
Returns:
True if this module is encoded in Unicode, otherwise returns false.

Definition at line 187 of file swmodule.h.

00187 { return (encoding == (char)ENC_UTF8); }

bool zLD::isWritable (  )  const [virtual]

Is the module writable? :)

Returns:
yes or no

Reimplemented from SWModule.

Definition at line 55 of file zld.cpp.

00055                            {
00056     return ((idxfd->getFd() > 0) && ((idxfd->mode & FileMgr::RDWR) == FileMgr::RDWR));
00057 }

SWDEPRECATED SWKey& SWModule::Key (  )  const [inline, inherited]
Deprecated:
Use getKey() instead.

Definition at line 235 of file swmodule.h.

00235 { return *getKey(); }

SWDEPRECATED char SWModule::Key ( const SWKey ikey  )  [inline, inherited]
Deprecated:
Use setKey() instead.

Definition at line 226 of file swmodule.h.

00226 { return setKey(ikey); }

SWDEPRECATED const char* SWModule::KeyText ( const char *  ikeytext = 0  )  [inline, inherited]

Sets/gets module KeyText

Deprecated:
Use getKeyText/setKey
Parameters:
ikeytext Value which to set keytext; [0]-only get
Returns:
pointer to keytext

Definition at line 243 of file swmodule.h.

00243 { if (ikeytext) setKey(ikeytext); return *getKey(); }

SWDEPRECATED const char* SWModule::Lang ( char *  imodlang = 0  )  [inline, inherited]

Definition at line 359 of file swmodule.h.

00359 { if (imodlang != 0) stdstr(&modlang, imodlang); return getLanguage(); }

long SWCacher::lastAccess (  )  [virtual, inherited]

Definition at line 43 of file swcacher.cpp.

00043                           {
00044     return 0;
00045 }

void zStr::linkEntry ( const char *  destkey,
const char *  srckey 
) [inherited]

Definition at line 578 of file zstr.cpp.

00578                                                             {
00579     char *text = new char [ strlen(destkey) + 7 ];
00580     sprintf(text, "@LINK %s", destkey);
00581     setText(srckey, text);
00582     delete [] text;
00583 }

void zLD::linkEntry ( const SWKey sourceKey  )  [virtual]

Link the current module entry to another module entry - only if module isWritable()

Reimplemented from SWModule.

Definition at line 146 of file zld.cpp.

00146                                       {
00147     zStr::linkEntry(*key, *inkey);
00148 }

SWDEPRECATED char SWModule::Markup ( signed char  imarkup = -1  )  [inline, inherited]

Definition at line 351 of file swmodule.h.

00351 { char retVal = getMarkup(); if (imarkup != -1) markup = imarkup; return retVal; }

SWDEPRECATED const char* SWModule::Name ( const char *  imodname  )  [inline, inherited]

Sets module name

Parameters:
imodname Value which to set modname; [0]-only get
Returns:
pointer to modname

Definition at line 298 of file swmodule.h.

00298 { stdstr(&modname, imodname); return getName(); }

SWDEPRECATED const char* SWModule::Name (  )  const [inline, inherited]

Definition at line 291 of file swmodule.h.

00291 { return getName(); }

SWORD_NAMESPACE_START void SWSearchable::nullPercent ( char  percent,
void *  userData 
) [static, inherited]

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().

Definition at line 28 of file swsearchable.cpp.

00028 {}

virtual void SWModule::optionFilter ( SWBuf buf,
const SWKey key 
) const [inline, virtual, inherited]

OptionFilter a text buffer

Parameters:
buf the buffer to filter
key key location from where this buffer was extracted

Definition at line 621 of file swmodule.h.

00621                                                                   {
00622         filterBuffer(optionFilters, buf, key);
00623     }

char SWModule::popError (  )  [virtual, inherited]

Gets and clears error status

Returns:
error status

Definition at line 159 of file swmodule.cpp.

00160 {
00161     char retval = error;
00162 
00163     error = 0;
00164     return retval;
00165 }

void SWModule::prepText ( SWBuf buf  )  [static, protected, inherited]

Definition at line 1387 of file swmodule.cpp.

01387                                   {
01388     unsigned int to, from; 
01389     char space = 0, cr = 0, realdata = 0, nlcnt = 0;
01390     char *rawBuf = buf.getRawData();
01391     for (to = from = 0; rawBuf[from]; from++) {
01392         switch (rawBuf[from]) {
01393         case 10:
01394             if (!realdata)
01395                 continue;
01396             space = (cr) ? 0 : 1;
01397             cr = 0;
01398             nlcnt++;
01399             if (nlcnt > 1) {
01400 //              *to++ = nl;
01401                 rawBuf[to++] = 10;
01402 //              *to++ = nl[1];
01403 //              nlcnt = 0;
01404             }
01405             continue;
01406         case 13:
01407             if (!realdata)
01408                 continue;
01409 //          *to++ = nl[0];
01410             rawBuf[to++] = 10;
01411             space = 0;
01412             cr = 1;
01413             continue;
01414         }
01415         realdata = 1;
01416         nlcnt = 0;
01417         if (space) {
01418             space = 0;
01419             if (rawBuf[from] != ' ') {
01420                 rawBuf[to++] = ' ';
01421                 from--;
01422                 continue;
01423             }
01424         }
01425         rawBuf[to++] = rawBuf[from];
01426     }
01427     buf.setSize(to);
01428 
01429     while (to > 1) {            // remove trailing excess
01430         to--;
01431         if ((rawBuf[to] == 10) || (rawBuf[to] == ' '))
01432             buf.setSize(to);
01433         else break;
01434     }
01435 }

SWDEPRECATED void SWModule::processEntryAttributes ( bool  val  )  const [inline, inherited]

Definition at line 694 of file swmodule.h.

00694 { setProcessEntryAttributes(val); }

virtual void SWModule::rawFilter ( SWBuf buf,
const SWKey key 
) const [inline, virtual, inherited]

RawFilter a text buffer

Parameters:
buf the buffer to filter
key key location from where this buffer was extracted

Definition at line 600 of file swmodule.h.

00600                                                                {
00601         filterBuffer(rawFilters, buf, key);
00602     }

virtual void zLD::rawZFilter ( SWBuf buf,
char  direction = 0 
) const [inline, virtual]

Reimplemented from zStr.

Definition at line 57 of file zld.h.

00057 { rawFilter(buf, (SWKey *)(long)direction); }// hack, use key as direction for enciphering

SWDEPRECATED SWModule& SWModule::RemoveEncodingFilter ( SWFilter oldFilter  )  [inline, inherited]

Definition at line 540 of file swmodule.h.

00540 { return removeEncodingFilter(oldFilter); }

virtual SWModule& SWModule::removeEncodingFilter ( SWFilter oldFilter  )  [inline, virtual, inherited]

Removes an EncodingFilter from this module's encodingFilters queue

Parameters:
oldfilter the filter to remove
Returns:
*this

Definition at line 536 of file swmodule.h.

00536                                                                 {
00537         encodingFilters->remove(oldFilter);
00538         return *this;
00539     }

SWDEPRECATED SWModule& SWModule::RemoveRenderFilter ( SWFilter oldFilter  )  [inline, inherited]

Definition at line 494 of file swmodule.h.

00494 {   return removeRenderFilter(oldFilter); }

virtual SWModule& SWModule::removeRenderFilter ( SWFilter oldFilter  )  [inline, virtual, inherited]

Removes a RenderFilter from this module's renderFilters queue

Parameters:
oldfilter the filter to remove
Returns:
*this

Definition at line 490 of file swmodule.h.

00490                                                               {
00491         renderFilters->remove(oldFilter);
00492         return *this;
00493     }

virtual void SWModule::renderFilter ( SWBuf buf,
const SWKey key 
) const [inline, virtual, inherited]

RenderFilter run a buf through this module's Render Filters

Parameters:
buf the buffer to filter
key key location from where this buffer was extracted

Definition at line 515 of file swmodule.h.

00515                                                                   {
00516         filterBuffer(renderFilters, buf, key);
00517     }

SWDEPRECATED const char* SWModule::RenderText ( const char *  buf = 0,
int  len = -1,
bool  render = true 
) [inline, inherited]

Definition at line 645 of file swmodule.h.

00645 { return renderText(buf, len, render); }

const char * SWModule::renderText ( const SWKey tmpKey  )  [virtual, inherited]

Produces renderable text of the module entry at the supplied key

Parameters:
tmpKey key to use to grab text
Returns:
this module's text at specified key location massaged by Render filters

Definition at line 853 of file swmodule.cpp.

00853                                                      {
00854     SWKey *saveKey;
00855     const char *retVal;
00856 
00857     if (!key->isPersist()) {
00858         saveKey = createKey();
00859         *saveKey = *key;
00860     }
00861     else    saveKey = key;
00862 
00863     setKey(*tmpKey);
00864 
00865     retVal = renderText();
00866 
00867     setKey(*saveKey);
00868 
00869     if (!saveKey->isPersist())
00870         delete saveKey;
00871 
00872     return retVal;
00873 }

const char * SWModule::renderText ( const char *  buf = 0,
int  len = -1,
bool  render = true 
) [virtual, inherited]

Produces renderable text of the current module entry or supplied text

Parameters:
buf buffer to massage instead of current module entry; if buf is 0, the current module position text will be used
len max len to process
render for internal use
Returns:
result buffer

Definition at line 804 of file swmodule.cpp.

00804                                                                        {
00805     bool savePEA = isProcessEntryAttributes();
00806     if (!buf) {
00807         entryAttributes.clear();
00808     }
00809     else {
00810         setProcessEntryAttributes(false);
00811     }
00812 
00813     static SWBuf local;
00814     if (buf)
00815         local = buf;
00816 
00817     SWBuf &tmpbuf = (buf) ? local : getRawEntryBuf();
00818     SWKey *key = 0;
00819     static const char *null = "";
00820 
00821     if (tmpbuf) {
00822         unsigned long size = (len < 0) ? ((getEntrySize()<0) ? strlen(tmpbuf) : getEntrySize()) : len;
00823         if (size > 0) {
00824             key = (SWKey *)*this;
00825 
00826             optionFilter(tmpbuf, key);
00827     
00828             if (render) {
00829                 renderFilter(tmpbuf, key);
00830                 encodingFilter(tmpbuf, key);
00831             }
00832             else    stripFilter(tmpbuf, key);
00833         }
00834     }
00835     else {
00836         tmpbuf = null;
00837     }
00838 
00839     setProcessEntryAttributes(savePEA);
00840 
00841     return tmpbuf;
00842 }

SWDEPRECATED SWModule& SWModule::ReplaceEncodingFilter ( SWFilter oldFilter,
SWFilter newFilter 
) [inline, inherited]

Definition at line 555 of file swmodule.h.

00555 { return replaceEncodingFilter(oldFilter, newFilter); }

virtual SWModule& SWModule::replaceEncodingFilter ( SWFilter oldFilter,
SWFilter newFilter 
) [inline, virtual, inherited]

Replaces an EncodingFilter in this module's encodingfilters queue

Parameters:
oldfilter the filter to remove
newfilter the filter to add in its place
Returns:
*this

Definition at line 547 of file swmodule.h.

00547                                                                                       {
00548         FilterList::iterator iter;
00549         for (iter = encodingFilters->begin(); iter != encodingFilters->end(); iter++) {
00550             if (*iter == oldFilter)
00551                 *iter = newFilter;
00552         }
00553         return *this;
00554     }

SWDEPRECATED SWModule& SWModule::ReplaceRenderFilter ( SWFilter oldFilter,
SWFilter newFilter 
) [inline, inherited]

Definition at line 509 of file swmodule.h.

00509 { return replaceRenderFilter(oldFilter, newFilter); }

virtual SWModule& SWModule::replaceRenderFilter ( SWFilter oldFilter,
SWFilter newFilter 
) [inline, virtual, inherited]

Replaces a RenderFilter in this module's renderfilters queue

Parameters:
oldfilter the filter to remove
newfilter the filter to add in its place
Returns:
*this

Definition at line 501 of file swmodule.h.

00501                                                                                     {
00502         FilterList::iterator iter;
00503         for (iter = renderFilters->begin(); iter != renderFilters->end(); iter++) {
00504             if (*iter == oldFilter)
00505                 *iter = newFilter;
00506         }
00507         return *this;
00508     }

long SWCacher::resourceConsumption (  )  [virtual, inherited]

Reimplemented in FileMgr.

Definition at line 39 of file swcacher.cpp.

00039                                    {
00040     return 0;
00041 }

SWDEPRECATED ListKey& SWModule::Search ( const char *  istr,
int  searchType = 0,
int  flags = 0,
SWKey scope = 0,
bool *  justCheckIfSupported = 0,
void(*)(char, void *)  percent = &nullPercent,
void *  percentUserData = 0 
) [inline, inherited]

Definition at line 389 of file swmodule.h.

00389 {   return search(istr, searchType, flags, scope, justCheckIfSupported, percent, percentUserData);  }

ListKey & SWModule::search ( const char *  istr,
int  searchType = 0,
int  flags = 0,
SWKey scope = 0,
bool *  justCheckIfSupported = 0,
void(*)(char, void *)  percent = &nullPercent,
void *  percentUserData = 0 
) [virtual, inherited]

Searches a module for a string

Parameters:
istr string for which to search
searchType type of search to perform >=0 - regex -1 - phrase -2 - multiword -3 - entryAttrib (eg. Word//Strongs/G1234/) -4 - Lucene
flags options flags for search
scope Key containing the scope. VerseKey or ListKey are useful here.
justCheckIfSupported if set, don't search, only tell if this function supports requested search.
percent Callback function to get the current search status in %.
percentUserData User data that is given to the callback function as parameter.
Returns:
ListKey set to verses that contain istr

Implements SWSearchable.

Definition at line 366 of file swmodule.cpp.

00366                                                                                                                                                                      {
00367 
00368     listKey.ClearList();
00369     SWBuf term = istr;
00370     bool includeComponents = false; // for entryAttrib e.g., /Lemma.1/ 
00371 
00372 #ifdef USELUCENE
00373     SWBuf target = getConfigEntry("AbsoluteDataPath");
00374     if (!target.endsWith("/") && !target.endsWith("\\")) {
00375         target.append('/');
00376     }
00377     target.append("lucene");
00378 #endif
00379     if (justCheckIfSupported) {
00380         *justCheckIfSupported = (searchType >= -3);
00381 #ifdef USELUCENE
00382         if ((searchType == -4) && (IndexReader::indexExists(target.c_str()))) {
00383             *justCheckIfSupported = true;
00384         }
00385 #endif
00386         return listKey;
00387     }
00388     
00389     SWKey *saveKey = 0;
00390     SWKey *searchKey = 0;
00391     SWKey *resultKey = createKey();
00392     regex_t preg;
00393     vector<SWBuf> words;
00394     vector<SWBuf> window;
00395     const char *sres;
00396     terminateSearch = false;
00397     char perc = 1;
00398     bool savePEA = isProcessEntryAttributes();
00399 
00400     // determine if we might be doing special strip searches.  useful for knowing if we can use shortcuts
00401     bool specialStrips = (getConfigEntry("LocalStripFilter")
00402                        || (getConfig().has("GlobalOptionFilter", "UTF8GreekAccents"))
00403                        || (getConfig().has("GlobalOptionFilter", "UTF8HebrewPoints"))
00404                        || (getConfig().has("GlobalOptionFilter", "UTF8ArabicPoints"))
00405                        || (strchr(istr, '<')));
00406 
00407     setProcessEntryAttributes(searchType == -3);
00408     
00409 
00410     if (!key->isPersist()) {
00411         saveKey = createKey();
00412         *saveKey = *key;
00413     }
00414     else    saveKey = key;
00415 
00416     searchKey = (scope)?scope->clone():(key->isPersist())?key->clone():0;
00417     if (searchKey) {
00418         searchKey->setPersist(true);
00419         setKey(*searchKey);
00420     }
00421 
00422     (*percent)(perc, percentUserData);
00423 
00424     *this = BOTTOM;
00425     long highIndex = key->getIndex();
00426     if (!highIndex)
00427         highIndex = 1;      // avoid division by zero errors.
00428     *this = TOP;
00429     if (searchType >= 0) {
00430         flags |=searchType|REG_NOSUB|REG_EXTENDED;
00431         regcomp(&preg, istr, flags);
00432     }
00433 
00434     (*percent)(++perc, percentUserData);
00435 
00436 
00437 #ifdef USELUCENE
00438     if (searchType == -4) { // lucene
00439         
00440         lucene::index::IndexReader    *ir = 0;
00441         lucene::search::IndexSearcher *is = 0;
00442         Query                         *q  = 0;
00443         Hits                          *h  = 0;
00444         SWTRY {
00445             ir = IndexReader::open(target);
00446             is = new IndexSearcher(ir);
00447             (*percent)(10, percentUserData);
00448 
00449             const TCHAR *stopWords[] = { 0 };
00450             standard::StandardAnalyzer analyzer(stopWords);
00451             q = QueryParser::parse((wchar_t *)utf8ToWChar(istr).getRawData(), _T("content"), &analyzer);
00452             (*percent)(20, percentUserData);
00453             h = is->search(q);
00454             (*percent)(80, percentUserData);
00455 
00456             // iterate thru each good module position that meets the search
00457             bool checkBounds = getKey()->isBoundSet();
00458             for (unsigned long i = 0; i < (unsigned long)h->length(); i++) {
00459                 Document &doc = h->doc(i);
00460 
00461                 // set a temporary verse key to this module position
00462                 *resultKey = wcharToUTF8(doc.get(_T("key"))); //TODO Does a key always accept utf8?
00463 
00464                 // check to see if it sets ok (within our bounds) and if not, skip
00465                 if (checkBounds) {
00466                     *getKey() = *resultKey;
00467                     if (*getKey() != *resultKey) {
00468                         continue;
00469                     }
00470                 }
00471                 listKey << *resultKey;
00472                 listKey.GetElement()->userData = (__u64)((__u32)(h->score(i)*100));
00473             }
00474             (*percent)(98, percentUserData);
00475         }
00476         SWCATCH (...) {
00477             q = 0;
00478             // invalid clucene query
00479         }
00480         delete h;
00481         delete q;
00482 
00483         delete is;
00484         if (ir) {
00485             ir->close();
00486         }
00487     }
00488 #endif
00489 
00490     // some pre-loop processing
00491     switch (searchType) {
00492 
00493     // phrase
00494     case -1:
00495         // let's see if we're told to ignore case.  If so, then we'll touppstr our term
00496         if ((flags & REG_ICASE) == REG_ICASE) toupperstr(term);
00497         break;
00498 
00499     // multi-word
00500     case -2:
00501     case -5:
00502         // let's break the term down into our words vector
00503         while (1) {
00504             const char *word = term.stripPrefix(' ');
00505             if (!word) {
00506                 words.push_back(term);
00507                 break;
00508             }
00509             words.push_back(word);
00510         }
00511         if ((flags & REG_ICASE) == REG_ICASE) {
00512             for (unsigned int i = 0; i < words.size(); i++) {
00513                 toupperstr(words[i]);
00514             }
00515         }
00516         break;
00517 
00518     // entry attributes
00519     case -3:
00520         // let's break the attribute segs down.  We'll reuse our words vector for each segment
00521         while (1) {
00522             const char *word = term.stripPrefix('/');
00523             if (!word) {
00524                 words.push_back(term);
00525                 break;
00526             }
00527             words.push_back(word);
00528         }
00529         if ((words.size()>2) && words[2].endsWith(".")) {
00530             includeComponents = true;
00531             words[2]--;
00532         }
00533         break;
00534     }
00535 
00536 
00537     // our main loop to iterate the module and find the stuff
00538     perc = 5;
00539     (*percent)(perc, percentUserData);
00540 
00541     
00542     while ((searchType != -4) && !popError() && !terminateSearch) {
00543         long mindex = key->getIndex();
00544         float per = (float)mindex / highIndex;
00545         per *= 93;
00546         per += 5;
00547         char newperc = (char)per;
00548         if (newperc > perc) {
00549             perc = newperc;
00550             (*percent)(perc, percentUserData);
00551         }
00552         else if (newperc < perc) {
00553 #ifndef _MSC_VER
00554             std::cerr << "Serious error: new percentage complete is less than previous value\n";
00555             std::cerr << "index: " << (key->getIndex()) << "\n";
00556             std::cerr << "highIndex: " << highIndex << "\n";
00557             std::cerr << "newperc ==" << (int)newperc << "%" << "is smaller than\n";
00558             std::cerr << "perc == "  << (int )perc << "% \n";
00559 #endif
00560         }
00561         if (searchType >= 0) {
00562             if (!regexec(&preg,  stripText(), 0, 0, 0)) {
00563                 *resultKey = *getKey();
00564                 resultKey->clearBound();
00565                 listKey << *resultKey;
00566             }
00567         }
00568 
00569         // phrase
00570         else {
00571             SWBuf textBuf;
00572             switch (searchType) {
00573 
00574             // phrase
00575             case -1:
00576                 textBuf = stripText();
00577                 if ((flags & REG_ICASE) == REG_ICASE) toupperstr(textBuf);
00578                 sres = strstr(textBuf.c_str(), term.c_str());
00579                 if (sres) { //it's also in the stripText(), so we have a valid search result item now
00580                     *resultKey = *getKey();
00581                     resultKey->clearBound();
00582                     listKey << *resultKey;
00583                 }
00584                 break;
00585 
00586             // multiword
00587             case -2: { // enclose our allocations
00588                 int loopCount = 0;
00589                 unsigned int foundWords = 0;
00590                 do {
00591                     textBuf = ((loopCount == 0)&&(!specialStrips)) ? getRawEntry() : stripText();
00592                     foundWords = 0;
00593                     
00594                     for (unsigned int i = 0; i < words.size(); i++) {
00595                         if ((flags & REG_ICASE) == REG_ICASE) toupperstr(textBuf);
00596                         sres = strstr(textBuf.c_str(), words[i].c_str());
00597                         if (!sres) {
00598                             break; //for loop
00599                         }
00600                         foundWords++;
00601                     }
00602                     
00603                     loopCount++;
00604                 } while ( (loopCount < 2) && (foundWords == words.size()));
00605                 
00606                 if ((loopCount == 2) && (foundWords == words.size())) { //we found the right words in both raw and stripped text, which means it's a valid result item
00607                     *resultKey = *getKey();
00608                     resultKey->clearBound();
00609                     listKey << *resultKey;
00610                 }
00611                 }
00612                 break;
00613 
00614             // entry attributes
00615             case -3: {
00616                 renderText();   // force parse
00617                 AttributeTypeList &entryAttribs = getEntryAttributes();
00618                 AttributeTypeList::iterator i1Start, i1End;
00619                 AttributeList::iterator i2Start, i2End;
00620                 AttributeValue::iterator i3Start, i3End;
00621 
00622                 if ((words.size()) && (words[0].length())) {
00623 // cout << "Word: " << words[0] << endl;
00624                 for (i1Start = entryAttribs.begin(); i1Start != entryAttribs.end(); ++i1Start) {
00625 // cout << "stuff: " << i1Start->first.c_str() << endl;
00626                 }
00627                     i1Start = entryAttribs.find(words[0]);
00628                     i1End = i1Start;
00629                     if (i1End != entryAttribs.end()) {
00630                         i1End++;
00631                     }
00632                 }
00633                 else {
00634                     i1Start = entryAttribs.begin();
00635                     i1End   = entryAttribs.end();
00636                 }
00637                 for (;i1Start != i1End; i1Start++) {
00638                     if ((words.size()>1) && (words[1].length())) {
00639                         i2Start = i1Start->second.find(words[1]);
00640                         i2End = i2Start;
00641                         if (i2End != i1Start->second.end())
00642                             i2End++;
00643                     }
00644                     else {
00645                         i2Start = i1Start->second.begin();
00646                         i2End   = i1Start->second.end();
00647                     }
00648                     for (;i2Start != i2End; i2Start++) {
00649                         if ((words.size()>2) && (words[2].length()) && (!includeComponents)) {
00650                             i3Start = i2Start->second.find(words[2]);
00651                             i3End = i3Start;
00652                             if (i3End != i2Start->second.end())
00653                                 i3End++;
00654                         }
00655                         else {
00656                             i3Start = i2Start->second.begin();
00657                             i3End   = i2Start->second.end();
00658                         }
00659                         for (;i3Start != i3End; i3Start++) {
00660                             if ((words.size()>3) && (words[3].length())) {
00661                                 if (includeComponents) {
00662                                     SWBuf key = i3Start->first.c_str();
00663                                     key = key.stripPrefix('.', true);
00664                                     // we're iterating all 3 level keys, so be sure we match our
00665                                     // prefix (e.g., Lemma, Lemma.1, Lemma.2, etc.)
00666                                     if (key != words[2]) continue;
00667                                 }
00668                                 if (flags & SEARCHFLAG_MATCHWHOLEENTRY) {
00669                                     bool found = !(((flags & REG_ICASE) == REG_ICASE) ? sword::stricmp(i3Start->second.c_str(), words[3]) : strcmp(i3Start->second.c_str(), words[3]));
00670                                     sres = (found) ? i3Start->second.c_str() : 0;
00671                                 }
00672                                 else {
00673                                     sres = ((flags & REG_ICASE) == REG_ICASE) ? stristr(i3Start->second.c_str(), words[3]) : strstr(i3Start->second.c_str(), words[3]);
00674                                 }
00675                                 if (sres) {
00676                                     *resultKey = *getKey();
00677                                     resultKey->clearBound();
00678                                     listKey << *resultKey;
00679                                     break;
00680                                 }
00681                             }
00682                         }
00683                         if (i3Start != i3End)
00684                             break;
00685                     }
00686                     if (i2Start != i2End)
00687                         break;
00688                 }
00689                 break;
00690             }
00691             case -5:
00692                 AttributeList &words = getEntryAttributes()["Word"];
00693                 SWBuf kjvWord = "";
00694                 SWBuf bibWord = "";
00695                 for (AttributeList::iterator it = words.begin(); it != words.end(); it++) {
00696                     int parts = atoi(it->second["PartCount"]);
00697                     SWBuf lemma = "";
00698                     SWBuf morph = "";
00699                     for (int i = 1; i <= parts; i++) {
00700                         SWBuf key = "";
00701                         key = (parts == 1) ? "Lemma" : SWBuf().setFormatted("Lemma.%d", i).c_str();
00702                         AttributeValue::iterator li = it->second.find(key);
00703                         if (li != it->second.end()) {
00704                             if (i > 1) lemma += " ";
00705                             key = (parts == 1) ? "LemmaClass" : SWBuf().setFormatted("LemmaClass.%d", i).c_str();
00706                             AttributeValue::iterator lci = it->second.find(key);
00707                             if (lci != it->second.end()) {
00708                                 lemma += lci->second + ":";
00709                             }
00710                             lemma += li->second;
00711                         }
00712                         key = (parts == 1) ? "Morph" : SWBuf().setFormatted("Morph.%d", i).c_str();
00713                         li = it->second.find(key);
00714                         // silly.  sometimes morph counts don't equal lemma counts
00715                         if (i == 1 && parts != 1 && li == it->second.end()) {
00716                             li = it->second.find("Morph");
00717                         }
00718                         if (li != it->second.end()) {
00719                             if (i > 1) morph += " ";
00720                             key = (parts == 1) ? "MorphClass" : SWBuf().setFormatted("MorphClass.%d", i).c_str();
00721                             AttributeValue::iterator lci = it->second.find(key);
00722                             // silly.  sometimes morph counts don't equal lemma counts
00723                             if (i == 1 && parts != 1 && lci == it->second.end()) {
00724                                 lci = it->second.find("MorphClass");
00725                             }
00726                             if (lci != it->second.end()) {
00727                                 morph += lci->second + ":";
00728                             }
00729                             morph += li->second;
00730                         }
00731                         // TODO: add src tags and maybe other attributes
00732                     }
00733                     while (window.size() < (unsigned)flags) {
00734                         
00735                     }
00736                 }
00737                 break;
00738             } // end switch
00739         }
00740         (*this)++;
00741     }
00742     
00743 
00744     // cleaup work
00745     if (searchType >= 0)
00746         regfree(&preg);
00747 
00748     setKey(*saveKey);
00749 
00750     if (!saveKey->isPersist())
00751         delete saveKey;
00752 
00753     if (searchKey)
00754         delete searchKey;
00755     delete resultKey;
00756 
00757     listKey = TOP;
00758     setProcessEntryAttributes(savePEA);
00759 
00760 
00761     (*percent)(100, percentUserData);
00762 
00763 
00764     return listKey;
00765 }

void SWModule::setConfig ( ConfigEntMap config  )  [virtual, inherited]

Definition at line 913 of file swmodule.cpp.

00913                                              {
00914     this->config = config;
00915 }

void SWModule::setDisplay ( SWDisplay idisp  )  [virtual, inherited]

Sets display driver

Parameters:
idisp pointer to SWDisplay class to assign to this module

Definition at line 235 of file swmodule.cpp.

00235                                           {
00236     disp = idisp;
00237 }

void zLD::setEntry ( const char *  inbuf,
long  len = -1 
) [virtual]

Modify the current module entry text - only if module isWritable()

Reimplemented from SWModule.

Definition at line 141 of file zld.cpp.

00141                                               {
00142     setText(*key, inbuf, len);
00143 }

virtual void SWModule::setIndex ( long  iindex  )  [inline, virtual, inherited]

Reimplemented in SWCom, and SWText.

Definition at line 256 of file swmodule.h.

00256 { entryIndex = iindex; }

SWDEPRECATED char SWModule::SetKey ( const SWKey ikey  )  [inline, inherited]
Deprecated:
Use setKey() instead.

Definition at line 222 of file swmodule.h.

00222 { return setKey(ikey); }

SWDEPRECATED char SWModule::SetKey ( const SWKey ikey  )  [inline, inherited]
Deprecated:
Use setKey() instead.

Definition at line 218 of file swmodule.h.

00218 { return setKey(ikey); }

char SWModule::setKey ( const SWKey ikey  )  [inline, inherited]

Sets a key to this module for position to a particular record

Parameters:
ikey The SWKey which should be used as new key.
Returns:
Error status

Definition at line 214 of file swmodule.h.

00214 { return setKey(&ikey); }

char SWModule::setKey ( const SWKey ikey  )  [virtual, inherited]

Sets a key to this module for position to a particular record

Parameters:
ikey key with which to set this module
Returns:
error status

Definition at line 271 of file swmodule.cpp.

00271                                        {
00272     SWKey *oldKey = 0;
00273 
00274     if (key) {
00275         if (!key->isPersist())  // if we have our own copy
00276             oldKey = key;
00277     }
00278 
00279     if (!ikey->isPersist()) {       // if we are to keep our own copy
00280          key = createKey();
00281         *key = *ikey;
00282     }
00283     else     key = (SWKey *)ikey;       // if we are to just point to an external key
00284 
00285     if (oldKey)
00286         delete oldKey;
00287 
00288     return 0;
00289 }

void SWLD::setPosition ( SW_POSITION  pos  )  [virtual, inherited]

Positions this modules to a logical position entry

Parameters:
pos position (e.g. TOP, BOTTOM)

Reimplemented from SWModule.

Definition at line 83 of file swld.cpp.

00083                                     {
00084     if (!key->isTraversable()) {
00085         switch (p) {
00086         case POS_TOP:
00087             *key = "";
00088             break;
00089         case POS_BOTTOM:
00090             *key = "zzzzzzzzz";
00091             break;
00092         } 
00093     }
00094     else    *key = p;
00095     getRawEntryBuf();
00096 }

virtual void SWModule::setProcessEntryAttributes ( bool  val  )  const [inline, virtual, inherited]

Processing Entry Attributes can be expensive. This method allows turning the processing off if they are not desired. Some internal engine processing turns them off (like searching) temporarily for optimization.

Definition at line 693 of file swmodule.h.

00693 { procEntAttr = val; }

virtual void SWModule::setSkipConsecutiveLinks ( bool  val  )  [inline, virtual, inherited]

Whether or not to only hit one entry when iterating encounters consecutive links when iterating

Parameters:
val = true means only include entry once in iteration

Definition at line 669 of file swmodule.h.

00669 { skipConsecutiveLinks = val; }

void zStr::setText ( const char *  ikey,
const char *  buf,
long  len = -1 
) [inherited]

Definition at line 432 of file zstr.cpp.

00432                                                               {
00433 
00434     __u32 start, outstart;
00435     __u32 size, outsize;
00436     __s32 endoff;
00437     long idxoff = 0;
00438     __s32 shiftSize;
00439     static const char nl[] = {13, 10};
00440     char *tmpbuf = 0;
00441     char *key = 0;
00442     char *dbKey = 0;
00443     char *idxBytes = 0;
00444     char *outbuf = 0;
00445     char *ch = 0;
00446 
00447     len = (len < 0) ? strlen(buf) : len;
00448     stdstr(&key, ikey, 3);
00449     if (!caseSensitive) toupperstr_utf8(key, strlen(key)*3);
00450 
00451     char notFound = findKeyIndex(ikey, &idxoff, 0);
00452     if (!notFound) {
00453         getKeyFromIdxOffset(idxoff, &dbKey);
00454         int diff = strcmp(key, dbKey);
00455         if (diff < 0) {
00456         }
00457         else if (diff > 0) {
00458             idxoff += IDXENTRYSIZE;
00459         }
00460         else if ((!diff) && (len > 0 /*we're not deleting*/)) { // got absolute entry
00461             do {
00462                 idxfd->seek(idxoff, SEEK_SET);
00463                 idxfd->read(&start, 4);
00464                 idxfd->read(&size, 4);
00465                 start = swordtoarch32(start);
00466                 size = swordtoarch32(size);
00467 
00468                 tmpbuf = new char [ size + 2 ];
00469                 memset(tmpbuf, 0, size + 2);
00470                 datfd->seek(start, SEEK_SET);
00471                 datfd->read(tmpbuf, size);
00472 
00473                 for (ch = tmpbuf; *ch; ch++) {      // skip over index string
00474                     if (*ch == 10) {
00475                         ch++;
00476                         break;
00477                     }
00478                 }
00479                 memmove(tmpbuf, ch, size - (unsigned long)(ch-tmpbuf));
00480 
00481                 // resolve link
00482                 if (!strncmp(tmpbuf, "@LINK", 5) && (len)) {
00483                     for (ch = tmpbuf; *ch; ch++) {      // null before nl
00484                         if (*ch == 10) {
00485                             *ch = 0;
00486                             break;
00487                         }
00488                     }
00489                     findKeyIndex(tmpbuf + IDXENTRYSIZE, &idxoff);
00490                     delete [] tmpbuf;
00491                 }
00492                 else break;
00493             }
00494             while (true);   // while we're resolving links
00495         }
00496     }
00497 
00498     endoff = idxfd->seek(0, SEEK_END);
00499 
00500     shiftSize = endoff - idxoff;
00501 
00502     if (shiftSize > 0) {
00503             idxBytes = new char [ shiftSize ];
00504         idxfd->seek(idxoff, SEEK_SET);
00505         idxfd->read(idxBytes, shiftSize);
00506     }
00507 
00508     outbuf = new char [ len + strlen(key) + 5 ];
00509     sprintf(outbuf, "%s%c%c", key, 13, 10);
00510     size = strlen(outbuf);
00511     if (len > 0) {  // NOT a link
00512         if (!cacheBlock) {
00513             flushCache();
00514             cacheBlock = new EntriesBlock();
00515             cacheBlockIndex = (zdxfd->seek(0, SEEK_END) / ZDXENTRYSIZE);
00516         }
00517         else if (cacheBlock->getCount() >= blockCount) {
00518             flushCache();
00519             cacheBlock = new EntriesBlock();
00520             cacheBlockIndex = (zdxfd->seek(0, SEEK_END) / ZDXENTRYSIZE);
00521         }
00522         __u32 entry = cacheBlock->addEntry(buf);
00523         cacheDirty = true;
00524         outstart = archtosword32(cacheBlockIndex);
00525         outsize = archtosword32(entry);
00526         memcpy (outbuf + size, &outstart, sizeof(__u32));
00527         memcpy (outbuf + size + sizeof(__u32), &outsize, sizeof(__u32));
00528         size += (sizeof(__u32) * 2);
00529     }
00530     else {  // link
00531         memcpy(outbuf + size, buf, len);
00532         size += len;
00533     }
00534 
00535     start = datfd->seek(0, SEEK_END);
00536 
00537     outstart = archtosword32(start);
00538     outsize  = archtosword32(size);
00539 
00540     idxfd->seek(idxoff, SEEK_SET);
00541     if (len > 0) {
00542         datfd->seek(start, SEEK_SET);
00543         datfd->write(outbuf, size);
00544 
00545         // add a new line to make data file easier to read in an editor
00546         datfd->write(&nl, 2);
00547         
00548         idxfd->write(&outstart, 4);
00549         idxfd->write(&outsize, 4);
00550         if (idxBytes) {
00551             idxfd->write(idxBytes, shiftSize);
00552         }
00553     }
00554     else {  // delete entry
00555         if (idxBytes) {
00556             idxfd->write(idxBytes+IDXENTRYSIZE, shiftSize-IDXENTRYSIZE);
00557             idxfd->seek(-1, SEEK_CUR);  // last valid byte
00558             FileMgr::getSystemFileMgr()->trunc(idxfd);  // truncate index
00559         }
00560     }
00561 
00562     if (idxBytes)
00563         delete [] idxBytes;
00564     delete [] key;
00565     delete [] outbuf;
00566     free(dbKey);
00567 }

void SWModule::setType ( const char *  imodtype  )  [inline, inherited]

Definition at line 327 of file swmodule.h.

00327 { stdstr(&modtype, imodtype); }

virtual void SWModule::stripFilter ( SWBuf buf,
const SWKey key 
) const [inline, virtual, inherited]

StripFilter run a buf through this module's Strip Filters

Parameters:
buf the buffer to filter
key key location from where this buffer was extracted

Definition at line 591 of file swmodule.h.

00591                                                                  {
00592         filterBuffer(stripFilters, buf, key);
00593     }

SWDEPRECATED const char* SWModule::StripText ( const char *  buf = 0,
int  len = -1 
) [inline, inherited]

Definition at line 634 of file swmodule.h.

00634 { return stripText(buf, len); }

const char * SWModule::stripText ( const SWKey tmpKey  )  [virtual, inherited]

Produces plain text, without markup, of the module entry at the supplied key

Parameters:
tmpKey desired module entry
Returns:
result buffer

Definition at line 884 of file swmodule.cpp.

00884                                                    {
00885     SWKey *saveKey;
00886     const char *retVal;
00887 
00888     if (!key->isPersist()) {
00889         saveKey = createKey();
00890         *saveKey = *key;
00891     }
00892     else    saveKey = key;
00893 
00894     setKey(*tmpKey);
00895 
00896     retVal = stripText();
00897 
00898     setKey(*saveKey);
00899 
00900     if (!saveKey->isPersist())
00901         delete saveKey;
00902 
00903     return retVal;
00904 }

const char * SWModule::stripText ( const char *  buf = 0,
int  len = -1 
) [virtual, inherited]

Produces plain text, without markup, of the current module entry, or supplied text

Parameters:
buf buf to massage instead of current module entry; if buf is 0, the current text will be used
len max len to process
Returns:
result buffer

Definition at line 777 of file swmodule.cpp.

00777                                                         {
00778     return renderText(buf, len, false);
00779 }

void SWLD::strongsPad ( char *  buf  )  [static, protected, inherited]

Definition at line 118 of file swld.cpp.

00119 {
00120     char *check;
00121     int size = 0;
00122     int len = strlen(buf);
00123     char subLet = 0;
00124     bool bang = false, prefix=false;
00125     if ((len < 9) && (len > 0)) {
00126         // Handle initial G or H
00127         if (*buf == 'G' || *buf == 'H' || *buf == 'g' || *buf == 'h') {
00128             buf += 1;
00129             len -= 1;
00130             prefix = true;
00131         }
00132 
00133         for (check = buf; *(check); check++) {
00134             if (!isdigit(*check))
00135                 break;
00136             else size++;
00137         }
00138 
00139         if (size && ((size == len) || (size == len - 1) || (size == (len-2)))) {
00140             if (*check == '!') {
00141                 bang = true;
00142                 check++;
00143             }
00144             if (isalpha(*check)) {
00145                 subLet = toupper(*check);
00146                 *(check-(bang?1:0)) = 0;
00147             }
00148             sprintf(buf, prefix?"%.4d":"%.5d", atoi(buf));
00149             if (subLet) {
00150                 check = buf+(strlen(buf));
00151                 if (bang) {
00152                     *check++ = '!';
00153                 }
00154                 *check++ = subLet;
00155                 *check = 0;
00156             }
00157         }
00158     }
00159 }

SWDEPRECATED const char* SWModule::Type ( const char *  imodtype  )  [inline, inherited]

Sets module type

Parameters:
imodtype Value which to set modtype; [0]-only get
Returns:
pointer to modtype

Definition at line 326 of file swmodule.h.

00326 { setType(imodtype); return getType(); }

SWDEPRECATED const char* SWModule::Type (  )  const [inline, inherited]

Definition at line 319 of file swmodule.h.

00319 { return getType(); }


Member Data Documentation

ConfigEntMap* SWModule::config [protected, inherited]

Definition at line 105 of file swmodule.h.

FileDesc* zStr::datfd [protected, inherited]

Definition at line 52 of file zstr.h.

char SWModule::direction [protected, inherited]

Definition at line 121 of file swmodule.h.

SWDisplay* SWModule::disp [protected, inherited]

this module's display object

Definition at line 126 of file swmodule.h.

char SWModule::encoding [protected, inherited]

Definition at line 123 of file swmodule.h.

FilterList* SWModule::encodingFilters [protected, inherited]

filters to be executed to decode text for display

Definition at line 144 of file swmodule.h.

char* SWLD::entkeytxt [mutable, protected, inherited]

Definition at line 37 of file swld.h.

AttributeTypeList SWModule::entryAttributes [mutable, protected, inherited]

Definition at line 106 of file swmodule.h.

SWBuf SWModule::entryBuf [mutable, protected, inherited]

Definition at line 129 of file swmodule.h.

long SWModule::entryIndex [mutable, protected, inherited]

Definition at line 147 of file swmodule.h.

int SWModule::entrySize [mutable, protected, inherited]

Definition at line 146 of file swmodule.h.

char SWModule::error [mutable, protected, inherited]

Definition at line 109 of file swmodule.h.

const int zStr::IDXENTRYSIZE = 8 [static, protected, inherited]

Definition at line 55 of file zstr.h.

FileDesc* zStr::idxfd [protected, inherited]

Definition at line 51 of file zstr.h.

SWKey* SWModule::key [protected, inherited]

the current key

Definition at line 113 of file swmodule.h.

ListKey SWModule::listKey [protected, inherited]

Definition at line 115 of file swmodule.h.

char SWModule::markup [protected, inherited]

Definition at line 122 of file swmodule.h.

char* SWModule::moddesc [protected, inherited]

Definition at line 117 of file swmodule.h.

char* SWModule::modlang [protected, inherited]

Definition at line 119 of file swmodule.h.

char* SWModule::modname [protected, inherited]

Definition at line 116 of file swmodule.h.

char* SWModule::modtype [protected, inherited]

Definition at line 118 of file swmodule.h.

char zStr::nl [inherited]

Definition at line 64 of file zstr.h.

OptionFilterList* SWModule::optionFilters [protected, inherited]

filters to be executed to change markup to user prefs

Definition at line 141 of file swmodule.h.

ConfigEntMap SWModule::ownConfig [protected, inherited]

Definition at line 104 of file swmodule.h.

bool SWModule::procEntAttr [mutable, protected, inherited]

Definition at line 107 of file swmodule.h.

SWORD_NAMESPACE_START SWModule::StdOutDisplay SWModule::rawdisp [static, protected, inherited]

Definition at line 128 of file swmodule.h.

FilterList* SWModule::rawFilters [protected, inherited]

filters to be executed immediately upon fileread

Definition at line 135 of file swmodule.h.

FilterList* SWModule::renderFilters [protected, inherited]

filters to be executed to format for display

Definition at line 138 of file swmodule.h.

bool SWModule::skipConsecutiveLinks [protected, inherited]

Definition at line 110 of file swmodule.h.

FilterList* SWModule::stripFilters [protected, inherited]

filters to be executed to remove all markup (for searches)

Definition at line 132 of file swmodule.h.

bool SWLD::strongsPadding [protected, inherited]

Definition at line 39 of file swld.h.

bool SWModule::terminateSearch [inherited]

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 from another thread.

Definition at line 158 of file swmodule.h.

FileDesc* zStr::zdtfd [protected, inherited]

Definition at line 54 of file zstr.h.

const int zStr::ZDXENTRYSIZE = 8 [static, protected, inherited]

Definition at line 56 of file zstr.h.

FileDesc* zStr::zdxfd [protected, inherited]

Definition at line 53 of file zstr.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