diff options
Diffstat (limited to 'src/modules/comments')
-rw-r--r-- | src/modules/comments/hrefcom/hrefcom.cpp | 14 | ||||
-rw-r--r-- | src/modules/comments/rawcom/rawcom.cpp | 39 | ||||
-rw-r--r-- | src/modules/comments/rawcom4/Makefile | 5 | ||||
-rw-r--r-- | src/modules/comments/rawcom4/rawcom4.cpp | 39 | ||||
-rw-r--r-- | src/modules/comments/rawfiles/rawfiles.cpp | 58 | ||||
-rw-r--r-- | src/modules/comments/swcom.cpp | 30 | ||||
-rw-r--r-- | src/modules/comments/zcom/zcom.cpp | 47 |
7 files changed, 125 insertions, 107 deletions
diff --git a/src/modules/comments/hrefcom/hrefcom.cpp b/src/modules/comments/hrefcom/hrefcom.cpp index 7035b08..3716dbf 100644 --- a/src/modules/comments/hrefcom/hrefcom.cpp +++ b/src/modules/comments/hrefcom/hrefcom.cpp @@ -1,10 +1,12 @@ /****************************************************************************** - * hrefcom.cpp - code for class 'HREFCom'- a module that produces HTML HREFs - * pointing to actual text desired. Uses standard + * + * hrefcom.cpp - code for class 'HREFCom'- a module that produces HTML + * HREFs pointing to actual text desired. Uses standard * files: ot and nt using indexs ??.bks ??.cps ??.vss * + * $Id: hrefcom.cpp 2833 2013-06-29 06:40:28Z chrislit $ * - * Copyright 2009 CrossWire Bible Society (http://www.crosswire.org) + * Copyright 1998-2013 CrossWire Bible Society (http://www.crosswire.org) * CrossWire Bible Society * P. O. Box 2528 * Tempe, AZ 85280-2528 @@ -67,19 +69,19 @@ HREFCom::~HREFCom() * RET: string buffer with verse */ -SWBuf &HREFCom::getRawEntryBuf() { +SWBuf &HREFCom::getRawEntryBuf() const { long start; unsigned short size; VerseKey *key = 0; key = &getVerseKey(); - findOffset(key->Testament(), key->TestamentIndex(), &start, &size); + findOffset(key->getTestament(), key->getTestamentIndex(), &start, &size); entrySize = size; // support getEntrySize call SWBuf tmpbuf; - readText(key->Testament(), start, size, tmpbuf); + readText(key->getTestament(), start, size, tmpbuf); entryBuf = prefix; entryBuf += tmpbuf.c_str(); prepText(entryBuf); diff --git a/src/modules/comments/rawcom/rawcom.cpp b/src/modules/comments/rawcom/rawcom.cpp index c0404ae..5189cdc 100644 --- a/src/modules/comments/rawcom/rawcom.cpp +++ b/src/modules/comments/rawcom/rawcom.cpp @@ -1,9 +1,12 @@ /****************************************************************************** - * rawcom.cpp - code for class 'RawCom'- a module that reads raw commentary - * files: ot and nt using indexs ??.bks ??.cps ??.vss * + * rawcom.cpp - code for class 'RawCom'- a module that reads raw + * commentary files: + * ot and nt using indexs ??.bks ??.cps ??.vss * - * Copyright 2009 CrossWire Bible Society (http://www.crosswire.org) + * $Id: rawcom.cpp 2833 2013-06-29 06:40:28Z chrislit $ + * + * Copyright 1997-2013 CrossWire Bible Society (http://www.crosswire.org) * CrossWire Bible Society * P. O. Box 2528 * Tempe, AZ 85280-2528 @@ -54,7 +57,7 @@ RawCom::~RawCom() } -bool RawCom::isWritable() { +bool RawCom::isWritable() const { return ((idxfp[0]->getFd() > 0) && ((idxfp[0]->mode & FileMgr::RDWR) == FileMgr::RDWR)); } /****************************************************************************** @@ -64,16 +67,16 @@ bool RawCom::isWritable() { * RET: string buffer with verse */ -SWBuf &RawCom::getRawEntryBuf() { +SWBuf &RawCom::getRawEntryBuf() const { long start = 0; unsigned short size = 0; VerseKey *key = &getVerseKey(); - findOffset(key->Testament(), key->TestamentIndex(), &start, &size); + findOffset(key->getTestament(), key->getTestamentIndex(), &start, &size); entrySize = size; // support getEntrySize call entryBuf = ""; - readText(key->Testament(), start, size, entryBuf); + readText(key->getTestament(), start, size, entryBuf); rawFilter(entryBuf, 0); // hack, decipher rawFilter(entryBuf, key); @@ -98,7 +101,7 @@ void RawCom::increment(int steps) { unsigned short size; VerseKey *tmpkey = &getVerseKey(); - findOffset(tmpkey->Testament(), tmpkey->TestamentIndex(), &start, &size); + findOffset(tmpkey->getTestament(), tmpkey->getTestamentIndex(), &start, &size); SWKey lastgood = *tmpkey; while (steps) { @@ -108,12 +111,12 @@ void RawCom::increment(int steps) { (steps > 0) ? ++(*key) : --(*key); tmpkey = &getVerseKey(); - if ((error = key->Error())) { + if ((error = key->popError())) { *key = lastgood; break; } - long index = tmpkey->TestamentIndex(); - findOffset(tmpkey->Testament(), index, &start, &size); + long index = tmpkey->getTestamentIndex(); + findOffset(tmpkey->getTestament(), index, &start, &size); if ( (((laststart != start) || (lastsize != size)) // we're a different entry // && (start > 0) @@ -129,7 +132,7 @@ void RawCom::increment(int steps) { void RawCom::setEntry(const char *inbuf, long len) { VerseKey *key = &getVerseKey(); - doSetText(key->Testament(), key->TestamentIndex(), inbuf, len); + doSetText(key->getTestament(), key->getTestamentIndex(), inbuf, len); } @@ -137,7 +140,7 @@ void RawCom::linkEntry(const SWKey *inkey) { VerseKey *destkey = &getVerseKey(); const VerseKey *srckey = &getVerseKey(inkey); - doLinkEntry(destkey->Testament(), destkey->TestamentIndex(), srckey->TestamentIndex()); + doLinkEntry(destkey->getTestament(), destkey->getTestamentIndex(), srckey->getTestamentIndex()); if (inkey != srckey) // free our key if we created a VerseKey delete srckey; @@ -153,7 +156,7 @@ void RawCom::linkEntry(const SWKey *inkey) { void RawCom::deleteEntry() { VerseKey *key = &getVerseKey(); - doSetText(key->Testament(), key->TestamentIndex(), ""); + doSetText(key->getTestament(), key->getTestamentIndex(), ""); } bool RawCom::isLinked(const SWKey *k1, const SWKey *k2) const { @@ -161,10 +164,10 @@ bool RawCom::isLinked(const SWKey *k1, const SWKey *k2) const { unsigned short size1, size2; VerseKey *vk1 = &getVerseKey(k1); VerseKey *vk2 = &getVerseKey(k2); - if (vk1->Testament() != vk2->Testament()) return false; + if (vk1->getTestament() != vk2->getTestament()) return false; - findOffset(vk1->Testament(), vk1->TestamentIndex(), &start1, &size1); - findOffset(vk2->Testament(), vk2->TestamentIndex(), &start2, &size2); + findOffset(vk1->getTestament(), vk1->getTestamentIndex(), &start1, &size1); + findOffset(vk2->getTestament(), vk2->getTestamentIndex(), &start2, &size2); if (!size1 || !size2) return false; return start1 == start2; } @@ -174,7 +177,7 @@ bool RawCom::hasEntry(const SWKey *k) const { unsigned short size; VerseKey *vk = &getVerseKey(k); - findOffset(vk->Testament(), vk->TestamentIndex(), &start, &size); + findOffset(vk->getTestament(), vk->getTestamentIndex(), &start, &size); return size; } diff --git a/src/modules/comments/rawcom4/Makefile b/src/modules/comments/rawcom4/Makefile new file mode 100644 index 0000000..a08e07e --- /dev/null +++ b/src/modules/comments/rawcom4/Makefile @@ -0,0 +1,5 @@ +
+root := ../../../..
+
+all:
+ make -C ${root}
diff --git a/src/modules/comments/rawcom4/rawcom4.cpp b/src/modules/comments/rawcom4/rawcom4.cpp index c0c4a1d..7cfc603 100644 --- a/src/modules/comments/rawcom4/rawcom4.cpp +++ b/src/modules/comments/rawcom4/rawcom4.cpp @@ -1,9 +1,12 @@ /****************************************************************************** - * rawcom4.cpp - code for class 'RawCom4'- a module that reads raw commentary - * files: ot and nt using indexs ??.bks ??.cps ??.vss * + * rawcom4.cpp - code for class 'RawCom4'- a module that reads raw + * commentary files: + * ot and nt using indexs ??.bks ??.cps ??.vss * - * Copyright 2009 CrossWire Bible Society (http://www.crosswire.org) + * $Id: rawcom4.cpp 2833 2013-06-29 06:40:28Z chrislit $ + * + * Copyright 2007-2013 CrossWire Bible Society (http://www.crosswire.org) * CrossWire Bible Society * P. O. Box 2528 * Tempe, AZ 85280-2528 @@ -53,7 +56,7 @@ RawCom4::~RawCom4() } -bool RawCom4::isWritable() { +bool RawCom4::isWritable() const { return ((idxfp[0]->getFd() > 0) && ((idxfp[0]->mode & FileMgr::RDWR) == FileMgr::RDWR)); } /****************************************************************************** @@ -63,16 +66,16 @@ bool RawCom4::isWritable() { * RET: string buffer with verse */ -SWBuf &RawCom4::getRawEntryBuf() { +SWBuf &RawCom4::getRawEntryBuf() const { long start = 0; unsigned long size = 0; VerseKey *key = &getVerseKey(); - findOffset(key->Testament(), key->TestamentIndex(), &start, &size); + findOffset(key->getTestament(), key->getTestamentIndex(), &start, &size); entrySize = size; // support getEntrySize call entryBuf = ""; - readText(key->Testament(), start, size, entryBuf); + readText(key->getTestament(), start, size, entryBuf); rawFilter(entryBuf, 0); // hack, decipher rawFilter(entryBuf, key); @@ -97,7 +100,7 @@ void RawCom4::increment(int steps) { unsigned long size; VerseKey *tmpkey = &getVerseKey(); - findOffset(tmpkey->Testament(), tmpkey->TestamentIndex(), &start, &size); + findOffset(tmpkey->getTestament(), tmpkey->getTestamentIndex(), &start, &size); SWKey lastgood = *tmpkey; while (steps) { @@ -107,12 +110,12 @@ void RawCom4::increment(int steps) { (steps > 0) ? ++(*key) : --(*key); tmpkey = &getVerseKey(); - if ((error = key->Error())) { + if ((error = key->popError())) { *key = lastgood; break; } - long index = tmpkey->TestamentIndex(); - findOffset(tmpkey->Testament(), index, &start, &size); + long index = tmpkey->getTestamentIndex(); + findOffset(tmpkey->getTestament(), index, &start, &size); if ( (((laststart != start) || (lastsize != size)) // we're a different entry // && (start > 0) @@ -128,14 +131,14 @@ void RawCom4::increment(int steps) { void RawCom4::setEntry(const char *inbuf, long len) { VerseKey *key = &getVerseKey(); - doSetText(key->Testament(), key->TestamentIndex(), inbuf, len); + doSetText(key->getTestament(), key->getTestamentIndex(), inbuf, len); } void RawCom4::linkEntry(const SWKey *inkey) { VerseKey *destkey = &getVerseKey(); const VerseKey *srckey = &getVerseKey(inkey); - doLinkEntry(destkey->Testament(), destkey->TestamentIndex(), srckey->TestamentIndex()); + doLinkEntry(destkey->getTestament(), destkey->getTestamentIndex(), srckey->getTestamentIndex()); } @@ -148,7 +151,7 @@ void RawCom4::linkEntry(const SWKey *inkey) { void RawCom4::deleteEntry() { VerseKey *key = &getVerseKey(); - doSetText(key->Testament(), key->TestamentIndex(), ""); + doSetText(key->getTestament(), key->getTestamentIndex(), ""); } bool RawCom4::isLinked(const SWKey *k1, const SWKey *k2) const { @@ -156,10 +159,10 @@ bool RawCom4::isLinked(const SWKey *k1, const SWKey *k2) const { unsigned long size1, size2; VerseKey *vk1 = &getVerseKey(k1); VerseKey *vk2 = &getVerseKey(k2); - if (vk1->Testament() != vk2->Testament()) return false; + if (vk1->getTestament() != vk2->getTestament()) return false; - findOffset(vk1->Testament(), vk1->TestamentIndex(), &start1, &size1); - findOffset(vk2->Testament(), vk2->TestamentIndex(), &start2, &size2); + findOffset(vk1->getTestament(), vk1->getTestamentIndex(), &start1, &size1); + findOffset(vk2->getTestament(), vk2->getTestamentIndex(), &start2, &size2); if (!size1 || !size2) return false; return start1 == start2; } @@ -169,7 +172,7 @@ bool RawCom4::hasEntry(const SWKey *k) const { unsigned long size; VerseKey *vk = &getVerseKey(k); - findOffset(vk->Testament(), vk->TestamentIndex(), &start, &size); + findOffset(vk->getTestament(), vk->getTestamentIndex(), &start, &size); return size; } diff --git a/src/modules/comments/rawfiles/rawfiles.cpp b/src/modules/comments/rawfiles/rawfiles.cpp index b0e24fc..7c2d524 100644 --- a/src/modules/comments/rawfiles/rawfiles.cpp +++ b/src/modules/comments/rawfiles/rawfiles.cpp @@ -1,10 +1,12 @@ /****************************************************************************** - * rawfiles.cpp - code for class 'RawFiles'- a module that produces HTML HREFs - * pointing to actual text desired. Uses standard + * + * rawfiles.cpp - code for class 'RawFiles'- a module that produces HTML + * HREFs pointing to actual text desired. Uses standard * files: ot and nt using indexs ??.bks ??.cps ??.vss * + * $Id: rawfiles.cpp 2833 2013-06-29 06:40:28Z chrislit $ * - * Copyright 2009 CrossWire Bible Society (http://www.crosswire.org) + * Copyright 1998-2013 CrossWire Bible Society (http://www.crosswire.org) * CrossWire Bible Society * P. O. Box 2528 * Tempe, AZ 85280-2528 @@ -57,31 +59,31 @@ RawFiles::~RawFiles() /** Is the module writable? :) * @return yes or no */ -bool RawFiles::isWritable() { +bool RawFiles::isWritable() const { return ((idxfp[0]->getFd() > 0) && ((idxfp[0]->mode & FileMgr::RDWR) == FileMgr::RDWR)); } /****************************************************************************** - * RawFiles::getRawEntry - Returns the correct verse when char * cast - * is requested + * RawFiles::getRawEntry - Retrieve the unprocessed entry contents at + * the current key position of this module * - * RET: string buffer with verse + * RET: entry contents */ -SWBuf &RawFiles::getRawEntryBuf() { +SWBuf &RawFiles::getRawEntryBuf() const { FileDesc *datafile; long start = 0; unsigned short size = 0; VerseKey *key = &getVerseKey(); - findOffset(key->Testament(), key->TestamentIndex(), &start, &size); + findOffset(key->getTestament(), key->getTestamentIndex(), &start, &size); entryBuf = ""; if (size) { SWBuf tmpbuf = path; tmpbuf += '/'; - readText(key->Testament(), start, size, entryBuf); + readText(key->getTestament(), start, size, entryBuf); tmpbuf += entryBuf; entryBuf = ""; datafile = FileMgr::getSystemFileMgr()->open(tmpbuf.c_str(), FileMgr::RDONLY); @@ -102,7 +104,7 @@ SWBuf &RawFiles::getRawEntryBuf() { /****************************************************************************** - * RawFiles::setEntry(char *)- Update the modules current key entry with + * RawFiles::setEntry(char *)- Update the module's current key entry with * provided text */ @@ -114,13 +116,13 @@ void RawFiles::setEntry(const char *inbuf, long len) { len = (len<0)?strlen(inbuf):len; - findOffset(key->Testament(), key->TestamentIndex(), &start, &size); + findOffset(key->getTestament(), key->getTestamentIndex(), &start, &size); if (size) { SWBuf tmpbuf; entryBuf = path; entryBuf += '/'; - readText(key->Testament(), start, size, tmpbuf); + readText(key->getTestament(), start, size, tmpbuf); entryBuf += tmpbuf; } else { @@ -128,7 +130,7 @@ void RawFiles::setEntry(const char *inbuf, long len) { entryBuf = path; entryBuf += '/'; tmpbuf = getNextFilename(); - doSetText(key->Testament(), key->TestamentIndex(), tmpbuf); + doSetText(key->getTestament(), key->getTestamentIndex(), tmpbuf); entryBuf += tmpbuf; } datafile = FileMgr::getSystemFileMgr()->open(entryBuf, FileMgr::CREAT|FileMgr::WRONLY|FileMgr::TRUNC); @@ -152,14 +154,14 @@ void RawFiles::linkEntry(const SWKey *inkey) { unsigned short size; const VerseKey *key = &getVerseKey(); - findOffset(key->Testament(), key->TestamentIndex(), &start, &size); + findOffset(key->getTestament(), key->getTestamentIndex(), &start, &size); if (size) { SWBuf tmpbuf; - readText(key->Testament(), start, size + 2, tmpbuf); + readText(key->getTestament(), start, size + 2, tmpbuf); key = &getVerseKey(inkey); - doSetText(key->Testament(), key->TestamentIndex(), tmpbuf.c_str()); + doSetText(key->getTestament(), key->getTestamentIndex(), tmpbuf.c_str()); } } @@ -172,7 +174,7 @@ void RawFiles::linkEntry(const SWKey *inkey) { void RawFiles::deleteEntry() { VerseKey *key = &getVerseKey(); - doSetText(key->Testament(), key->TestamentIndex(), ""); + doSetText(key->getTestament(), key->getTestamentIndex(), ""); } @@ -183,22 +185,22 @@ void RawFiles::deleteEntry() { * RET: filename */ -char *RawFiles::getNextFilename() { - static char incfile[255]; - __u32 number; +const char *RawFiles::getNextFilename() { + static SWBuf incfile; + __u32 number = 0; FileDesc *datafile; - sprintf(incfile, "%s/incfile", path); + incfile.setFormatted("%s/incfile", path); datafile = FileMgr::getSystemFileMgr()->open(incfile, FileMgr::RDONLY); - - if (datafile->read(&number, 4) != 4) number = 0; - number = swordtoarch32(number); - + if (datafile->getFd() != -1) { + if (datafile->read(&number, 4) != 4) number = 0; + number = swordtoarch32(number); + } number++; FileMgr::getSystemFileMgr()->close(datafile); datafile = FileMgr::getSystemFileMgr()->open(incfile, FileMgr::CREAT|FileMgr::WRONLY|FileMgr::TRUNC); - sprintf(incfile, "%.7d", number-1); + incfile.setFormatted("%.7d", number-1); number = archtosword32(number); datafile->write(&number, 4); @@ -208,7 +210,7 @@ char *RawFiles::getNextFilename() { } -char RawFiles::createModule (const char *path) { +char RawFiles::createModule(const char *path) { char *incfile = new char [ strlen (path) + 16 ]; __u32 zero = 0; diff --git a/src/modules/comments/swcom.cpp b/src/modules/comments/swcom.cpp index e82751b..52bd61b 100644 --- a/src/modules/comments/swcom.cpp +++ b/src/modules/comments/swcom.cpp @@ -1,9 +1,11 @@ /****************************************************************************** - * swcom.cpp - code for base class 'SWCom'- The basis for all commentary - * modules * + * swcom.cpp - code for base class 'SWCom'- The basis for all commentary + * modules * - * Copyright 2009 CrossWire Bible Society (http://www.crosswire.org) + * $Id: swcom.cpp 2893 2013-07-16 03:07:02Z scribe $ + * + * Copyright 1997-2013 CrossWire Bible Society (http://www.crosswire.org) * CrossWire Bible Society * P. O. Box 2528 * Tempe, AZ 85280-2528 @@ -41,9 +43,9 @@ SWCom::SWCom(const char *imodname, const char *imoddesc, SWDisplay *idisp, SWTex this->versification = 0; stdstr(&(this->versification), versification); delete key; - key = (VerseKey *)CreateKey(); - tmpVK1 = (VerseKey *)CreateKey(); - tmpVK2 = (VerseKey *)CreateKey(); + key = (VerseKey *)createKey(); + tmpVK1 = (VerseKey *)createKey(); + tmpVK2 = (VerseKey *)createKey(); tmpSecond = false; } @@ -59,7 +61,7 @@ SWCom::~SWCom() { } -SWKey *SWCom::CreateKey() const { +SWKey *SWCom::createKey() const { VerseKey *vk = new VerseKey(); vk->setVersificationSystem(versification); @@ -68,22 +70,20 @@ SWKey *SWCom::CreateKey() const { } -long SWCom::Index() const { +long SWCom::getIndex() const { VerseKey *key = &getVerseKey(); - entryIndex = key->Index(); + entryIndex = key->getIndex(); return entryIndex; } -long SWCom::Index(long iindex) { +void SWCom::setIndex(long iindex) { VerseKey *key = &getVerseKey(); - key->Testament(1); - key->Index(iindex); + key->setTestament(1); + key->setIndex(iindex); if (key != this->key) { this->key->copyFrom(*key); } - - return Index(); } @@ -104,7 +104,7 @@ VerseKey &SWCom::getVerseKey(const SWKey *keyToConvert) const { SWCATCH ( ... ) { } if (lkTest) { SWTRY { - key = SWDYNAMIC_CAST(VerseKey, lkTest->GetElement()); + key = SWDYNAMIC_CAST(VerseKey, lkTest->getElement()); } SWCATCH ( ... ) { } } diff --git a/src/modules/comments/zcom/zcom.cpp b/src/modules/comments/zcom/zcom.cpp index 35b8946..65c4ca8 100644 --- a/src/modules/comments/zcom/zcom.cpp +++ b/src/modules/comments/zcom/zcom.cpp @@ -1,9 +1,11 @@ /****************************************************************************** - * rawcom.cpp - code for class 'zCom'- a module that reads raw commentary - * files: ot and nt using indexs ??.bks ??.cps ??.vss * + * zcom.cpp - code for class 'zCom'- a module that reads raw commentary + * files * - * Copyright 2009 CrossWire Bible Society (http://www.crosswire.org) + * $Id: zcom.cpp 2833 2013-06-29 06:40:28Z chrislit $ + * + * Copyright 1996-2013 CrossWire Bible Society (http://www.crosswire.org) * CrossWire Bible Society * P. O. Box 2528 * Tempe, AZ 85280-2528 @@ -23,6 +25,7 @@ #include <stdio.h> #include <fcntl.h> +#include <swbuf.h> #include <zverse.h> #include <versekey.h> #include <zcom.h> @@ -59,7 +62,7 @@ zCom::~zCom() { } -bool zCom::isWritable() { +bool zCom::isWritable() const { return ((idxfp[0]->getFd() > 0) && ((idxfp[0]->mode & FileMgr::RDWR) == FileMgr::RDWR)); } @@ -70,17 +73,17 @@ bool zCom::isWritable() { * * RET: string buffer with verse */ -SWBuf &zCom::getRawEntryBuf() { +SWBuf &zCom::getRawEntryBuf() const { long start = 0; unsigned short size = 0; unsigned long buffnum; VerseKey *key = &getVerseKey(); - findOffset(key->Testament(), key->TestamentIndex(), &start, &size, &buffnum); + findOffset(key->getTestament(), key->getTestamentIndex(), &start, &size, &buffnum); entrySize = size; // support getEntrySize call entryBuf = ""; - zReadText(key->Testament(), start, size, buffnum, entryBuf); + zReadText(key->getTestament(), start, size, buffnum, entryBuf); rawFilter(entryBuf, key); @@ -92,18 +95,18 @@ SWBuf &zCom::getRawEntryBuf() { bool zCom::sameBlock(VerseKey *k1, VerseKey *k2) { - if (k1->Testament() != k2->Testament()) + if (k1->getTestament() != k2->getTestament()) return false; switch (blockType) { case VERSEBLOCKS: - if (k1->Verse() != k2->Verse()) + if (k1->getVerse() != k2->getVerse()) return false; case CHAPTERBLOCKS: - if (k1->Chapter() != k2->Chapter()) + if (k1->getChapter() != k2->getChapter()) return false; case BOOKBLOCKS: - if (k1->Book() != k2->Book()) + if (k1->getBook() != k2->getBook()) return false; } return true; @@ -120,7 +123,7 @@ void zCom::setEntry(const char *inbuf, long len) { delete lastWriteKey; } - doSetText(key->Testament(), key->TestamentIndex(), inbuf, len); + doSetText(key->getTestament(), key->getTestamentIndex(), inbuf, len); lastWriteKey = (VerseKey *)key->clone(); // must delete } @@ -130,7 +133,7 @@ void zCom::linkEntry(const SWKey *inkey) { VerseKey *destkey = &getVerseKey(); const VerseKey *srckey = &getVerseKey(inkey); - doLinkEntry(destkey->Testament(), destkey->TestamentIndex(), srckey->TestamentIndex()); + doLinkEntry(destkey->getTestament(), destkey->getTestamentIndex(), srckey->getTestamentIndex()); if (inkey != srckey) // free our key if we created a VerseKey delete srckey; @@ -145,7 +148,7 @@ void zCom::linkEntry(const SWKey *inkey) { void zCom::deleteEntry() { VerseKey *key = &getVerseKey(); - doSetText(key->Testament(), key->TestamentIndex(), ""); + doSetText(key->getTestament(), key->getTestamentIndex(), ""); } @@ -163,7 +166,7 @@ void zCom::increment(int steps) { unsigned long buffnum; VerseKey *tmpkey = &getVerseKey(); - findOffset(tmpkey->Testament(), tmpkey->TestamentIndex(), &start, &size, &buffnum); + findOffset(tmpkey->getTestament(), tmpkey->getTestamentIndex(), &start, &size, &buffnum); SWKey lastgood = *tmpkey; while (steps) { @@ -173,12 +176,12 @@ void zCom::increment(int steps) { (steps > 0) ? ++(*key) : --(*key); tmpkey = &getVerseKey(); - if ((error = key->Error())) { + if ((error = key->popError())) { *key = lastgood; break; } - long index = tmpkey->TestamentIndex(); - findOffset(tmpkey->Testament(), index, &start, &size, &buffnum); + long index = tmpkey->getTestamentIndex(); + findOffset(tmpkey->getTestament(), index, &start, &size, &buffnum); if ( (((laststart != start) || (lastsize != size)) // we're a different entry // && (start > 0) @@ -197,10 +200,10 @@ bool zCom::isLinked(const SWKey *k1, const SWKey *k2) const { unsigned long buffnum1, buffnum2; VerseKey *vk1 = &getVerseKey(k1); VerseKey *vk2 = &getVerseKey(k2); - if (vk1->Testament() != vk2->Testament()) return false; + if (vk1->getTestament() != vk2->getTestament()) return false; - findOffset(vk1->Testament(), vk1->TestamentIndex(), &start1, &size1, &buffnum1); - findOffset(vk2->Testament(), vk2->TestamentIndex(), &start2, &size2, &buffnum2); + findOffset(vk1->getTestament(), vk1->getTestamentIndex(), &start1, &size1, &buffnum1); + findOffset(vk2->getTestament(), vk2->getTestamentIndex(), &start2, &size2, &buffnum2); return start1 == start2 && buffnum1 == buffnum2; } @@ -210,7 +213,7 @@ bool zCom::hasEntry(const SWKey *k) const { unsigned long buffnum; VerseKey *vk = &getVerseKey(k); - findOffset(vk->Testament(), vk->TestamentIndex(), &start, &size, &buffnum); + findOffset(vk->getTestament(), vk->getTestamentIndex(), &start, &size, &buffnum); return size; } |