// Ignore static versions shadowed by member functions
%ignore zypp::Arch::compare(const Arch &, const Arch &);
-typedef std::set<Arch,CompareByGT<Arch> > CompatSet;
+template<class A, class B> class std::unary_function {};
+%template(ArchCompatFun) std::unary_function<zypp::Arch, bool>;
%include <zypp/Arch.h>
-
ADD_SUBDIRECTORY(ruby)
-#ADD_SUBDIRECTORY(python)
+ADD_SUBDIRECTORY(python)
-#ADD_SUBDIRECTORY(perl5)
+ADD_SUBDIRECTORY(perl5)
-
-class CapMatch
-{
- enum Result { NOMATCH, MATCH, IRRELEVANT };
-
- public:
-
- CapMatch( bool val_r )
- : _result( val_r ? MATCH : NOMATCH )
- {}
-
- static const CapMatch yes;
- static const CapMatch no;
- static const CapMatch irrelevant;
-
- private:
- CapMatch()
- : _result( IRRELEVANT )
- {}
-
- Result _result;
-};
-
+%include <zypp/CapMatch.h>
// TODO: tell make about dependencies
%include <zypp/Date.h>
-
// %rename Edition::match(const Edition& lhs, const Edition& rhs) match2;
//}
+%ignore zypp::Edition::compare(const Edition &, const Edition &);
+
+%template(IdStringEdition) zypp::IdStringType<zypp::Edition>;
%include <zypp/Edition.h>
-%ignore zypp::Edition::match(Edition const &);
\ No newline at end of file
--- /dev/null
+
+%include <zypp/IdStringType.h>
-typedef intrusive_ptr<KeyRing> KeyRing_Ptr;
-
-%ignore KeyRingReport;
-%ignore KeyRingSignals;
-
+%ignore zypp::KeyRingReport;
+%ignore zypp::KeyRingSignals;
%include <zypp/KeyRing.h>
-
+nakespcae zypp
+{
+typedef intrusive_ptr<KeyRing> KeyRing_Ptr;
%template(KeyRing_Ptr) intrusive_ptr<KeyRing>;
-
-%template(List_PublicKey) std::list<PublicKey>;
-
+}
+%template(List_PublicKey) std::list<zypp::PublicKey>;
-template<class _Tp>
-class KindOf
-{
- public:
- /** DefaultCtor: empty string */
- KindOf()
- {}
- /** Ctor from string.
- * Lowercase version of \a value_r is used as identification.
- */
- explicit
- KindOf( const std::string & value_r )
- : _value( str::toLower(value_r) )
- {}
- /** Dtor */
- ~KindOf()
- {}
- public:
- /** Identification string. */
- const std::string & asString() const
- { return _value; }
+%ignore zypp::ResKind::satIdent( const std::string & name_r ) const;
- /** Order on KindOf (arbitrary).
- * Not necessarily lexicographical.
- * \todo Enable class _Tp to define the order,
- * Fix logical operators below to use compare,
- */
- int compare( const KindOf & rhs ) const
- { return _value.compare( rhs._value ); }
-
- private:
- /** */
- std::string _value;
-};
-
-%template(KindOfResolvable) KindOf<Resolvable>;
+%template(IdStringResKind) zypp::IdStringType<zypp::ResKind>;
+%include <zypp/ResKind.h>
-%ignore Package::checksum();
+//%ignore zypp::Package::checksum();
%include <zypp/Package.h>
%include <zypp/PoolItem.h>
-//typedef PoolItem PoolItem;
+#ifdef SWIGPERL5
+#else
+%template(PoolItemSet) std::set<zypp::PoolItem>;
+#endif
%extend zypp::PoolItem
{
str << *self;
return str.str();
}
-}
\ No newline at end of file
+}
#endif
%include <zypp/RepoInfo.h>
-
-typedef std::list<RepoInfo> RepoInfoList;
-%template(RepoInfoList) std::list<RepoInfo>;
-
+typedef std::list<zypp::RepoInfo> RepoInfoList;
+%template(RepoInfoList) std::list<zypp::RepoInfo>;
-#if 1
- ///////////////////////////////////////////////////////////////////
- //
- // CLASS NAME : Repository
- //
- /** */
- class Repository : protected sat::detail::PoolMember,
- private base::SafeBool<Repository>
- {
- public:
- typedef filter_iterator<detail::ByRepository, sat::detail::SolvableIterator> SolvableIterator;
- typedef sat::detail::size_type size_type;
- public:
- /** Default ctor creates \ref noRepository.*/
- Repository();
-
- /** \ref PoolImpl ctor. */
- explicit Repository( sat::detail::RepoIdType id_r );
-
- public:
- /** Represents no \ref Repository. */
- static const Repository noRepository;
-
- /** Return whether this is the system repository. */
- bool isSystemRepo() const;
-
- public:
- /** The repos name (alias). */
- std::string name() const;
-
- /** Whether \ref Repository contains solvables. */
- bool solvablesEmpty() const;
-
- /** Number of solvables in \ref Repository. */
- size_type solvablesSize() const;
-
- /** Iterator to the first \ref Solvable. */
- SolvableIterator solvablesBegin() const;
-
- /** Iterator behind the last \ref Solvable. */
- SolvableIterator solvablesEnd() const;
-
- public:
- /** Return any associated \ref RepoInfo. */
- RepoInfo info() const;
-
- /** Set \ref RepoInfo for this repository.
- * \throws Exception if this is \ref noRepository
- * \throws Exception if the \ref RepoInfo::alias
- * does not match the \ref Repository::name.
- */
- void setInfo( const RepoInfo & info_r );
-
- /** Remove any \ref RepoInfo set for this repository. */
- void clearInfo();
-
- public:
- /** Remove this \ref Repository from it's \ref Pool. */
- void eraseFromPool();
-
- /** Functor calling \ref eraseFromPool. */
- struct EraseFromPool;
-
- public:
- /** \name Repository content manipulating methods.
- * \todo maybe a separate Repository/Solvable content manip interface
- * provided by the pool.
- */
- //@{
- /** Load \ref Solvables from a solv-file.
- * In case of an exception the repository remains in the \ref Pool.
- * \throws Exception if this is \ref noRepository
- * \throws Exception if loading the solv-file fails.
- * \see \ref Pool::addRepoSolv and \ref Repository::EraseFromPool
- */
- void addSolv( const Pathname & file_r );
-
- /** Add \c count_r new empty \ref Solvable to this \ref Repository. */
- sat::detail::SolvableIdType addSolvables( unsigned count_r );
- /** \overload Add only one new \ref Solvable. */
- sat::detail::SolvableIdType addSolvable();
- //@}
-
- public:
- /** Expert backdoor. */
- ::_Repo * get() const;
- /** Expert backdoor. */
- sat::detail::RepoIdType id() const { return _id; }
- };
- ///////////////////////////////////////////////////////////////////
-#endif
\ No newline at end of file
+%include <zypp/Repository.h>
+%ignore zypp::make_res_object;
%include <zypp/ResObject.h>
-namespace zypp {
-%apply unsigned { ResPool::size_type };
+%nodefault zypp::ResPool;
-%nodefault ResPool;
-%ignore ResPool::byKindBegin;
-%ignore ResPool::byKindEnd;
-%ignore ResPool::byNameBegin;
-%ignore ResPool::byNameEnd;
+// missing resfilter:: to call these
+%ignore zypp::ResPool::byKindBegin;
+%ignore zypp::ResPool::byKindEnd;
+%ignore zypp::ResPool::byNameBegin;
+%ignore zypp::ResPool::byNameEnd;
+%apply unsigned { zypp::ResPool::size_type };
+%include <zypp/ResPool.h>
-class ResPool
- {
- friend std::ostream & operator<<( std::ostream & str, const ResPool & obj );
-
- public:
- /** \ref PoolItem */
- typedef PoolItem value_type;
- typedef pool::PoolTraits::size_type size_type;
- typedef pool::PoolTraits::const_iterator const_iterator;
-
- typedef pool::PoolTraits::byCapabilityIndex_iterator byCapabilityIndex_iterator;
- typedef pool::PoolTraits::repository_iterator repository_iterator;
-
- public:
- /** Singleton ctor. */
- static ResPool instance();
-
- /** preliminary */
- ResPoolProxy proxy() const;
-
- public:
- /** The pools serial number. Changing whenever the
- * whenever the content changes. (Resolvables or
- * Dependencies).
- */
- const SerialNumber & serial() const;
-
- public:
- /** */
- bool empty() const;
- /** */
- size_type size() const;
-
- /** */
- const_iterator begin() const;
- const_iterator end() const;
-
- public:
- /** Return the corresponding \ref PoolItem.
- * Pool and sat pool should be in sync. Returns an empty
- * \ref PoolItem if there is no corresponding \ref PoolItem.
- * \see \ref PoolItem::satSolvable.
- */
- PoolItem find( const sat::Solvable & slv_r ) const;
-
- public:
- /** \name Iterate through all PoolItems matching a \c _Filter. */
- //@{
- template<class _Filter>
- filter_iterator<_Filter,const_iterator> filterBegin( const _Filter & filter_r ) const
- { return make_filter_begin( filter_r, *this ); }
-
- template<class _Filter>
- filter_iterator<_Filter,const_iterator> filterEnd( const _Filter & filter_r ) const
- { return make_filter_end( filter_r, *this ); }
- //@}
-
- public:
- /** \name Iterate through all PoolItems of a certain name and kind. */
- //@{
- typedef pool::ByIdent ByIdent;
- typedef pool::PoolTraits::byIdent_iterator byIdent_iterator;
-
- byIdent_iterator byIdentBegin( const ByIdent & ident_r ) const
- {
- return make_transform_iterator( id2item().equal_range( ident_r.get() ).first,
- pool::PoolTraits::Id2ItemValueSelector() );
- }
-
- byIdent_iterator byIdentBegin( ResKind kind_r, IdString name_r ) const
- { return byIdentBegin( ByIdent(kind_r,name_r) ); }
-
- byIdent_iterator byIdentBegin( ResKind kind_r, const C_Str & name_r ) const
- { return byIdentBegin( ByIdent(kind_r,name_r) ); }
-
- template<class _Res>
- byIdent_iterator byIdentBegin( IdString name_r ) const
- { return byIdentBegin( ByIdent(ResTraits<_Res>::kind,name_r) ); }
-
- template<class _Res>
- byIdent_iterator byIdentBegin( const C_Str & name_r ) const
- { return byIdentBegin( ByIdent(ResTraits<_Res>::kind,name_r) ); }
-
- /** Derive name and kind from \ref PoolItem. */
- byIdent_iterator byIdentBegin( const PoolItem & pi_r ) const
- { return byIdentBegin( ByIdent(pi_r.satSolvable()) ); }
- /** Derive name and kind from \ref sat::Solvable. */
- byIdent_iterator byIdentBegin( sat::Solvable slv_r ) const
- { return byIdentBegin( ByIdent(slv_r) ); }
- /** Takes a \ref sat::Solvable::ident string. */
- byIdent_iterator byIdentBegin( IdString ident_r ) const
- { return byIdentBegin( ByIdent(ident_r) ); }
-
-
- byIdent_iterator byIdentEnd( const ByIdent & ident_r ) const
- {
- return make_transform_iterator( id2item().equal_range( ident_r.get() ).second,
- pool::PoolTraits::Id2ItemValueSelector() );
- }
-
- byIdent_iterator byIdentEnd( ResKind kind_r, IdString name_r ) const
- { return byIdentEnd( ByIdent(kind_r,name_r) ); }
-
- byIdent_iterator byIdentEnd( ResKind kind_r, const C_Str & name_r ) const
- { return byIdentEnd( ByIdent(kind_r,name_r) ); }
-
- template<class _Res>
- byIdent_iterator byIdentEnd( IdString name_r ) const
- { return byIdentEnd( ByIdent(ResTraits<_Res>::kind,name_r) ); }
-
- template<class _Res>
- byIdent_iterator byIdentEnd( const C_Str & name_r ) const
- { return byIdentEnd( ByIdent(ResTraits<_Res>::kind,name_r) ); }
-
- /** Derive name and kind from \ref PoolItem. */
- byIdent_iterator byIdentEnd( const PoolItem & pi_r ) const
- { return byIdentEnd( ByIdent(pi_r.satSolvable()) ); }
- /** Derive name and kind from \ref sat::Solvable. */
- byIdent_iterator byIdentEnd( sat::Solvable slv_r ) const
- { return byIdentEnd( ByIdent(slv_r) ); }
- /** Takes a \ref sat::Solvable::ident string. */
- byIdent_iterator byIdentEnd( IdString ident_r ) const
- { return byIdentEnd( ByIdent(ident_r) ); }
- //@}
-
- public:
- /** \name Iterate through all ResObjects of a certain kind. */
- //@{
- typedef zypp::resfilter::ByKind ByKind;
- typedef filter_iterator<ByKind,const_iterator> byKind_iterator;
-
- byKind_iterator byKindBegin( const ResKind & kind_r ) const
- { return make_filter_begin( ByKind(kind_r), *this ); }
-
- template<class _Res>
- byKind_iterator byKindBegin() const
- { return make_filter_begin( resfilter::byKind<_Res>(), *this ); }
-
- byKind_iterator byKindEnd( const ResKind & kind_r ) const
- { return make_filter_end( ByKind(kind_r), *this ); }
-
- template<class _Res>
- byKind_iterator byKindEnd() const
- { return make_filter_end( resfilter::byKind<_Res>(), *this ); }
- //@}
-
- public:
- /** \name Iterate through all ResObjects with a certain name (all kinds).
- * \deprecated Instead of iterating byName and filter byKind use ByIdent iterator.
- */
- //@{
- typedef zypp::resfilter::ByName ByName;
- typedef filter_iterator<ByName,const_iterator> byName_iterator;
-
-
-
- public:
- /** \name Iterate through all Repositories that contribute ResObjects.
- */
- //@{
- size_type knownRepositoriesSize() const;
-
- repository_iterator knownRepositoriesBegin() const;
-
- repository_iterator knownRepositoriesEnd() const;
- //@}
-
- public:
- /** \name Iterate through requested/available Locales.
- */
- //@{
- /** Set the requested locales.
- * Languages to be supported by the system, e.g. language specific
- * packages to be installed.
- */
- void setRequestedLocales( const LocaleSet & locales_r );
-
- /** Add one \ref Locale to the set of requested locales.
- * Return \c true if \c locale_r was newly added to the set.
- */
- bool addRequestedLocale( const Locale & locale_r );
-
- /** Erase one \ref Locale from the set of requested locales.
- * Return \c false if \c locale_r was not found in the set.
- */
- bool eraseRequestedLocale( const Locale & locale_r );
-
- /** Return the requested locales.
- * \see \ref setRequestedLocales
- */
- const LocaleSet & getRequestedLocales() const;
-
- /** Wheter this \ref Locale is in the set of requested locales. */
- bool isRequestedLocale( const Locale & locale_r ) const;
-
- /** Get the set of available locales.
- * This is computed from the package data so it actually
- * represents all locales packages claim to support.
- */
- const LocaleSet & getAvailableLocales() const;
-
- /** Wheter this \ref Locale is in the set of available locales. */
- bool isAvailableLocale( const Locale & locale_r ) const;
- //@}
-
- private:
- const pool::PoolTraits::ItemContainerT & store() const;
- const pool::PoolTraits::Id2ItemT & id2item() const;
-
- private:
- /** Ctor */
- ResPool( pool::PoolTraits::Impl_constPtr impl_r );
- /** Const access to implementation. */
- pool::PoolTraits::Impl_constPtr _pimpl;
- };
-
+namespace zypp
+{
#ifdef SWIGPERL5
#endif
#ifdef SWIGPYTHON
-%template(PoolItemSet) std::set<PoolItem>;
%newobject ResPool::const_iterator(PyObject **PYTHON_SELF);
%extend ResPool {
swig::PySwigIterator* iterator(PyObject **PYTHON_SELF)
};
#endif
-%extend ResStatus
+%extend zypp::ResStatus
{
std::string asString() const
{
-
+%ignore zypp::make;
%import <zypp/sat/Solvable.h>
%include <zypp/Resolvable.h>
#endif
%include <zypp/Resolver.h>
-
+namespace zypp
+{
typedef intrusive_ptr<Resolver> Resolver_Ptr;
%template(Resolver_Ptr) intrusive_ptr<Resolver>;
+}
\ No newline at end of file
-typedef intrusive_ptr<Target> Target_Ptr;
-
%include <zypp/Target.h>
-
+namespace zypp
+{
+typedef intrusive_ptr<Target> Target_Ptr;
%template(Target_Ptr) intrusive_ptr<Target>;
+}
+%include <zypp/ZYppFactory.h>
+
namespace zypp
{
+typedef intrusive_ptr<ZYpp> ZYpp_Ptr;
%template(ZYpp_Ptr) intrusive_ptr<ZYpp>;
}
-%include <zypp/ZYppFactory.h>
+%ignore zypp::Arch_empty;
+
namespace zypp
{
// These operators must be ignored otherwise the wrapper does
%ignore operator<<;
%ignore operator==;
%ignore operator!=;
+
+ namespace filesystem
+ {
+ // Same as above.
+ %ignore operator==;
+ %ignore operator!=;
+ %ignore operator<<;
+ }
}
%define iter(cls, storetype)
%rename *::asString "__str__";
+%ignore zypp::Arch_empty;
namespace zypp
{
// not compile (using swig 1.3.29).
%ignore operator==;
%ignore operator!=;
-
+
// Just to avoid warnings.
%ignore operator<<;
}
-
%rename *::asString "__str__";
-
namespace zypp
{
// Not ignoring gives a very strange error in the "pokus" testsuite: SWIG
template < typename T >
class intrusive_ptr {
public:
- T *operator->();
+ T *operator->();
};
namespace zypp {
%include "perl5/perl.i"
#endif
+%include "IdStringType.i"
%include "Pathname.i"
%include "Url.i"
%include "ResStatus.i"
%include "python/callbacks.i"
#endif
-class ZYpp
-{
- public:
- typedef intrusive_ptr<ZYpp> Ptr;
- typedef intrusive_ptr<const ZYpp> constPtr;
- public:
-
- //ResPool pool() const;
- //ResPoolProxy poolProxy() const;
-
- /*
- DiskUsageCounter::MountPointSet diskUsage();
- void setPartitions(const DiskUsageCounter::MountPointSet &mp);
- */
- Target_Ptr target() const;
- void initializeTarget(const zypp::Pathname & root);
- void finishTarget();
-
- typedef ZYppCommitResult CommitResult;
- ZYppCommitResult commit( const ZYppCommitPolicy & policy_r );
-
- Resolver_Ptr resolver() const;
- KeyRing_Ptr keyRing() const;
-
- /*
- void setTextLocale( const Locale & textLocale_r );
- Locale getTextLocale() const;
- typedef std::set<Locale> LocaleSet;
- void setRequestedLocales( const LocaleSet & locales_r );
- LocaleSet getRequestedLocales() const;
- LocaleSet getAvailableLocales() const;
- void availableLocale( const Locale & locale_r );
- */
- zypp::Pathname homePath() const;
- zypp::Pathname tmpPath() const;
- void setHomePath( const zypp::Pathname & path );
-
- 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:
- friend class ZYppFactory;
- explicit ZYpp( const Impl_Ptr & impl_r );
-};
-
+%include <zypp/ZYpp.h>
%include "ZYppFactory.i"