[sword-cvs] sword/src/mgr swlocale.cpp,1.8,1.9 swmgr.cpp,1.102,1.103
sword@www.crosswire.org
sword@www.crosswire.org
Mon, 12 Apr 2004 06:49:14 -0700
Update of /cvs/core/sword/src/mgr
In directory www:/tmp/cvs-serv31683/src/mgr
Modified Files:
swlocale.cpp swmgr.cpp
Log Message:
dglassey: further work on VerseKey2 and mods to allow the splitlib option
Index: swlocale.cpp
===================================================================
RCS file: /cvs/core/sword/src/mgr/swlocale.cpp,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -d -r1.8 -r1.9
--- swlocale.cpp 9 Apr 2004 17:41:47 -0000 1.8
+++ swlocale.cpp 12 Apr 2004 13:49:12 -0000 1.9
@@ -34,6 +34,9 @@
bookAbbrevs = 0;
BMAX = 0;
books = 0;
+ #ifdef SPLITLIB
+ books2 = 0;
+ #endif
localeSource = new SWConfig(ifilename);
confEntry = localeSource->Sections["Meta"].find("Name");
@@ -70,6 +73,9 @@
#endif
delete [] BMAX;
delete [] books;
+ #ifdef SPLITLIB
+ delete [] books2;
+ #endif
}
}
@@ -127,6 +133,8 @@
return bookAbbrevs;
}
+
+#if defined(VK2) || defined(SPLITLIB)
#ifdef VK2
void SWLocale::getBooks(char **iBMAX, struct sbook ***ibooks, VerseKey *vk) {
if (!BMAX) {
@@ -143,8 +151,26 @@
iBMAX = &BMAX;
ibooks = &books;
-}
#else
+void SWLocale::getBooks2(char **iBMAX, struct sbook2 ***ibooks, VerseKey2 *vk) {
+ if (!BMAX) {
+ BMAX2 = new char[1];
+ BMAX2[0] = vk->getMaxBooks();
+
+ books2 = new struct sbook2*[1];
+ books2[0] = new struct sbook2[*BMAX2];
+ for (int j = 0; j < *BMAX2; j++) {
+ books2[0][j].name = translate(vk->getNameOfBook(j));
+ books2[0][j].prefAbbrev = translate(vk->getPrefAbbrev(j));
+ }
+ }
+
+ iBMAX = &BMAX2;
+ ibooks = &books2;
+#endif
+}
+#endif
+#ifndef VK2
void SWLocale::getBooks(char **iBMAX, struct sbook ***ibooks) {
if (!BMAX) {
BMAX = new char [2];
@@ -167,5 +193,6 @@
*ibooks = books;
}
#endif
+
SWORD_NAMESPACE_END
Index: swmgr.cpp
===================================================================
RCS file: /cvs/core/sword/src/mgr/swmgr.cpp,v
retrieving revision 1.102
retrieving revision 1.103
diff -u -d -r1.102 -r1.103
--- swmgr.cpp 30 Mar 2004 20:05:08 -0000 1.102
+++ swmgr.cpp 12 Apr 2004 13:49:12 -0000 1.103
@@ -116,7 +116,7 @@
cipherFilters.clear();
optionFilters.clear();
cleanupFilters.clear();
-
+#ifndef SPLITLIB
tmpFilter = new ThMLVariants();
optionFilters.insert(FilterMap::value_type("ThMLVariants", tmpFilter));
cleanupFilters.push_back(tmpFilter);
@@ -225,6 +225,7 @@
osisplain = new OSISPlain();
cleanupFilters.push_back(osisplain);
+#endif
}