]> git.saurik.com Git - apt.git/blobdiff - apt-pkg/pkgcachegen.h
fail installing build-deps if parsing them failed
[apt.git] / apt-pkg / pkgcachegen.h
index 97b91ba9ff1345468bb5d839c42c2ffd628832bc..ac5947c6a5257f6fc2a61abdaf7e7b56fe523a9e 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;
@@ -108,6 +113,8 @@ class APT_HIDDEN pkgCacheGenerator                                  /*{{{*/
 
    APT_PUBLIC static bool MakeStatusCache(pkgSourceList &List,OpProgress *Progress,
                        MMap **OutMap = 0,bool AllowMem = false);
+   APT_HIDDEN static bool MakeStatusCache(pkgSourceList &List,OpProgress *Progress,
+                       MMap **OutMap,pkgCache **OutCache, bool AllowMem = false);
    APT_PUBLIC static bool MakeOnlyStatusCache(OpProgress *Progress,DynamicMMap **OutMap);
 
    void ReMap(void const * const oldMap, void const * const newMap);
@@ -135,7 +142,6 @@ class APT_HIDDEN pkgCacheListParser
 {
    pkgCacheGenerator *Owner;
    friend class pkgCacheGenerator;
-   template<class T> using Dynamic = pkgCacheGenerator::Dynamic<T>;
 
    // Some cache items
    pkgCache::VerIterator OldDepVer;
@@ -192,8 +198,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