]>
git.saurik.com Git - apt.git/blob - apt-pkg/packageset.h
d805369427592753f0124431b47ed07b5110abb3
1 // -*- mode: cpp; mode: fold -*-
3 /** \class APT::PackageSet
5 Simple wrapper around a std::set to provide a similar interface to
6 a set of packages as to the complete set of all packages in the
10 #ifndef APT_PACKAGESET_H
11 #define APT_PACKAGESET_H
12 // Include Files /*{{{*/
14 #include <apt-pkg/pkgcache.h>
17 class PackageSet
: public std::set
<pkgCache::PkgIterator
> { /*{{{*/
19 /** \brief smell like a pkgCache::PkgIterator */
20 class const_iterator
: public std::set
<pkgCache::PkgIterator
>::const_iterator
{
22 const_iterator(std::set
<pkgCache::PkgIterator
>::const_iterator x
) :
23 std::set
<pkgCache::PkgIterator
>::const_iterator(x
) {}
25 inline const char *Name() const {return (*this)->Name(); }
26 inline std::string
FullName(bool const &Pretty
) const { return (*this)->FullName(Pretty
); }
27 inline std::string
FullName() const { return (*this)->FullName(); }
28 inline const char *Section() const {return (*this)->Section(); }
29 inline bool Purge() const {return (*this)->Purge(); }
30 inline const char *Arch() const {return (*this)->Arch(); }
31 inline pkgCache::GrpIterator
Group() const { return (*this)->Group(); }
32 inline pkgCache::VerIterator
VersionList() const { return (*this)->VersionList(); }
33 inline pkgCache::VerIterator
CurrentVer() const { return (*this)->CurrentVer(); }
34 inline pkgCache::DepIterator
RevDependsList() const { return (*this)->RevDependsList(); }
35 inline pkgCache::PrvIterator
ProvidesList() const { return (*this)->ProvidesList(); }
36 inline pkgCache::PkgIterator::OkState
State() const { return (*this)->State(); }
37 inline const char *CandVersion() const { return (*this)->CandVersion(); }
38 inline const char *CurVersion() const { return (*this)->CurVersion(); }
39 inline pkgCache
*Cache() {return (*this)->Cache();};
41 friend std::ostream
& operator<<(std::ostream
& out
, const_iterator i
) { return operator<<(out
, (*i
)); }
43 inline pkgCache::PkgIterator
const * operator->() const {
47 // 103. set::iterator is required to be modifiable, but this allows modification of keys
48 typedef typename
APT::PackageSet::const_iterator iterator
;