summaryrefslogtreecommitdiff
path: root/swig/PoolItem.i
diff options
context:
space:
mode:
Diffstat (limited to 'swig/PoolItem.i')
-rw-r--r--swig/PoolItem.i23
1 files changed, 23 insertions, 0 deletions
diff --git a/swig/PoolItem.i b/swig/PoolItem.i
new file mode 100644
index 0000000..34a2eeb
--- /dev/null
+++ b/swig/PoolItem.i
@@ -0,0 +1,23 @@
+%include <zypp/PoolItem.h>
+
+#ifdef SWIGPERL5
+#else
+%template(PoolItemSet) std::set<zypp::PoolItem>;
+#endif
+
+%extend zypp::PoolItem
+{
+#ifdef SWIGPYTHON
+%rename ("__str__") string();
+#endif
+#ifdef SWIGRUBY
+%rename ("to_s") string();
+#endif
+
+ std::string string() const
+ {
+ std::ostringstream str;
+ str << *self;
+ return str.str();
+ }
+}