From: David Kalnischkies Date: Wed, 3 Sep 2014 09:11:10 +0000 (+0200) Subject: add APT::PackageUniverse as a pkgCache wrapper X-Git-Tag: 1.1.exp4~43 X-Git-Url: https://git.saurik.com/apt.git/commitdiff_plain/840ca9714364d5ef5aa8eee0c9b045277b6ab945 add APT::PackageUniverse as a pkgCache wrapper Git-Dch: Ignore --- diff --git a/apt-pkg/cacheset.h b/apt-pkg/cacheset.h index 736dda3cf..2656727d4 100644 --- a/apt-pkg/cacheset.h +++ b/apt-pkg/cacheset.h @@ -428,6 +428,44 @@ template<> template inline bool PackageContainerHead().PackageCount; } + + const_iterator begin() const { return _cont->PkgBegin(); } + const_iterator end() const { return _cont->PkgEnd(); } + iterator begin() { return _cont->PkgBegin(); } + iterator end() { return _cont->PkgEnd(); } + + PackageUniverse(pkgCache * const Owner) : _cont(Owner) { } + +private: + bool insert(pkgCache::PkgIterator const &) { return true; } + template void insert(PackageContainer const &) { } + void insert(const_iterator, const_iterator) { } + + void clear() { } + iterator& erase(iterator &iter) { return iter; } + size_t erase(const pkgCache::PkgIterator) { return 0; } + void erase(iterator, iterator) { } + + void setConstructor(Constructor const &) { } + Constructor getConstructor() const { return UNKNOWN; } +}; + /*}}}*/ typedef PackageContainer > PackageSet; typedef PackageContainer > PackageList; typedef PackageContainer > PackageVector;