]> git.saurik.com Git - apt.git/blobdiff - apt-pkg/pkgcache.h
* apt-pkg/depcache.cc:
[apt.git] / apt-pkg / pkgcache.h
index b3d2752d2a65dd6e73a659d9446abfeb93490607..577eebad9c58474c33560f8ded120f57f7389215 100644 (file)
@@ -125,14 +125,19 @@ class pkgCache                                                            /*{{{*/
    
    // Accessors
    GrpIterator FindGrp(const string &Name);
-   PkgIterator FindPkg(const string &Name, string Arch = "native");
+   PkgIterator FindPkg(const string &Name);
+   PkgIterator FindPkg(const string &Name, const string &Arch);
 
    Header &Head() {return *HeaderP;};
+   inline GrpIterator GrpBegin();
+   inline GrpIterator GrpEnd();
    inline PkgIterator PkgBegin();
    inline PkgIterator PkgEnd();
    inline PkgFileIterator FileBegin();
    inline PkgFileIterator FileEnd();
 
+   inline bool MultiArchCache() const { return MultiArchEnabled; };
+
    // Make me a function
    pkgVersioningSystem *VS;
    
@@ -143,6 +148,10 @@ class pkgCache                                                             /*{{{*/
    
    pkgCache(MMap *Map,bool DoMap = true);
    virtual ~pkgCache() {};
+
+private:
+   bool MultiArchEnabled;
+   PkgIterator SingleArchFindPkg(const string &Name);
 };
                                                                        /*}}}*/
 // Header structure                                                    /*{{{*/
@@ -273,8 +282,8 @@ struct pkgCache::Version                                            /*{{{*/
 {
    map_ptrloc VerStr;            // Stringtable
    map_ptrloc Section;           // StringTable (StringItem)
-   map_ptrloc Arch;              // StringTable
-   
+   enum {None, All, Foreign, Same, Allowed} MultiArch;
+
    // Lists
    map_ptrloc FileList;          // VerFile
    map_ptrloc NextVer;           // Version
@@ -337,6 +346,10 @@ struct pkgCache::StringItem                                                /*{{{*/
                                                                        /*}}}*/
 #include <apt-pkg/cacheiterators.h>
 
+inline pkgCache::GrpIterator pkgCache::GrpBegin() 
+       {return GrpIterator(*this);};
+inline pkgCache::GrpIterator pkgCache::GrpEnd() 
+       {return GrpIterator(*this,GrpP);};
 inline pkgCache::PkgIterator pkgCache::PkgBegin() 
        {return PkgIterator(*this);};
 inline pkgCache::PkgIterator pkgCache::PkgEnd() 
@@ -350,7 +363,7 @@ inline pkgCache::PkgFileIterator pkgCache::FileEnd()
 class pkgCache::Namespace                                              /*{{{*/
 {   
    public:
-
+   typedef pkgCache::GrpIterator GrpIterator;
    typedef pkgCache::PkgIterator PkgIterator;
    typedef pkgCache::VerIterator VerIterator;
    typedef pkgCache::DescIterator DescIterator;