diff options
author | Roberto C. Sanchez <roberto@connexer.com> | 2014-03-29 10:53:59 -0400 |
---|---|---|
committer | Roberto C. Sanchez <roberto@connexer.com> | 2014-03-29 10:53:59 -0400 |
commit | 03134fa5f6f25d92724ce4c183f9bbe12a9e37dc (patch) | |
tree | 847326a4de82f0241ac87cbbc427a1b92a696a02 /bindings/swig/swmgr.i | |
parent | d7469385b05b9510338407fa123e9ad090f80af6 (diff) |
Imported Upstream version 1.5.11
Diffstat (limited to 'bindings/swig/swmgr.i')
-rw-r--r-- | bindings/swig/swmgr.i | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/bindings/swig/swmgr.i b/bindings/swig/swmgr.i new file mode 100644 index 0000000..f00490a --- /dev/null +++ b/bindings/swig/swmgr.i @@ -0,0 +1,40 @@ +%{ +#include <swmgr.h> +%} + +%ignore sword::SWMgr::Modules; +%ignore sword::SWMgr::findConfig; +%include "swmgr.h" + +%extend sword::SWMgr { + std::vector < sword::SWBuf > getGlobalOptionsVector() { + std::list<sword::SWBuf> l(self->getGlobalOptions()); + return std::vector< sword::SWBuf >(l.begin(), l.end()); + } + + std::vector < sword::SWBuf > getGlobalOptionValuesVector(const char *option) { + std::list<sword::SWBuf> l(self->getGlobalOptionValues(option)); + return std::vector< sword::SWBuf >(l.begin(), l.end()); + } + + std::map<sword::SWBuf, sword::SWModule*> &getModules() { + return self->Modules; + } + + SWModule* getModuleAt( const int pos ) { + if (pos < 0 || pos > self->Modules.size() ) + return 0; + + sword::ModMap::iterator it = self->Modules.begin(); + + for (int i = 0; i < pos; ++i) { + it++; + } + + if ( it != self->Modules.end() ) { + return (*it).second; + } + + return 0; + } +} |