#include <apt-pkg/pkgcache.h>
#include <apt-pkg/md5.h>
+#include <vector>
+
class pkgSourceList;
class OpProgress;
class MMap;
private:
pkgCache::StringItem *UniqHash[26];
- unsigned long WriteStringInMap(std::string const &String) { return WriteStringInMap(String.c_str()); };
- unsigned long WriteStringInMap(const char *String);
- unsigned long WriteStringInMap(const char *String, const unsigned long &Len);
- unsigned long AllocateInMap(const unsigned long &size);
+ map_ptrloc WriteStringInMap(std::string const &String) { return WriteStringInMap(String.c_str()); };
+ map_ptrloc WriteStringInMap(const char *String);
+ map_ptrloc WriteStringInMap(const char *String, const unsigned long &Len);
+ map_ptrloc AllocateInMap(const unsigned long &size);
public:
class ListParser;
friend class ListParser;
-
+
+ template<typename Iter> class Dynamic {
+ public:
+ static std::vector<Iter*> toReMap;
+ Dynamic(Iter &I) {
+ toReMap.push_back(&I);
+ }
+
+ ~Dynamic() {
+ toReMap.pop_back();
+ }
+ };
+
protected:
-
+
DynamicMMap ⤅
pkgCache Cache;
OpProgress *Progress;
static bool MakeStatusCache(pkgSourceList &List,OpProgress *Progress,
MMap **OutMap = 0,bool AllowMem = false);
static bool MakeOnlyStatusCache(OpProgress *Progress,DynamicMMap **OutMap);
+ static DynamicMMap* CreateDynamicMMap(FileFd *CacheF, unsigned long Flags = 0);
+
+ void ReMap(void const * const oldMap, void const * const newMap);
pkgCacheGenerator(DynamicMMap *Map,OpProgress *Progress);
~pkgCacheGenerator();