]> git.saurik.com Git - apt.git/blobdiff - apt-pkg/cacheiterators.h
* apt-pkg/pkgcache.cc:
[apt.git] / apt-pkg / cacheiterators.h
index 3d58f7ec0218ac9ace3082ed2e220fa78a57b3ba..e5b23a81880a78ca2b94b80500329bcecd8a7c6c 100644 (file)
@@ -66,7 +66,7 @@ template<typename Str, typename Itr> class pkgCache::Iterator :
        inline operator Str const *() const {return S == OwnerPointer() ? 0 : S;};
        inline Str &operator *() {return *S;};
        inline Str const &operator *() const {return *S;};
-       inline pkgCache *Cache() {return Owner;};
+       inline pkgCache *Cache() const {return Owner;};
 
        // Mixed stuff
        inline void operator =(const Itr &B) {S = B.S; Owner = B.Owner;};
@@ -104,6 +104,11 @@ class pkgCache::GrpIterator: public Iterator<Group, GrpIterator> {
        inline const char *Name() const {return S->Name == 0?0:Owner->StrP + S->Name;};
        inline PkgIterator PackageList() const;
        PkgIterator FindPkg(string Arch = "any");
+       /** \brief find the package with the "best" architecture
+
+           The best architecture is either the "native" or the first
+           in the list of Architectures which is not an end-Pointer */
+       PkgIterator FindPreferredPkg();
        PkgIterator NextPkg(PkgIterator const &Pkg);
 
        // Constructors