]> git.saurik.com Git - apt.git/blobdiff - apt-pkg/pkgrecords.cc
sync with mvo
[apt.git] / apt-pkg / pkgrecords.cc
index 1d71d3e2fb67af1085ea441ae64e2d75d8d3d39a..0aaa2096a16df72d0a0395e89b82c0bc2b0e0cee 100644 (file)
@@ -9,9 +9,6 @@
    ##################################################################### */
                                                                        /*}}}*/
 // Include Files                                                       /*{{{*/
-#ifdef __GNUG__
-#pragma implementation "apt-pkg/pkgrecords.h"
-#endif
 #include <apt-pkg/pkgrecords.h>
 #include <apt-pkg/indexfile.h>
 #include <apt-pkg/error.h>
@@ -42,9 +39,6 @@ pkgRecords::pkgRecords(pkgCache &Cache) : Cache(Cache), Files(0)
       if (Files[I->ID] == 0)
         return;
    }   
-   // We store that to make sure that the destructor won't segfault,
-   // even if the Cache object was destructed before this instance.
-   PackageFileCount = Cache.HeaderP->PackageFileCount;
 }
                                                                        /*}}}*/
 // Records::~pkgRecords - Destructor                                   /*{{{*/
@@ -52,7 +46,7 @@ pkgRecords::pkgRecords(pkgCache &Cache) : Cache(Cache), Files(0)
 /* */
 pkgRecords::~pkgRecords()
 {
-   for (unsigned I = 0; I != PackageFileCount; I++)
+   for (unsigned I = 0; I != Cache.HeaderP->PackageFileCount; I++)
       delete Files[I];
    delete [] Files;
 }
@@ -66,3 +60,12 @@ pkgRecords::Parser &pkgRecords::Lookup(pkgCache::VerFileIterator const &Ver)
    return *Files[Ver.File()->ID];
 }
                                                                        /*}}}*/
+// Records::Lookup - Get a parser for the package description file     /*{{{*/
+// ---------------------------------------------------------------------
+/* */
+pkgRecords::Parser &pkgRecords::Lookup(pkgCache::DescFileIterator const &Desc)
+{
+   Files[Desc.File()->ID]->Jump(Desc);
+   return *Files[Desc.File()->ID];
+}
+                                                                       /*}}}*/