summaryrefslogtreecommitdiff
path: root/src/modules/genbook
diff options
context:
space:
mode:
Diffstat (limited to 'src/modules/genbook')
-rw-r--r--src/modules/genbook/rawgenbook/rawgenbook.cpp22
-rw-r--r--src/modules/genbook/swgenbook.cpp17
2 files changed, 21 insertions, 18 deletions
diff --git a/src/modules/genbook/rawgenbook/rawgenbook.cpp b/src/modules/genbook/rawgenbook/rawgenbook.cpp
index eff68f5..6101241 100644
--- a/src/modules/genbook/rawgenbook/rawgenbook.cpp
+++ b/src/modules/genbook/rawgenbook/rawgenbook.cpp
@@ -1,9 +1,11 @@
/******************************************************************************
- * rawtext.cpp - code for class 'RawGenBook'- a module that reads raw text
- * files: ot and nt using indexs ??.bks ??.cps ??.vss
*
+ * rawgenbook.cpp - code for class 'RawGenBook'- a module that reads raw
+ * text files: ot and nt using indexs ??.bks ??.cps ??.vss
*
- * Copyright 2009 CrossWire Bible Society (http://www.crosswire.org)
+ * $Id: rawgenbook.cpp 2833 2013-06-29 06:40:28Z chrislit $
+ *
+ * Copyright 2002-2013 CrossWire Bible Society (http://www.crosswire.org)
* CrossWire Bible Society
* P. O. Box 2528
* Tempe, AZ 85280-2528
@@ -51,13 +53,13 @@ RawGenBook::RawGenBook(const char *ipath, const char *iname, const char *idesc,
stdstr(&path, ipath);
verseKey = !strcmp("VerseKey", keyType);
- if (verseKey) Type("Biblical Texts");
+ if (verseKey) setType("Biblical Texts");
if ((path[strlen(path)-1] == '/') || (path[strlen(path)-1] == '\\'))
path[strlen(path)-1] = 0;
delete key;
- key = CreateKey();
+ key = createKey();
sprintf(buf, "%s.bdt", path);
@@ -82,7 +84,7 @@ RawGenBook::~RawGenBook() {
}
-bool RawGenBook::isWritable() {
+bool RawGenBook::isWritable() const {
return ((bdtfd->getFd() > 0) && ((bdtfd->mode & FileMgr::RDWR) == FileMgr::RDWR));
}
@@ -94,7 +96,7 @@ bool RawGenBook::isWritable() {
* RET: string buffer with verse
*/
-SWBuf &RawGenBook::getRawEntryBuf() {
+SWBuf &RawGenBook::getRawEntryBuf() const {
__u32 offset = 0;
__u32 size = 0;
@@ -160,7 +162,7 @@ void RawGenBook::linkEntry(const SWKey *inkey) {
SWCATCH ( ... ) {}
// if we don't have a VerseKey * decendant, create our own
if (!srckey) {
- srckey = (TreeKeyIdx *)CreateKey();
+ srckey = (TreeKeyIdx *)createKey();
(*srckey) = *inkey;
}
@@ -207,7 +209,7 @@ char RawGenBook::createModule(const char *ipath) {
}
-SWKey *RawGenBook::CreateKey() const {
+SWKey *RawGenBook::createKey() const {
TreeKey *tKey = new TreeKeyIdx(path);
if (verseKey) { SWKey *vtKey = new VerseTreeKey(tKey); delete tKey; return vtKey; }
return tKey;
@@ -218,7 +220,7 @@ bool RawGenBook::hasEntry(const SWKey *k) const {
int dsize;
key.getUserData(&dsize);
- return (dsize > 7) && key.Error() == '\x00';
+ return (dsize > 7) && key.popError() == '\x00';
}
SWORD_NAMESPACE_END
diff --git a/src/modules/genbook/swgenbook.cpp b/src/modules/genbook/swgenbook.cpp
index e7feea2..fef41ad 100644
--- a/src/modules/genbook/swgenbook.cpp
+++ b/src/modules/genbook/swgenbook.cpp
@@ -1,9 +1,10 @@
/******************************************************************************
- * swld.cpp - code for base class 'SWLD'. SWLD is the basis for all
- * types of Lexicon and Dictionary modules (hence the 'LD').
*
+ * swgenbook.cpp - Implementation of SWGenBook class
*
- * Copyright 2009 CrossWire Bible Society (http://www.crosswire.org)
+ * $Id: swgenbook.cpp 2893 2013-07-16 03:07:02Z scribe $
+ *
+ * Copyright 2002-2013 CrossWire Bible Society (http://www.crosswire.org)
* CrossWire Bible Society
* P. O. Box 2528
* Tempe, AZ 85280-2528
@@ -26,7 +27,7 @@
SWORD_NAMESPACE_START
/******************************************************************************
- * SWLD Constructor - Initializes data for instance of SWLD
+ * SWGenBook Constructor - Initializes data for instance of SWGenBook
*
* ENT: imodname - Internal name for module
* imoddesc - Name to display to user for module
@@ -39,7 +40,7 @@ SWGenBook::SWGenBook(const char *imodname, const char *imoddesc, SWDisplay *idis
/******************************************************************************
- * SWLD Destructor - Cleans up instance of SWGenBook
+ * SWGenBook Destructor - Cleans up instance of SWGenBook
*/
SWGenBook::~SWGenBook() {
@@ -65,11 +66,11 @@ TreeKey &SWGenBook::getTreeKey(const SWKey *k) const {
SWCATCH ( ... ) { }
if (lkTest) {
SWTRY {
- key = SWDYNAMIC_CAST(TreeKey, lkTest->GetElement());
+ key = SWDYNAMIC_CAST(TreeKey, lkTest->getElement());
if (!key) {
VerseTreeKey *tkey = 0;
SWTRY {
- tkey = SWDYNAMIC_CAST(VerseTreeKey, lkTest->GetElement());
+ tkey = SWDYNAMIC_CAST(VerseTreeKey, lkTest->getElement());
}
SWCATCH ( ... ) {}
if (tkey) key = tkey->getTreeKey();
@@ -89,7 +90,7 @@ TreeKey &SWGenBook::getTreeKey(const SWKey *k) const {
if (!key) {
delete tmpTreeKey;
- tmpTreeKey = (TreeKey *)CreateKey();
+ tmpTreeKey = (TreeKey *)createKey();
(*tmpTreeKey) = *(thiskey);
return (*tmpTreeKey);
}