X-Git-Url: https://git.saurik.com/apt.git/blobdiff_plain/e841200b9389ffc90e290310207bcb47e8a52be2..0c6aa02ecfbb1b1ecac519527467befae36b7c40:/apt-pkg/cacheiterators.h diff --git a/apt-pkg/cacheiterators.h b/apt-pkg/cacheiterators.h index dfe5707e1..26070636e 100644 --- a/apt-pkg/cacheiterators.h +++ b/apt-pkg/cacheiterators.h @@ -75,6 +75,12 @@ template class pkgCache::Iterator : inline bool IsGood() const { return S && Owner && ! end();}; inline unsigned long Index() const {return S - OwnerPointer();}; + void ReMap(void const * const oldMap, void const * const newMap) { + if (Owner == 0 || S == 0) + return; + S += (Str*)(newMap) - (Str*)(oldMap); + } + // Constructors - look out for the variable assigning inline Iterator() : S(0), Owner(0) {}; inline Iterator(pkgCache &Owner,Str *T = 0) : S(T), Owner(&Owner) {}; @@ -109,8 +115,11 @@ class pkgCache::GrpIterator: public Iterator { /** \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() const; + in the list of Architectures which is not an end-Pointer + + \param PreferNonVirtual tries to respond with a non-virtual package + and only if this fails returns the best virtual package */ + PkgIterator FindPreferredPkg(bool const &PreferNonVirtual = true) const; PkgIterator NextPkg(PkgIterator const &Pkg) const; // Constructors @@ -284,6 +293,9 @@ class pkgCache::DepIterator : public Iterator { inline const char *CompType() const {return Owner->CompType(S->CompareOp);}; inline const char *DepType() const {return Owner->DepType(S->Type);}; + //Nice printable representation + friend std::ostream& operator <<(std::ostream& out, DepIterator D); + inline DepIterator(pkgCache &Owner, Dependency *Trg, Version* = 0) : Iterator(Owner, Trg), Type(DepVer) { if (S == 0)