summaryrefslogtreecommitdiff
path: root/bindings/swig/swmgr.i
diff options
context:
space:
mode:
authorRoberto C. Sanchez <roberto@connexer.com>2014-03-29 10:53:49 -0400
committerRoberto C. Sanchez <roberto@connexer.com>2014-03-29 10:53:49 -0400
commit8c8aa6b07e595cfac56838b5964ab3e96051f1b2 (patch)
treeda38e2c1979148dbd3b0c7b87f930746f5ba7f44 /bindings/swig/swmgr.i
parent8d3fc864d094eeadc721f8e93436b37a5fab173e (diff)
Imported Upstream version 1.5.7
Diffstat (limited to 'bindings/swig/swmgr.i')
-rw-r--r--bindings/swig/swmgr.i59
1 files changed, 59 insertions, 0 deletions
diff --git a/bindings/swig/swmgr.i b/bindings/swig/swmgr.i
new file mode 100644
index 0000000..2328336
--- /dev/null
+++ b/bindings/swig/swmgr.i
@@ -0,0 +1,59 @@
+%{
+#include <swmgr.h>
+using namespace sword;
+%}
+
+typedef map < SWBuf, SWModule *, less < SWBuf > > ModMap;
+typedef list < SWBuf > StringList;
+typedef map < SWBuf, SWFilter * > FilterMap;
+
+class SWMgr {
+public:
+//member data
+ static void findConfig (char *configType, char **prefixPath, char **configPath);
+
+ SWConfig *config;
+ SWConfig *sysconfig;
+ ModMap Modules;
+ char *prefixPath;
+ char *configPath;
+
+//member functions
+ SWMgr (SWConfig* iconfig = 0, SWConfig* isysconfig = 0, bool autoload = true, SWFilterMgr* filterMgr = 0);
+ SWMgr(const char *iConfigPath, bool autoload = true, SWFilterMgr *filterMgr = 0);
+ virtual ~SWMgr();
+
+ virtual signed char Load ();
+ virtual void setGlobalOption (const char *option, const char *value);
+ virtual const char *getGlobalOption (const char *option);
+ virtual const char *getGlobalOptionTip (const char *option);
+ virtual StringList getGlobalOptions ();
+ virtual StringList getGlobalOptionValues (const char *option);
+ virtual signed char setCipherKey (const char *modName, const char *key);
+
+ SWModule *getModule(const char *modName);
+ virtual void InstallScan(const char *dir);
+
+%extend {
+ const int moduleCount() {
+ return self->Modules.size();
+ }
+
+ SWModule* getModuleAt( const int pos ) {
+ if (pos < 0 || pos > self->Modules.size() )
+ return 0;
+
+ ModMap::iterator it = self->Modules.begin();
+
+ for (int i = 0; i < pos; ++i) {
+ it++;
+ }
+
+ if ( it != self->Modules.end() ) {
+ return (*it).second;
+ }
+
+ return 0;
+ }
+}
+};