]>
git.saurik.com Git - apt.git/blob - apt-pkg/cachefile.h
1 // -*- mode: cpp; mode: fold -*-
3 // $Id: cachefile.h,v 1.3 1999/06/27 03:18:28 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 ##################################################################### */
14 #ifndef PKGLIB_CACHEFILE_H
15 #define PKGLIB_CACHEFILE_H
18 #pragma interface "apt-pkg/cachefile.h"
21 #include <apt-pkg/depcache.h>
22 #include <apt-pkg/dpkginit.h>
34 // We look pretty much exactly like a pointer to a dep cache
35 inline operator pkgDepCache
&() {return *Cache
;};
36 inline operator pkgDepCache
*() {return Cache
;};
37 inline pkgDepCache
*operator ->() {return Cache
;};
38 inline pkgDepCache
&operator *() {return *Cache
;};
39 inline pkgDepCache::StateCache
&operator [](pkgCache::PkgIterator
const &I
) {return (*Cache
)[I
];};
40 inline unsigned char &operator [](pkgCache::DepIterator
const &I
) {return (*Cache
)[I
];};
42 // Release the dpkg status lock
43 inline void ReleaseLock() {Lock
->Close();};
45 bool Open(OpProgress
&Progress
,bool WithLock
= true);