]>
git.saurik.com Git - apt.git/blob - apt-pkg/cachefile.h
1 // -*- mode: cpp; mode: fold -*-
3 // $Id: cachefile.h,v 1.4 2001/02/20 07:03:17 jgg Exp $
4 /* ######################################################################
6 CacheFile - Simple wrapper class for opening, generating and whatnot
8 This class implements a simple 2 line mechanism to open various sorts
9 of caches. It can operate as root, as not root, show progress and so on,
10 it transparently handles everything necessary.
12 This means it can rebuild caches from the source list and instantiates
13 and prepares the standard policy mechanism.
15 ##################################################################### */
17 #ifndef PKGLIB_CACHEFILE_H
18 #define PKGLIB_CACHEFILE_H
21 #pragma interface "apt-pkg/cachefile.h"
24 #include <apt-pkg/depcache.h>
39 // We look pretty much exactly like a pointer to a dep cache
40 inline operator pkgCache
&() {return *Cache
;};
41 inline operator pkgCache
*() {return Cache
;};
42 inline operator pkgDepCache
&() {return *DCache
;};
43 inline operator pkgDepCache
*() {return DCache
;};
44 inline pkgDepCache
*operator ->() {return DCache
;};
45 inline pkgDepCache
&operator *() {return *DCache
;};
46 inline pkgDepCache::StateCache
&operator [](pkgCache::PkgIterator
const &I
) {return (*DCache
)[I
];};
47 inline unsigned char &operator [](pkgCache::DepIterator
const &I
) {return (*DCache
)[I
];};
49 bool Open(OpProgress
&Progress
,bool WithLock
= true);