Mailinglist Archive: zypp-commit (185 mails)

< Previous Next >
[zypp-commit] r10789 - in /trunk/libzypp-bindings/swig: Arch.i PoolItem.i
  • From: kkaempf@xxxxxxxxxxxxxxxx
  • Date: Thu, 07 Aug 2008 16:27:56 -0000
  • Message-id: <20080807162757.16A903454A@xxxxxxxxxxxxxxxx>
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<zypp::Arch, bool>;

%include <zypp/Arch.h>
+
+%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@xxxxxxxxxxxx
For additional commands, e-mail: zypp-commit+help@xxxxxxxxxxxx

< Previous Next >
This Thread
  • No further messages