--- /dev/null
+ class Atom : public ResObject
+ {
+ public:
+ typedef detail::AtomImplIf Impl;
+ typedef Atom Self;
+ typedef ResTraits<Self> TraitsType;
+ typedef TraitsType::PtrType Ptr;
+ typedef TraitsType::constPtrType constPtr;
+
+ protected:
+ Atom( const NVRAD & nvrad_r );
+ /** Dtor */
+ virtual ~Atom();
+
+ private:
+ /** Access implementation */
+ virtual Impl & pimpl() = 0;
+ /** Access implementation */
+ virtual const Impl & pimpl() const = 0;
+ };
--- /dev/null
+ class Language : public ResObject
+ {
+ public:
+ typedef detail::LanguageImplIf Impl;
+ typedef Language Self;
+ typedef ResTraits<Self> TraitsType;
+ typedef TraitsType::PtrType Ptr;
+ typedef TraitsType::constPtrType constPtr;
+
+ /** Installed Language instance. */
+ static Ptr installedInstance( const Locale & locale_r );
+ /** Available Language instance. */
+ static Ptr availableInstance( const Locale & locale_r );
+
+ protected:
+ /** Ctor */
+ Language( const NVRAD & nvrad_r );
+ /** Dtor */
+ virtual ~Language();
+
+ private:
+ /** Access implementation */
+ virtual Impl & pimpl() = 0;
+ /** Access implementation */
+ virtual const Impl & pimpl() const = 0;
+ };
--- /dev/null
+ class Message : public ResObject
+ {
+ public:
+ typedef detail::MessageImplIf Impl;
+ typedef Message Self;
+ typedef ResTraits<Self> TraitsType;
+ typedef TraitsType::PtrType Ptr;
+ typedef TraitsType::constPtrType constPtr;
+
+ public:
+ /** Get the text of the message */
+ TranslatedText text() const;
+ /** Patch the message belongs to - if any */
+ Patch::constPtr patch() const;
+
+ protected:
+ Message( const NVRAD & nvrad_r );
+ /** Dtor */
+ virtual ~Message();
+
+ private:
+ /** Access implementation */
+ virtual Impl & pimpl() = 0;
+ /** Access implementation */
+ virtual const Impl & pimpl() const = 0;
+ };
--- /dev/null
+ class Pattern : public ResObject
+ {
+ public:
+ typedef detail::PatternImplIf Impl;
+ typedef Pattern Self;
+ typedef ResTraits<Self> TraitsType;
+ typedef TraitsType::PtrType Ptr;
+ typedef TraitsType::constPtrType constPtr;
+
+ public:
+ /** */
+ bool isDefault() const;
+ /** */
+ bool userVisible() const;
+ /** */
+ std::string category() const;
+ /** */
+ Pathname icon() const;
+ /** */
+ Pathname script() const;
+ /** */
+ Label order() const;
+
+ /** \deprecated AFAIK unused old Selection interface method. */
+ std::set<std::string> install_packages( const Locale & lang = Locale("") ) const;
+
+ /** Ui hint. */
+ const CapSet & includes() const;
+ /** Ui hint. */
+ const CapSet & extends() const;
+
+ protected:
+ /** Ctor */
+ Pattern( const NVRAD & nvrad_r );
+ /** Dtor */
+ virtual ~Pattern();
+
+ private:
+ /** Access implementation */
+ virtual Impl & pimpl() = 0;
+ /** Access implementation */
+ virtual const Impl & pimpl() const = 0;
+ };
typedef PoolItem_Ref PoolItem;
+%extend PoolItem_Ref
+{
+ std::string asString() const
+ {
+ std::ostringstream str;
+ str << *self;
+ return str.str();
+ }
+}
\ No newline at end of file
--- /dev/null
+ class Product : public ResObject
+ {
+ public:
+ typedef detail::ProductImplIf Impl;
+ typedef Product Self;
+ typedef ResTraits<Self> TraitsType;
+ typedef TraitsType::PtrType Ptr;
+ typedef TraitsType::constPtrType constPtr;
+
+ public:
+ /** Get the product type (base, add-on) */
+ std::string type() const;
+ /** \deprecated Use \ref type. */
+ std::string category() const
+ { return type(); }
+
+ /** Get the vendor of the product */
+ Label vendor() const;
+
+ /** The URL to download the release notes for this product */
+ Url releaseNotesUrl() const;
+
+ /**
+ * Online updates for the product.
+ * They are complementary, not alternatives. #163192
+ */
+ std::list<Url> updateUrls() const;
+
+ /**
+ * Additional software for the product
+ * They are complementary, not alternatives.
+ */
+ std::list<Url> extraUrls() const;
+
+ /**
+ * Optional software for the product
+ * (for example. Non OSS repositories)
+ * They are complementary, not alternatives.
+ */
+ std::list<Url> optionalUrls() const;
+
+ /** The product flags */
+ std::list<std::string> flags() const;
+
+ /** */
+ Label shortName() const;
+
+ /** */
+ Label longName() const;
+
+ /** Vendor specific distribution id. */
+ std::string distributionName() const;
+
+ /** Vendor specific distribution version. */
+ Edition distributionEdition() const;
+
+ protected:
+ /** Ctor */
+ Product( const NVRAD & nvrad_r );
+ /** Dtor */
+ virtual ~Product();
+
+ private:
+ /** Access implementation */
+ virtual Impl & pimpl() = 0;
+ /** Access implementation */
+ virtual const Impl & pimpl() const = 0;
+ };
-%template(ResObject_constPtr) intrusive_ptr<const ResObject>;
-
class ResObject : public Resolvable
{
public:
const NVRAD & nvrad_r );
virtual ~ResObject();
};
-
-
-#if 0
-%extend intrusive_ptr<const ResObject>
-{
- // FIXME: this is just a workaround, see Kind.i
- const char* kindToS()
- {
- if (isKind<Package>(*self))
- return "package";
- else if (isKind<Patch>(*self))
- return "patch";
- else if (isKind<Product>(*self))
- return "product";
- else if (isKind<Pattern>(*self))
- return "pattern";
- else if (isKind<Language>(*self))
- return "language";
- return "unknown";
- }
-
- int __cmp__(intrusive_ptr<const ResObject>& other)
- {
- return compareByNVRA(*self, other);
- }
-}
-#endif
#ifdef SWIGPERL5
%extend ResStatus {
-
+
bool setToBeInstalledUser()
- {
+ {
return self->setToBeInstalled(ResStatus::USER);
- }
+ }
bool resetTransactUser()
{
}
};
#endif
+
+%extend ResStatus
+{
+ std::string asString() const
+ {
+ std::ostringstream str;
+ str << *self;
+ return str.str();
+ }
+}
\ No newline at end of file
%template(ResTraitsResolvable) ResTraits<Resolvable>;
-#ifdef SWIGPYTHON
-%pythoncode %{
-def KindOfPackage():
- return KindOfResolvable( "package" )
-def KindOfSrcPackage():
- return KindOfResolvable( "srcpackage" )
-def KindOfPatch():
- return KindOfResolvable( "patch" )
-def KindOfPattern():
- return KindOfResolvable( "pattern" )
-def KindOfProduct():
- return KindOfResolvable( "product" )
-def KindOfAtom():
- return KindOfResolvable( "atom" )
-def KindOfScript():
- return KindOfResolvable( "script" )
-def KindOfMessage():
- return KindOfResolvable( "message" )
-def KindOfLanguage():
- return KindOfResolvable( "language" )
-%}
+%template(ResObject_constPtr) intrusive_ptr<const ResObject>;
+%template(ResObject_Ptr) intrusive_ptr<ResObject>;
+
+%define %STUFF(X)
+typedef intrusive_ptr<const X> X##_constPtr;
+typedef intrusive_ptr<X> X##_Ptr;
+
+%template(X##_constPtr) intrusive_ptr<const X>;
+%template(X##_Ptr) intrusive_ptr<X>;
+
+bool isKind##X( const Resolvable::constPtr & p );
+bool isKind##X( const PoolItem & p );
+
+X##_constPtr asKind##X( const Resolvable::constPtr & p );
+X##_constPtr asKind##X( const PoolItem & p );
+
+%header
+{
+ inline bool isKind##X( const Resolvable::constPtr & p )
+ { return isKind<X>( p ); }
+ inline bool isKind##X( const PoolItem & p )
+ { return isKind<X>( p.resolvable() ); }
+
+ inline X::constPtr asKind##X( const Resolvable::constPtr & p )
+ { return asKind<X>( p ); }
+ inline X::constPtr asKind##X( const PoolItem & p )
+ { return asKind<X>( p.resolvable() ); }
+}
+#if defined(SWIGPYTHON)
+%pythoncode
+{
+ def KindOf##X():
+ return KindOfResolvable( #X )
+}
#endif
+%enddef
+
+%STUFF(Package)
+%STUFF(Patch)
+%STUFF(SrcPackage)
+%STUFF(Pattern)
+%STUFF(Product)
+%STUFF(Atom)
+%STUFF(Script)
+%STUFF(Message)
+%STUFF(Language)
--- /dev/null
+ class SrcPackage : public ResObject
+ {
+
+ public:
+ typedef detail::SrcPackageImplIf Impl;
+ typedef SrcPackage Self;
+ typedef ResTraits<Self> TraitsType;
+ typedef TraitsType::PtrType Ptr;
+ typedef TraitsType::constPtrType constPtr;
+
+ public:
+ /** location of resolvable in repo */
+ OnMediaLocation location() const;
+
+ protected:
+ SrcPackage( const NVRAD & nvrad_r );
+ /** Dtor */
+ virtual ~SrcPackage();
+
+ private:
+ /** Access implementation */
+ virtual Impl & pimpl() = 0;
+ /** Access implementation */
+ virtual const Impl & pimpl() const = 0;
+ };
%{
/* Includes the header in the wrapper code */
+#include <sstream>
#include "zypp/base/PtrTypes.h"
#include "zypp/Edition.h"
#include "zypp/ResTraits.h"
#include "zypp/TranslatedText.h"
#include "zypp/CapFactory.h"
#include "zypp/Package.h"
+#include "zypp/Patch.h"
+#include "zypp/Atom.h"
+#include "zypp/SrcPackage.h"
+#include "zypp/Script.h"
+#include "zypp/Message.h"
+#include "zypp/Pattern.h"
+#include "zypp/Language.h"
+#include "zypp/Product.h"
#include "zypp/ResFilters.h"
#include "zypp/OnMediaLocation.h"
#include "zypp/Repository.h"
%include "NVRAD.i"
%include "Package.i"
%include "Patch.i"
+%include "Atom.i"
+%include "SrcPackage.i"
+%include "Script.i"
+%include "Message.i"
+%include "Pattern.i"
+%include "Language.i"
+%include "Product.i"
%include "PublicKey.i"
%include "KeyRing.i"
%include "Target.i"
Arch architecture() const;
void setArchitecture( const Arch & arch );
+ /**
+ * \short Apply persistant locks to current pool.
+ * Call this before solving
+ *
+ * \returns Number of items locked
+ */
+ int applyLocks();
+
protected:
virtual ~ZYpp();
private: