]> git.saurik.com Git - apt.git/blobdiff - apt-pkg/pkgcachegen.h
aptconfiguration: Set default compression level to 6
[apt.git] / apt-pkg / pkgcachegen.h
index 15e73627d12d9bef62b23ea6167ae27646d58154..21a4a6a096dfa0b2bfb408bec9bd605cb3d8447e 100644 (file)
@@ -26,7 +26,9 @@
 
 #include <vector>
 #include <string>
-#include <map>
+#if __cplusplus >= 201103L
+#include <unordered_map>
+#endif
 
 class FileFd;
 class pkgSourceList;
@@ -41,10 +43,13 @@ class APT_HIDDEN pkgCacheGenerator                                  /*{{{*/
    APT_HIDDEN map_stringitem_t WriteStringInMap(const char *String, const unsigned long &Len);
    APT_HIDDEN map_pointer_t AllocateInMap(const unsigned long &size);
 
-   std::map<std::string,map_stringitem_t> strMixed;
-   std::map<std::string,map_stringitem_t> strSections;
-   std::map<std::string,map_stringitem_t> strPkgNames;
-   std::map<std::string,map_stringitem_t> strVersions;
+   // Dirty hack for public users that do not use C++11 yet
+#if __cplusplus >= 201103L
+   std::unordered_map<std::string,map_stringitem_t> strMixed;
+   std::unordered_map<std::string,map_stringitem_t> strSections;
+   std::unordered_map<std::string,map_stringitem_t> strPkgNames;
+   std::unordered_map<std::string,map_stringitem_t> strVersions;
+#endif
 
    friend class pkgCacheListParser;
    typedef pkgCacheListParser ListParser;
@@ -74,9 +79,6 @@ class APT_HIDDEN pkgCacheGenerator                                    /*{{{*/
    std::string PkgFileName;
    pkgCache::PackageFile *CurrentFile;
 
-   // Flag file dependencies
-   bool FoundFileDeps;
-
    bool NewGroup(pkgCache::GrpIterator &Grp,const std::string &Name);
    bool NewPackage(pkgCache::PkgIterator &Pkg,const std::string &Name, const std::string &Arch);
    bool NewFileVer(pkgCache::VerIterator &Ver,ListParser &List);
@@ -104,15 +106,11 @@ class APT_HIDDEN pkgCacheGenerator                                        /*{{{*/
    bool SelectReleaseFile(const std::string &File, const std::string &Site, unsigned long Flags = 0);
    bool MergeList(ListParser &List,pkgCache::VerIterator *Ver = 0);
    inline pkgCache &GetCache() {return Cache;};
-   inline pkgCache::PkgFileIterator GetCurFile() 
+   inline pkgCache::PkgFileIterator GetCurFile()
          {return pkgCache::PkgFileIterator(Cache,CurrentFile);};
-   inline pkgCache::RlsFileIterator GetCurRlsFile() 
+   inline pkgCache::RlsFileIterator GetCurRlsFile()
          {return pkgCache::RlsFileIterator(Cache,CurrentRlsFile);};
 
-   bool HasFileDeps() {return FoundFileDeps;};
-   bool MergeFileProvides(ListParser &List);
-   bool FinishCache(OpProgress *Progress) APT_DEPRECATED APT_CONST;
-
    APT_PUBLIC static bool MakeStatusCache(pkgSourceList &List,OpProgress *Progress,
                        MMap **OutMap = 0,bool AllowMem = false);
    APT_PUBLIC static bool MakeOnlyStatusCache(OpProgress *Progress,DynamicMMap **OutMap);
@@ -142,15 +140,11 @@ class APT_HIDDEN pkgCacheListParser
 {
    pkgCacheGenerator *Owner;
    friend class pkgCacheGenerator;
-   template<class T> using Dynamic = pkgCacheGenerator::Dynamic<T>;
 
    // Some cache items
    pkgCache::VerIterator OldDepVer;
    map_pointer_t *OldDepLast;
 
-   // Flag file dependencies
-   bool FoundFileDeps;
-
    void * const d;
 
    protected:
@@ -194,7 +188,6 @@ class APT_HIDDEN pkgCacheListParser
    
    virtual bool Step() = 0;
    
-   inline bool HasFileDeps() {return FoundFileDeps;};
    virtual bool CollectFileProvides(pkgCache &/*Cache*/,
                                    pkgCache::VerIterator &/*Ver*/) {return true;};
 
@@ -203,8 +196,8 @@ class APT_HIDDEN pkgCacheListParser
 };
                                                                        /*}}}*/
 
-bool pkgMakeStatusCache(pkgSourceList &List,OpProgress &Progress,
+APT_DEPRECATED_MSG("Use pkgCacheGenerator::MakeStatusCache instead") bool pkgMakeStatusCache(pkgSourceList &List,OpProgress &Progress,
                        MMap **OutMap = 0,bool AllowMem = false);
-bool pkgMakeOnlyStatusCache(OpProgress &Progress,DynamicMMap **OutMap);
+APT_DEPRECATED_MSG("Use pkgCacheGenerator::MakeOnlyStatusCache instead") bool pkgMakeOnlyStatusCache(OpProgress &Progress,DynamicMMap **OutMap);
 
 #endif