summaryrefslogtreecommitdiff
path: root/bindings/swig/package/swconfig.i
diff options
context:
space:
mode:
Diffstat (limited to 'bindings/swig/package/swconfig.i')
-rw-r--r--bindings/swig/package/swconfig.i25
1 files changed, 25 insertions, 0 deletions
diff --git a/bindings/swig/package/swconfig.i b/bindings/swig/package/swconfig.i
new file mode 100644
index 0000000..6ec1cad
--- /dev/null
+++ b/bindings/swig/package/swconfig.i
@@ -0,0 +1,25 @@
+%{
+#include "swconfig.h"
+%}
+
+%ignore sword::SWConfig::operator[];
+%ignore sword::SWConfig::operator+=;
+%ignore sword::SWConfig::sections;
+%ignore sword::SWConfig::Sections;
+
+%include "swconfig.h"
+
+
+%extend sword::SWConfig {
+ void set(const char* group, const char* entry, const char* value) {
+ self->Sections[group][entry] = value;
+ };
+ const char* get(const char* group, const char* entry) {
+ return self->Sections[group][entry].c_str();
+ };
+ std::multimap < sword::SWBuf, std::map <sword::SWBuf, sword::SWBuf> >
+ *getSections() {
+ return (std::multimap < sword::SWBuf, std::map < sword::SWBuf, sword::SWBuf > > *) &self->Sections;
+ }
+}
+