[sword-svn] r2360 - trunk/bindings/swig

benpmorgan at crosswire.org benpmorgan at crosswire.org
Tue Apr 28 17:58:33 MST 2009


Author: benpmorgan
Date: 2009-04-28 17:58:33 -0700 (Tue, 28 Apr 2009)
New Revision: 2360

Modified:
   trunk/bindings/swig/swlocale.i
   trunk/bindings/swig/versekey.i
Log:
Add getBookNumberByOSISName to versekey.
Make getBookAbbrevs ignore the size argument, and give a version without it.



Modified: trunk/bindings/swig/swlocale.i
===================================================================
--- trunk/bindings/swig/swlocale.i	2009-04-28 17:54:46 UTC (rev 2359)
+++ trunk/bindings/swig/swlocale.i	2009-04-29 00:58:33 UTC (rev 2360)
@@ -3,29 +3,14 @@
 %}
 
 %ignore sword::SWLocale::operator+=;
-%ignore sword::SWLocale::getBooks;
+%ignore sword::SWLocale::getBookAbbrevs(int *);
 
 %include "swlocale.h"
 
-/*%extend sword::SWLocale {
-        int getNumBookGroupings() {
-                return 2;
-        }
+%extend sword::SWLocale {
+    const sword::abbrev* getBookAbbrevs() {
+        int x;
+        return self->getBookAbbrevs(&x);
+    }
 
-        int getNumBooks(int grouping) {
-                char *numbooks;
-                struct sbook **books;
-
-                self->getBooks(&numbooks, &books);
-
-                return numbooks[grouping];
-        }
-
-        sbook getBook(int grouping, int booknum) {
-                char *numbooks;
-                struct sbook **books;
-                self->getBooks(&numbooks, &books);
-
-                return books[grouping][booknum];
-        }
-};*/
+}

Modified: trunk/bindings/swig/versekey.i
===================================================================
--- trunk/bindings/swig/versekey.i	2009-04-28 17:54:46 UTC (rev 2359)
+++ trunk/bindings/swig/versekey.i	2009-04-29 00:58:33 UTC (rev 2360)
@@ -104,6 +104,13 @@
  
 	};
 
+    int getBookNumberByOSISName( const char* bookname ) {
+        const sword::VerseMgr::System* system = sword::VerseMgr::getSystemVerseMgr()->getVersificationSystem(
+            self->getVersificationSystem()
+        );
+        return system->getBookNumberByOSISName(bookname);
+   }
+    
     const char* getOSISBookName( const int book ) {
         const sword::VerseMgr::System* system = sword::VerseMgr::getSystemVerseMgr()->getVersificationSystem(
             self->getVersificationSystem()




More information about the sword-cvs mailing list