17 #ifndef PKGLIB_CACHEFILE_H
18 #define PKGLIB_CACHEFILE_H
20 #include <apt-pkg/depcache.h>
21 #include <apt-pkg/macros.h>
23 #ifndef APT_8_CLEANER_HEADERS
25 #include <apt-pkg/policy.h>
26 #include <apt-pkg/sourcelist.h>
49 inline operator pkgCache &() {
return *Cache;};
50 inline operator pkgCache *() {
return Cache;};
53 inline operator pkgPolicy &() {
return *Policy;};
54 inline operator pkgPolicy *() {
return Policy;};
62 bool BuildCaches(
OpProgress *Progress = NULL,
bool WithLock =
true);
63 __deprecated
bool BuildCaches(
OpProgress &Progress,
bool const &WithLock =
true) {
return BuildCaches(&Progress, WithLock); };
64 bool BuildSourceList(
OpProgress *Progress = NULL);
66 bool BuildDepCache(
OpProgress *Progress = NULL);
67 bool Open(
OpProgress *Progress = NULL,
bool WithLock =
true);
68 inline bool ReadOnlyOpen(
OpProgress *Progress = NULL) {
return Open(Progress,
false); };
69 __deprecated
bool Open(
OpProgress &Progress,
bool const &WithLock =
true) {
return Open(&Progress, WithLock); };
70 static void RemoveCaches();
73 inline pkgCache* GetPkgCache() { BuildCaches(NULL,
false);
return Cache; };
74 inline pkgDepCache* GetDepCache() { BuildDepCache();
return DCache; };
75 inline pkgPolicy* GetPolicy() { BuildPolicy();
return Policy; };
76 inline pkgSourceList* GetSourceList() { BuildSourceList();
return SrcList; };
78 inline bool IsPkgCacheBuilt()
const {
return (Cache != NULL); };
79 inline bool IsDepCacheBuilt()
const {
return (DCache != NULL); };
80 inline bool IsPolicyBuilt()
const {
return (Policy != NULL); };
81 inline bool IsSrcListBuilt()
const {
return (SrcList != NULL); };