[sword-svn] r3237 - in trunk/bindings/java-jni: jni src/org/crosswire/android/sword
scribe at crosswire.org
scribe at crosswire.org
Thu May 22 01:02:06 MST 2014
Author: scribe
Date: 2014-05-22 01:02:06 -0700 (Thu, 22 May 2014)
New Revision: 3237
Modified:
trunk/bindings/java-jni/jni/swordstub.cpp
trunk/bindings/java-jni/src/org/crosswire/android/sword/SWModule.java
Log:
added path for discovering And Bible mobiles
added ability to retrieve keys for entry attributes
added static defines for VERSEKEY components
Modified: trunk/bindings/java-jni/jni/swordstub.cpp
===================================================================
--- trunk/bindings/java-jni/jni/swordstub.cpp 2014-05-17 03:55:09 UTC (rev 3236)
+++ trunk/bindings/java-jni/jni/swordstub.cpp 2014-05-22 08:02:06 UTC (rev 3237)
@@ -158,6 +158,9 @@
config.Save();
}
mgr = new WebMgr("/sdcard/sword");
+
+ // for And Bible modules
+ mgr->augmentModules("/sdcard/Android/data/net.bible.android.activity/files", true);
}
}
@@ -744,7 +747,7 @@
sword::AttributeList::iterator i2Start, i2End;
sword::AttributeValue::iterator i3Start, i3End;
- if ((level1) && (*level1)) {
+ if ((level1) && (*level1) && *level1 != '-') {
i1Start = entryAttribs.find(level1);
i1End = i1Start;
if (i1End != entryAttribs.end())
@@ -755,35 +758,50 @@
i1End = entryAttribs.end();
}
for (;i1Start != i1End; ++i1Start) {
- if ((level2) && (*level2)) {
- i2Start = i1Start->second.find(level2);
- i2End = i2Start;
- if (i2End != i1Start->second.end())
- ++i2End;
+ if (level1 && *level1 && *level1 == '-') {
+ results.push_back(i1Start->first);
}
else {
- i2Start = i1Start->second.begin();
- i2End = i1Start->second.end();
- }
- for (;i2Start != i2End; ++i2Start) {
- if ((level3) && (*level3)) {
- i3Start = i2Start->second.find(level3);
- i3End = i3Start;
- if (i3End != i2Start->second.end())
- ++i3End;
+ if (level2 && *level2 && *level2 != '-') {
+ i2Start = i1Start->second.find(level2);
+ i2End = i2Start;
+ if (i2End != i1Start->second.end())
+ ++i2End;
}
else {
- i3Start = i2Start->second.begin();
- i3End = i2Start->second.end();
+ i2Start = i1Start->second.begin();
+ i2End = i1Start->second.end();
}
- for (;i3Start != i3End; ++i3Start) {
- results.push_back(i3Start->second);
+ for (;i2Start != i2End; ++i2Start) {
+ if (level2 && *level2 && *level2 == '-') {
+ results.push_back(i2Start->first);
+ }
+ else {
+ if (level3 && *level3 && *level3 != '-') {
+ i3Start = i2Start->second.find(level3);
+ i3End = i3Start;
+ if (i3End != i2Start->second.end())
+ ++i3End;
+ }
+ else {
+ i3Start = i2Start->second.begin();
+ i3End = i2Start->second.end();
+ }
+ for (;i3Start != i3End; ++i3Start) {
+ if (level3 && *level3 && *level3 == '-') {
+ results.push_back(i3Start->first);
+ }
+ else {
+ results.push_back(i3Start->second);
+ }
+ }
+ if (i3Start != i3End)
+ break;
+ }
}
- if (i3Start != i3End)
+ if (i2Start != i2End)
break;
}
- if (i2Start != i2End)
- break;
}
ret = (jobjectArray) env->NewObjectArray(results.size(), clazzString, NULL);
Modified: trunk/bindings/java-jni/src/org/crosswire/android/sword/SWModule.java
===================================================================
--- trunk/bindings/java-jni/src/org/crosswire/android/sword/SWModule.java 2014-05-17 03:55:09 UTC (rev 3236)
+++ trunk/bindings/java-jni/src/org/crosswire/android/sword/SWModule.java 2014-05-22 08:02:06 UTC (rev 3237)
@@ -38,6 +38,17 @@
public static final int SEARCHTYPE_ENTRYATTR = -3;
public static final int SEARCHTYPE_LUCENE = -4;
+ public static final int VERSEKEY_TESTAMENT = 0;
+ public static final int VERSEKEY_BOOK = 1;
+ public static final int VERSEKEY_CHAPTER = 2;
+ public static final int VERSEKEY_VERSE = 3;
+ public static final int VERSEKEY_CHAPTERMAX = 4;
+ public static final int VERSEKEY_VERSEMAX = 5;
+ public static final int VERSEKEY_BOOKNAME = 6;
+ public static final int VERSEKEY_OSISREF = 7;
+ public static final int VERSEKEY_SHORTTEXT = 8;
+ public static final int VERSEKEY_BOOKABBREV = 9;
+
private SWModule() {} // don't allow allocation, instead use factory method SWMgr.getModuleByName to retrieve an instance
public static class SearchHit {
More information about the sword-cvs
mailing list