summaryrefslogtreecommitdiff
path: root/src/modules/comments/rawcom4/rawcom4.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/modules/comments/rawcom4/rawcom4.cpp')
-rw-r--r--src/modules/comments/rawcom4/rawcom4.cpp39
1 files changed, 21 insertions, 18 deletions
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;
}