Author: kkaempf
Date: Thu Aug 7 18:27:56 2008
New Revision: 10789
URL: http://svn.opensuse.org/viewcvs/zypp?rev=10789&view=rev
Log:
define string conversion
Modified:
trunk/libzypp-bindings/swig/Arch.i
trunk/libzypp-bindings/swig/PoolItem.i
Modified: trunk/libzypp-bindings/swig/Arch.i
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp-bindings/swig/Arch.i?rev=10789&r1=10788&r2=10789&view=diff
==============================================================================
--- trunk/libzypp-bindings/swig/Arch.i (original)
+++ trunk/libzypp-bindings/swig/Arch.i Thu Aug 7 18:27:56 2008
@@ -5,3 +5,20 @@
%template(ArchCompatFun) std::unary_function;
%include
+
+%extend zypp::Arch
+{
+#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();
+ }
+}
Modified: trunk/libzypp-bindings/swig/PoolItem.i
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp-bindings/swig/PoolItem.i?rev=10789&r1=10788&r2=10789&view=diff
==============================================================================
--- trunk/libzypp-bindings/swig/PoolItem.i (original)
+++ trunk/libzypp-bindings/swig/PoolItem.i Thu Aug 7 18:27:56 2008
@@ -7,7 +7,14 @@
%extend zypp::PoolItem
{
- std::string asString() const
+#ifdef SWIGPYTHON
+%rename ("__str__") string();
+#endif
+#ifdef SWIGRUBY
+%rename ("to_s") string();
+#endif
+
+ std::string string() const
{
std::ostringstream str;
str << *self;
--
To unsubscribe, e-mail: zypp-commit+unsubscribe@opensuse.org
For additional commands, e-mail: zypp-commit+help@opensuse.org