+ inline Iterator() : S(0), Owner(0) {}
+ inline Iterator(pkgCache &Owner,Str *T = 0) : S(T), Owner(&Owner) {}
+};
+ /*}}}*/
+// Group Iterator /*{{{*/
+/* Packages with the same name are collected in a Group so someone only
+ interest in package names can iterate easily over the names, so the
+ different architectures can be treated as of the "same" package
+ (apt internally treat them as totally different packages) */
+class pkgCache::GrpIterator: public Iterator<Group, GrpIterator> {
+ long HashIndex;
+
+ public:
+ inline Group* OwnerPointer() const {
+ return (Owner != 0) ? Owner->GrpP : 0;
+ }
+
+ // This constructor is the 'begin' constructor, never use it.
+ explicit inline GrpIterator(pkgCache &Owner) : Iterator<Group, GrpIterator>(Owner), HashIndex(-1) {
+ S = OwnerPointer();
+ operator++();
+ }
+
+ GrpIterator& operator++();
+ inline GrpIterator operator++(int) { GrpIterator const tmp(*this); operator++(); return tmp; }
+
+ inline const char *Name() const {return S->Name == 0?0:Owner->StrP + S->Name;}
+ inline PkgIterator PackageList() const;
+ PkgIterator FindPkg(std::string Arch = "any") const;
+#ifdef APT_PKG_EXPOSE_STRING_VIEW
+ APT_HIDDEN PkgIterator FindPkg(APT::StringView Arch = APT::StringView("any", 3)) const;
+ APT_HIDDEN PkgIterator FindPkg(const char *Arch) const;
+#endif
+ /** \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
+
+ \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
+ inline GrpIterator(pkgCache &Owner, Group *Trg) : Iterator<Group, GrpIterator>(Owner, Trg), HashIndex(0) {
+ if (S == 0)
+ S = OwnerPointer();
+ }
+ inline GrpIterator() : Iterator<Group, GrpIterator>(), HashIndex(0) {}
+