dpkgpm.h 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. // -*- mode: cpp; mode: fold -*-
  2. // Description /*{{{*/
  3. // $Id: dpkgpm.h,v 1.5 1999/07/09 04:11:34 jgg Exp $
  4. /* ######################################################################
  5. DPKG Package Manager - Provide an interface to dpkg
  6. ##################################################################### */
  7. /*}}}*/
  8. #ifndef PKGLIB_DPKGPM_H
  9. #define PKGLIB_DPKGPM_H
  10. #ifdef __GNUG__
  11. #pragma interface "apt-pkg/dpkgpm.h"
  12. #endif
  13. #include <apt-pkg/packagemanager.h>
  14. #include <vector>
  15. class pkgDPkgPM : public pkgPackageManager
  16. {
  17. protected:
  18. struct Item
  19. {
  20. enum Ops {Install, Configure, Remove, Purge} Op;
  21. string File;
  22. PkgIterator Pkg;
  23. Item(Ops Op,PkgIterator Pkg,string File = "") : Op(Op),
  24. File(File), Pkg(Pkg) {};
  25. Item() {};
  26. };
  27. vector<Item> List;
  28. // Helpers
  29. bool RunScripts(const char *Cnf);
  30. // The Actuall installation implementation
  31. virtual bool Install(PkgIterator Pkg,string File);
  32. virtual bool Configure(PkgIterator Pkg);
  33. virtual bool Remove(PkgIterator Pkg,bool Purge = false);
  34. virtual bool Go();
  35. virtual void Reset();
  36. public:
  37. pkgDPkgPM(pkgDepCache &Cache);
  38. virtual ~pkgDPkgPM();
  39. };
  40. #endif