summaryrefslogtreecommitdiff
path: root/apt-inst/database.h
diff options
context:
space:
mode:
authorArch Librarian <arch@canonical.com>2004-09-20 16:56:32 +0000
committerArch Librarian <arch@canonical.com>2004-09-20 16:56:32 +0000
commitb2e465d6d32d2dc884f58b94acb7e35f671a87fe (patch)
tree5928383b9bde7b0ba9812e6526ad746466e558f7 /apt-inst/database.h
parent00b47c98ca4a4349686a082eba6d77decbb03a4d (diff)
downloadapt-b2e465d6d32d2dc884f58b94acb7e35f671a87fe.tar.gz
Join with aliencode
Author: jgg Date: 2001-02-20 07:03:16 GMT Join with aliencode
Diffstat (limited to 'apt-inst/database.h')
-rw-r--r--apt-inst/database.h56
1 files changed, 56 insertions, 0 deletions
diff --git a/apt-inst/database.h b/apt-inst/database.h
new file mode 100644
index 000000000..0972d40cd
--- /dev/null
+++ b/apt-inst/database.h
@@ -0,0 +1,56 @@
+// -*- mode: cpp; mode: fold -*-
+// Description /*{{{*/
+// $Id: database.h,v 1.2 2001/02/20 07:03:16 jgg Exp $
+/* ######################################################################
+
+ Data Base Abstraction
+
+ This class provides a simple interface to an abstract notion of a
+ database directory for storing state information about the system.
+
+ The 'Meta' information for a package is the control information and
+ setup scripts stored inside the archive. GetMetaTmp returns the name of
+ a directory that is used to store named files containing the control
+ information.
+
+ The File Listing is the database of installed files. It is loaded
+ into the memory/persistent cache structure by the ReadFileList method.
+
+ ##################################################################### */
+ /*}}}*/
+#ifndef PKGLIB_DATABASE_H
+#define PKGLIB_DATABASE_H
+
+#ifdef __GNUG__
+#pragma interface "apt-pkg/database.h"
+#endif
+
+#include <apt-pkg/filelist.h>
+#include <apt-pkg/pkgcachegen.h>
+
+class pkgDataBase
+{
+ protected:
+
+ pkgCacheGenerator *Cache;
+ pkgFLCache *FList;
+ string MetaDir;
+ virtual bool InitMetaTmp(string &Dir) = 0;
+
+ public:
+
+ // Some manipulators for the cache and generator
+ inline pkgCache &GetCache() {return Cache->GetCache();};
+ inline pkgFLCache &GetFLCache() {return *FList;};
+ inline pkgCacheGenerator &GetGenerator() {return *Cache;};
+
+ bool GetMetaTmp(string &Dir);
+ virtual bool ReadyFileList(OpProgress &Progress) = 0;
+ virtual bool ReadyPkgCache(OpProgress &Progress) = 0;
+ virtual bool LoadChanges() = 0;
+
+ pkgDataBase() : Cache(0), FList(0) {};
+ virtual ~pkgDataBase() {delete Cache; delete FList;};
+};
+
+#endif