X-Git-Url: https://git.saurik.com/apt.git/blobdiff_plain/3f8621c5effb167a51944b86334867e2fe8fedb3..afd7b358f94efddb83a2911ec1a21e7280074b1e:/apt-pkg/cachefile.h?ds=sidebyside diff --git a/apt-pkg/cachefile.h b/apt-pkg/cachefile.h index 1647aff8e..243061f0f 100644 --- a/apt-pkg/cachefile.h +++ b/apt-pkg/cachefile.h @@ -20,21 +20,23 @@ #include #include +#include #include -class pkgPolicy; -class pkgSourceList; class pkgCacheFile { + /** \brief dpointer placeholder (for later in case we need it) */ + void *d; + protected: MMap *Map; pkgCache *Cache; pkgDepCache *DCache; - pkgPolicy *Policy; pkgSourceList *SrcList; public: + pkgPolicy *Policy; // We look pretty much exactly like a pointer to a dep cache inline operator pkgCache &() {return *Cache;}; @@ -58,6 +60,7 @@ class pkgCacheFile bool Open(OpProgress *Progress = NULL, bool WithLock = true); inline bool ReadOnlyOpen(OpProgress *Progress = NULL) { return Open(Progress, false); }; __deprecated bool Open(OpProgress &Progress,bool const &WithLock = true) { return Open(&Progress, WithLock); }; + static void RemoveCaches(); void Close(); inline pkgCache* GetPkgCache() { BuildCaches(NULL, false); return Cache; }; @@ -65,6 +68,11 @@ class pkgCacheFile inline pkgPolicy* GetPolicy() { BuildPolicy(); return Policy; }; inline pkgSourceList* GetSourceList() { BuildSourceList(); return SrcList; }; + inline bool IsPkgCacheBuilt() const { return (Cache != NULL); }; + inline bool IsDepCacheBuilt() const { return (DCache != NULL); }; + inline bool IsPolicyBuilt() const { return (Policy != NULL); }; + inline bool IsSrcListBuilt() const { return (SrcList != NULL); }; + pkgCacheFile(); virtual ~pkgCacheFile(); };