G++3 fixes from Randolph
[ntk/apt.git] / apt-pkg / deb / dpkgpm.h
CommitLineData
03e39e59
AL
1// -*- mode: cpp; mode: fold -*-
2// Description /*{{{*/
233b185f 3// $Id: dpkgpm.h,v 1.8 2001/05/07 05:05:13 jgg Exp $
03e39e59
AL
4/* ######################################################################
5
6 DPKG Package Manager - Provide an interface to dpkg
7
8 ##################################################################### */
9 /*}}}*/
03e39e59
AL
10#ifndef PKGLIB_DPKGPM_H
11#define PKGLIB_DPKGPM_H
12
13#ifdef __GNUG__
14#pragma interface "apt-pkg/dpkgpm.h"
15#endif
16
17#include <apt-pkg/packagemanager.h>
18#include <vector>
b2e465d6 19#include <stdio.h>
03e39e59 20
233b185f
AL
21using std::vector;
22
03e39e59
AL
23class pkgDPkgPM : public pkgPackageManager
24{
25 protected:
26
27 struct Item
28 {
fc4b5c9f 29 enum Ops {Install, Configure, Remove, Purge} Op;
03e39e59
AL
30 string File;
31 PkgIterator Pkg;
b2e465d6 32 Item(Ops Op,PkgIterator Pkg,string File = "") : Op(Op),
03e39e59
AL
33 File(File), Pkg(Pkg) {};
34 Item() {};
35
36 };
37 vector<Item> List;
6dd55be7
AL
38
39 // Helpers
40 bool RunScripts(const char *Cnf);
db0c350f 41 bool RunScriptsWithPkgs(const char *Cnf);
b2e465d6 42 bool SendV2Pkgs(FILE *F);
6dd55be7 43
03e39e59
AL
44 // The Actuall installation implementation
45 virtual bool Install(PkgIterator Pkg,string File);
46 virtual bool Configure(PkgIterator Pkg);
fc4b5c9f 47 virtual bool Remove(PkgIterator Pkg,bool Purge = false);
03e39e59 48 virtual bool Go();
281daf46 49 virtual void Reset();
03e39e59
AL
50
51 public:
52
b2e465d6 53 pkgDPkgPM(pkgDepCache *Cache);
03e39e59
AL
54 virtual ~pkgDPkgPM();
55};
56
57#endif