summaryrefslogtreecommitdiff
path: root/bindings/flatapi.cpp
diff options
context:
space:
mode:
authorRoberto C. Sanchez <roberto@connexer.com>2014-05-12 08:21:30 -0400
committerRoberto C. Sanchez <roberto@connexer.com>2014-05-12 08:21:30 -0400
commit7a00574163029c0c2b649878c95d5acbd083564a (patch)
treec13cc5736025834df2874ed87ee8598070025ea6 /bindings/flatapi.cpp
parentb745315323de9f27538edac9453205ca70e6186e (diff)
Imported Upstream version 1.7.2+dfsg
Diffstat (limited to 'bindings/flatapi.cpp')
-rw-r--r--bindings/flatapi.cpp55
1 files changed, 28 insertions, 27 deletions
diff --git a/bindings/flatapi.cpp b/bindings/flatapi.cpp
index 58476e8..55cf083 100644
--- a/bindings/flatapi.cpp
+++ b/bindings/flatapi.cpp
@@ -1,10 +1,11 @@
/******************************************************************************
- * swordapi.cpp - This file contains an api usable by non-C++
- * environments
*
- * $Id: flatapi.cpp 2325 2009-04-20 19:09:25Z scribe $
+ * flatapi.cpp - This file contains an api usable by non-C++
+ * environments
*
- * Copyright 1998 CrossWire Bible Society (http://www.crosswire.org)
+ * $Id: flatapi.cpp 2921 2013-07-28 17:21:44Z scribe $
+ *
+ * Copyright 2002-2013 CrossWire Bible Society (http://www.crosswire.org)
* CrossWire Bible Society
* P. O. Box 2528
* Tempe, AZ 85280-2528
@@ -177,8 +178,8 @@ SWHANDLE SWModule_doSearch(SWHANDLE hmodule, const char *searchString, int type,
if (!module)
return -1;
- results.ClearList();
- results = module->Search(searchString, type, params, scope, 0, percent, (void *) &percentUserData);
+ results.clear();
+ results = module->search(searchString, type, params, scope, 0, percent, (void *) &percentUserData);
return (SWHANDLE)&results;
}
@@ -188,7 +189,7 @@ SWHANDLE SWModule_doSearch(SWHANDLE hmodule, const char *searchString, int type,
*/
char SWModule_error(SWHANDLE hmodule) {
SWModule *module = (SWModule *)hmodule;
- return (module) ? module->Error() : 0;
+ return (module) ? module->popError() : 0;
}
@@ -209,7 +210,7 @@ void SWModule_setKeyText(SWHANDLE hmodule, const char *key) {
const char *SWModule_getKeyText(SWHANDLE hmodule) {
SWModule *module = (SWModule *)hmodule;
- return (const char *)((module) ? module->KeyText() : 0);
+ return (const char *)((module) ? module->getKeyText() : 0);
}
@@ -218,19 +219,19 @@ const char *SWModule_getKeyText(SWHANDLE hmodule) {
const char *SWModule_getName(SWHANDLE hmodule) {
SWModule *module = (SWModule *)hmodule;
- return (const char *)((module) ? module->Name() : 0);
+ return (const char *)((module) ? module->getName() : 0);
}
const char *SWModule_getDescription(SWHANDLE hmodule) {
SWModule *module = (SWModule *)hmodule;
- return (const char *)((module) ? module->Description() : 0);
+ return (const char *)((module) ? module->getDescription() : 0);
}
const char *SWModule_getType(SWHANDLE hmodule) {
SWModule *module = (SWModule *)hmodule;
- return (const char *)((module) ? module->Type() : 0);
+ return (const char *)((module) ? module->getType() : 0);
}
@@ -257,19 +258,19 @@ void SWModule_begin(SWHANDLE hmodule) {
const char *SWModule_getStripText(SWHANDLE hmodule) {
SWModule *module = (SWModule *)hmodule;
- return (const char *)((module) ? module->StripText() : 0);
+ return (const char *)((module) ? module->stripText() : 0);
}
const char *SWModule_getRenderText(SWHANDLE hmodule) {
SWModule *module = (SWModule *)hmodule;
- return (const char *)((module) ? module->RenderText() : 0);
+ return (const char *)((module) ? module->renderText().c_str() : 0);
}
const char *SWModule_getEntryAttributes(SWHANDLE hmodule, const char *level1, const char *level2, const char *level3) {
SWModule *module = (SWModule *)hmodule;
static SWBuf retval;
- module->RenderText();
+ module->renderText();
retval = module->getEntryAttributes()[level1][level2][level3].c_str();
return (retval.length()) ? (const char*)retval.c_str() : NULL;
}
@@ -279,8 +280,8 @@ const char *SWModule_getPreverseHeader(SWHANDLE hmodule, const char *key, int pv
static SWBuf preverseHeading;
char buf[12];
sprintf(buf, "%i", pvHeading);
- module->SetKey(key);
- module->RenderText();
+ module->setKey(key);
+ module->renderText();
preverseHeading = module->getEntryAttributes()["Heading"]["Preverse"][buf].c_str();
return (preverseHeading.length()) ? (const char*)preverseHeading.c_str() : NULL;
}
@@ -288,9 +289,9 @@ const char *SWModule_getPreverseHeader(SWHANDLE hmodule, const char *key, int pv
const char *SWModule_getFootnoteType(SWHANDLE hmodule, const char *key, const char *note) {
SWModule *module = (SWModule *)hmodule;
static SWBuf type;
- module->Error();
- module->SetKey(key);
- module->RenderText();
+ module->popError();
+ module->setKey(key);
+ module->renderText();
type = module->getEntryAttributes()["Footnote"][note]["type"].c_str();
return (type) ? (const char*)type.c_str() : NULL;
}
@@ -298,9 +299,9 @@ const char *SWModule_getFootnoteType(SWHANDLE hmodule, const char *key, const ch
const char *SWModule_getFootnoteBody(SWHANDLE hmodule, const char *key, const char *note) {
SWModule *module = (SWModule *)hmodule;
static SWBuf body;
- module->Error();
+ module->popError();
module->setKey(key);
- module->RenderText();
+ module->renderText();
body = module->getEntryAttributes()["Footnote"][note]["body"].c_str();
SWKey *keybuf = module->getKey();;
module->renderFilter(body, keybuf);
@@ -310,9 +311,9 @@ const char *SWModule_getFootnoteBody(SWHANDLE hmodule, const char *key, const ch
const char *SWModule_getFootnoteRefList(SWHANDLE hmodule, const char *key, const char *note) {
SWModule *module = (SWModule *)hmodule;
static SWBuf refList;
- module->Error();
- module->SetKey(key);
- module->RenderText();
+ module->popError();
+ module->setKey(key);
+ module->renderText();
refList = module->getEntryAttributes()["Footnote"][note]["refList"].c_str();
return (refList) ? (const char*)refList.c_str() : NULL;
}
@@ -325,8 +326,8 @@ SWHANDLE listkey_getVerselistIterator(const char *list, const char *key, const c
static ListKey verses;
versekey.setText(key);
- verses.ClearList();
- verses = versekey.ParseVerseList(list, versekey);
+ verses.clear();
+ verses = versekey.parseVerseList(list, versekey);
return (SWHANDLE)&verses;
}
@@ -357,7 +358,7 @@ void listkey_iterator_next(SWHANDLE lki) {
const char *listkey_iterator_val(SWHANDLE lki) {
ListKey *lk = (ListKey*)lki;
- if(!lk->Error())
+ if(!lk->popError())
return (const char *) lk->getText();
return NULL;
}