home *** CD-ROM | disk | FTP | other *** search
/ PC World 2000 February / PCWorld_2000-02_cd.bin / live / usr / include / apt-pkg / dpkgpm.h < prev    next >
Encoding:
C/C++ Source or Header  |  1999-06-21  |  1.2 KB  |  52 lines

  1. // -*- mode: cpp; mode: fold -*-
  2. // Description                                /*{{{*/
  3. // $Id: dpkgpm.h,v 1.3 1999/01/31 08:49:39 jgg Exp $
  4. /* ######################################################################
  5.  
  6.    DPKG Package Manager - Provide an interface to dpkg
  7.    
  8.    ##################################################################### */
  9.                                     /*}}}*/
  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>
  19.  
  20. class pkgDPkgPM : public pkgPackageManager
  21. {
  22.    protected:
  23.    
  24.    struct Item
  25.    {
  26.       enum Ops {Install, Configure, Remove} Op;
  27.       string File;
  28.       PkgIterator Pkg;
  29.       Item(Ops Op,PkgIterator Pkg,string File = "") : Op(Op), 
  30.             File(File), Pkg(Pkg) {};
  31.       Item() {};
  32.       
  33.    };
  34.    vector<Item> List;
  35.  
  36.    // Helpers
  37.    bool RunScripts(const char *Cnf);
  38.    
  39.    // The Actuall installation implementation
  40.    virtual bool Install(PkgIterator Pkg,string File);
  41.    virtual bool Configure(PkgIterator Pkg);
  42.    virtual bool Remove(PkgIterator Pkg);
  43.    virtual bool Go();
  44.    
  45.    public:
  46.  
  47.    pkgDPkgPM(pkgDepCache &Cache);
  48.    virtual ~pkgDPkgPM();
  49. };
  50.  
  51. #endif
  52.