]>
git.saurik.com Git - apt.git/blob - apt-inst/database.h
1 // -*- mode: cpp; mode: fold -*-
3 // $Id: database.h,v 1.2 2001/02/20 07:03:16 jgg Exp $
4 /* ######################################################################
8 This class provides a simple interface to an abstract notion of a
9 database directory for storing state information about the system.
11 The 'Meta' information for a package is the control information and
12 setup scripts stored inside the archive. GetMetaTmp returns the name of
13 a directory that is used to store named files containing the control
16 The File Listing is the database of installed files. It is loaded
17 into the memory/persistent cache structure by the ReadFileList method.
19 ##################################################################### */
21 #ifndef PKGLIB_DATABASE_H
22 #define PKGLIB_DATABASE_H
24 #include <apt-pkg/filelist.h>
25 #include <apt-pkg/pkgcachegen.h>
31 pkgCacheGenerator
*Cache
;
34 virtual bool InitMetaTmp(string
&Dir
) = 0;
38 // Some manipulators for the cache and generator
39 inline pkgCache
&GetCache() {return Cache
->GetCache();};
40 inline pkgFLCache
&GetFLCache() {return *FList
;};
41 inline pkgCacheGenerator
&GetGenerator() {return *Cache
;};
43 bool GetMetaTmp(string
&Dir
);
44 virtual bool ReadyFileList(OpProgress
&Progress
) = 0;
45 virtual bool ReadyPkgCache(OpProgress
&Progress
) = 0;
46 virtual bool LoadChanges() = 0;
48 pkgDataBase() : Cache(0), FList(0) {};
49 virtual ~pkgDataBase() {delete Cache
; delete FList
;};