[sword-svn] r3145 - in trunk: bindings bindings/corba/orbitcpp include

scribe at crosswire.org scribe at crosswire.org
Sat Mar 22 12:53:52 MST 2014


Author: scribe
Date: 2014-03-22 12:53:51 -0700 (Sat, 22 Mar 2014)
New Revision: 3145

Modified:
   trunk/bindings/corba/orbitcpp/webmgr.hpp
   trunk/bindings/flatapi.cpp
   trunk/include/flatapi.h
Log:
added new method to construct and SWMgr by specifying a path to modules
and bypassing discovery.

Modified: trunk/bindings/corba/orbitcpp/webmgr.hpp
===================================================================
--- trunk/bindings/corba/orbitcpp/webmgr.hpp	2014-03-19 21:42:15 UTC (rev 3144)
+++ trunk/bindings/corba/orbitcpp/webmgr.hpp	2014-03-22 19:53:51 UTC (rev 3145)
@@ -43,7 +43,9 @@
 	SWModule *defaultHebParse;
 
 public:
-	WebMgr(SWConfig *sysConf) : SWMgr(0, sysConf, false, new MarkupFilterMgr(FMT_WEBIF)) {
+	WebMgr(const char *path) : SWMgr(path, false, new MarkupFilterMgr(FMT_WEBIF)) { init(); }
+	WebMgr(SWConfig *sysConf) : SWMgr(0, sysConf, false, new MarkupFilterMgr(FMT_WEBIF)) { init(); }
+	void init() {
 		defaultGreekLex   = 0;
 		defaultHebLex     = 0;
 		defaultGreekParse = 0;

Modified: trunk/bindings/flatapi.cpp
===================================================================
--- trunk/bindings/flatapi.cpp	2014-03-19 21:42:15 UTC (rev 3144)
+++ trunk/bindings/flatapi.cpp	2014-03-22 19:53:51 UTC (rev 3145)
@@ -941,7 +941,27 @@
 	return (SWHANDLE) new HandleSWMgr(new WebMgr(sysConf));
 }
 
+/*
+ * Class:     org_crosswire_sword_SWMgr
+ * Method:    new
+ * Signature: ()V
+ */
+SWHANDLE SWDLLEXPORT org_crosswire_sword_SWMgr_newWithPath(const char *path) { 
+	SWBuf confPath = path;
+	if (!confPath.endsWith("/")) confPath.append('/');
+	SWBuf modsd = confPath.append("mods.d");
+	// be sure we have at least some config file already out there
+	if (!FileMgr::existsFile(modsd.c_str())) {
+		modsd.append("/globals.conf");
+		FileMgr::createParent(modsd.c_str());
+		SWConfig config(modsd.c_str());
+		config["Globals"]["HiAndroid"] = "weeee";
+		config.Save();
+	}
+	return (SWHANDLE) new HandleSWMgr(new WebMgr(confPath.c_str()));
+}
 
+
 /*
  * Class:     org_crosswire_sword_SWMgr
  * Method:    delete

Modified: trunk/include/flatapi.h
===================================================================
--- trunk/include/flatapi.h	2014-03-19 21:42:15 UTC (rev 3144)
+++ trunk/include/flatapi.h	2014-03-22 19:53:51 UTC (rev 3145)
@@ -281,6 +281,15 @@
 
 /*
  * Class:     org_crosswire_sword_SWMgr
+ * Method:    newWithPath
+ * Signature: ()V
+ * Signature: (Ljava/lang/String;)V
+ */
+SWHANDLE SWDLLEXPORT org_crosswire_sword_SWMgr_newWithPath
+  (const char *path);
+
+/*
+ * Class:     org_crosswire_sword_SWMgr
  * Method:    delete
  * Signature: ()V
  */




More information about the sword-cvs mailing list