[sword-cvs] sword/bindings flatapi.cpp,1.9,1.10

sword@www.crosswire.org sword@www.crosswire.org
Sat, 24 Jan 2004 11:53:22 -0700


Update of /cvs/core/sword/bindings
In directory www:/tmp/cvs-serv9258

Modified Files:
	flatapi.cpp 
Log Message:
terry - add SWModule_getEntryAttributes and listkey_getVerselistIterator

Index: flatapi.cpp
===================================================================
RCS file: /cvs/core/sword/bindings/flatapi.cpp,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- flatapi.cpp	16 Jan 2004 18:55:21 -0000	1.9
+++ flatapi.cpp	24 Jan 2004 18:53:20 -0000	1.10
@@ -250,6 +250,14 @@
 	return (const char *)((module) ? module->RenderText() : 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();                 	
+	retval = module->getEntryAttributes()[level1][level2][level3].c_str();
+	return (retval.length()) ? (const char*)retval.c_str() : NULL;
+}
+
 const char *SWModule_getPreverseHeader(SWHANDLE hmodule, const char *key, int pvHeading) {
 	SWModule *module = (SWModule *)hmodule;
 	static SWBuf preverseHeading;
@@ -291,6 +299,18 @@
 	module->RenderText();	
 	refList = module->getEntryAttributes()["Footnote"][note]["refList"].c_str();
 	return (refList) ? (const char*)refList.c_str() : NULL;
+}
+
+
+
+SWHANDLE listkey_getVerselistIterator(const char * list, const char * key) {
+	VerseKey versekey;
+	static ListKey verses;
+	
+	versekey.setText(key);
+	verses.ClearList();
+	verses = versekey.ParseVerseList(list, versekey);
+	return (SWHANDLE)&verses;
 }
 
 //-----------------------------------------------------------------