]>
Commit | Line | Data |
---|---|---|
b2e465d6 AL |
1 | // -*- mode: cpp; mode: fold -*- |
2 | // Description /*{{{*/ | |
3 | // $Id: database.h,v 1.2 2001/02/20 07:03:16 jgg Exp $ | |
4 | /* ###################################################################### | |
5 | ||
6 | Data Base Abstraction | |
7 | ||
8 | This class provides a simple interface to an abstract notion of a | |
9 | database directory for storing state information about the system. | |
10 | ||
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 | |
14 | information. | |
15 | ||
16 | The File Listing is the database of installed files. It is loaded | |
17 | into the memory/persistent cache structure by the ReadFileList method. | |
18 | ||
19 | ##################################################################### */ | |
20 | /*}}}*/ | |
21 | #ifndef PKGLIB_DATABASE_H | |
22 | #define PKGLIB_DATABASE_H | |
23 | ||
24 | #ifdef __GNUG__ | |
b2e465d6 AL |
25 | #endif |
26 | ||
27 | #include <apt-pkg/filelist.h> | |
28 | #include <apt-pkg/pkgcachegen.h> | |
29 | ||
30 | class pkgDataBase | |
31 | { | |
32 | protected: | |
33 | ||
34 | pkgCacheGenerator *Cache; | |
35 | pkgFLCache *FList; | |
36 | string MetaDir; | |
37 | virtual bool InitMetaTmp(string &Dir) = 0; | |
38 | ||
39 | public: | |
40 | ||
41 | // Some manipulators for the cache and generator | |
42 | inline pkgCache &GetCache() {return Cache->GetCache();}; | |
43 | inline pkgFLCache &GetFLCache() {return *FList;}; | |
44 | inline pkgCacheGenerator &GetGenerator() {return *Cache;}; | |
45 | ||
46 | bool GetMetaTmp(string &Dir); | |
47 | virtual bool ReadyFileList(OpProgress &Progress) = 0; | |
48 | virtual bool ReadyPkgCache(OpProgress &Progress) = 0; | |
49 | virtual bool LoadChanges() = 0; | |
50 | ||
51 | pkgDataBase() : Cache(0), FList(0) {}; | |
52 | virtual ~pkgDataBase() {delete Cache; delete FList;}; | |
53 | }; | |
54 | ||
55 | #endif |