From bb73aebd7378e2eb318e2ee7254275e97ecce5bd Mon Sep 17 00:00:00 2001 From: Stefan Haas Date: Fri, 21 Sep 2007 11:35:35 +0000 Subject: [PATCH] Minor changes for perl-bindings --- swig/ItemCapKind.i | 86 ++++++++++++++++++++++++------------------------------ swig/ResStatus.i | 5 ++++ swig/zypp.i | 3 +- 3 files changed, 45 insertions(+), 49 deletions(-) diff --git a/swig/ItemCapKind.i b/swig/ItemCapKind.i index 6493130..bbe5bdf 100644 --- a/swig/ItemCapKind.i +++ b/swig/ItemCapKind.i @@ -1,58 +1,48 @@ -/*%{ - -struct solver::detail::ItemCapKind -{ - public: - Capability cap; //Capability which has triggerd this selection - Dep capKind; //Kind of that capability - PoolItem_Ref item; //Item which has triggered this selection - bool initialInstallation; //This item has triggered the installation - //Not already fullfilled requierement only. - - ItemCapKind( PoolItem i, Capability c, Dep k, bool initial) - : cap( c ) - , capKind( k ) - , item( i ) - , initialInstallation( initial ) - { } -}; -//typedef std::list solver::detail::ItemCapKindList; -%} -*/ +%template(ItemCapKindList) std::list; -namespace zypp +namespace solver { - namespace solver + namespace detail { - namespace detail - { - - struct ItemCapKind - { - public: - Capability cap; - Dep capKind; - PoolItem_Ref item; - bool initialInstallation; - - /*%extend { - ItemCapKind(){}; - }*/ - //ItemCapKind(); - ItemCapKind( PoolItem i, Capability c, Dep k, bool initial) - : cap( c ) - , capKind( k ) - , item( i ) - , initialInstallation( initial ) - { } - }; + struct ItemCapKind + { + public: + Capability cap; + Dep capKind; + PoolItem_Ref item; + bool initialInstallation; + + /*%extend { + ItemCapKind(){}; + }*/ + + //ItemCapKind(); + ItemCapKind( PoolItem i, Capability c, Dep k, bool initial) + : cap( c ) + , capKind( k ) + , item( i ) + , initialInstallation( initial ) + { } + }; + #ifdef SWIGPERL5 + %extend ItemCapKind { + PoolItem_Ref getItem(){ + return self->item; + } + Capability getCap(){ + return self->cap; + } + Dep getCapKind(){ + return self->capKind; } + bool getInitialInstallation(){ + return self->initialInstallation; + } + }; + #endif } } -typedef std::list solver::detail::ItemCapKindList; -%template(ItemCapKindList) std::list; - #ifdef SWIGRUBY auto_iterator(std::list, solver::detail::ItemCapKind); #endif diff --git a/swig/ResStatus.i b/swig/ResStatus.i index 7661354..5f38b04 100644 --- a/swig/ResStatus.i +++ b/swig/ResStatus.i @@ -379,5 +379,10 @@ class ResStatus { return self->setToBeInstalled(ResStatus::USER); } + + bool setToBeInstalledLow() + { + return self->setToBeInstalled(ResStatus::APPL_LOW); + } }; #endif diff --git a/swig/zypp.i b/swig/zypp.i index 3b40c11..9cae74c 100644 --- a/swig/zypp.i +++ b/swig/zypp.i @@ -43,6 +43,7 @@ using namespace zypp::filesystem; typedef std::set UrlSet; typedef std::list StringList; +typedef std::list ItemCapKindList; %} %rename("+") "operator+"; @@ -119,8 +120,8 @@ class intrusive_ptr { %include "ZYppCommitPolicy.i" %include "ZYppCommitResult.i" %include "TmpPath.i" -%include "Resolver.i" %include "ItemCapKind.i" +%include "Resolver.i" class ZYpp -- 2.7.4