]> git.saurik.com Git - apt.git/blame - apt-inst/database.h
merged from debian-experimental2
[apt.git] / apt-inst / database.h
CommitLineData
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
b2e465d6
AL
24#include <apt-pkg/pkgcachegen.h>
25
472ff00e
DK
26#include <string>
27
b9dadc24
DK
28#ifndef APT_8_CLEANER_HEADERS
29#include <apt-pkg/filelist.h>
30#endif
31
472ff00e
DK
32class pkgFLCache;
33class OpProgress;
34
b2e465d6
AL
35class pkgDataBase
36{
37 protected:
38
39 pkgCacheGenerator *Cache;
40 pkgFLCache *FList;
8f3ba4e8
DK
41 std::string MetaDir;
42 virtual bool InitMetaTmp(std::string &Dir) = 0;
b2e465d6
AL
43
44 public:
45
46 // Some manipulators for the cache and generator
47 inline pkgCache &GetCache() {return Cache->GetCache();};
48 inline pkgFLCache &GetFLCache() {return *FList;};
49 inline pkgCacheGenerator &GetGenerator() {return *Cache;};
50
8f3ba4e8 51 bool GetMetaTmp(std::string &Dir);
b2e465d6
AL
52 virtual bool ReadyFileList(OpProgress &Progress) = 0;
53 virtual bool ReadyPkgCache(OpProgress &Progress) = 0;
54 virtual bool LoadChanges() = 0;
55
56 pkgDataBase() : Cache(0), FList(0) {};
472ff00e 57 virtual ~pkgDataBase();
b2e465d6
AL
58};
59
60#endif