apt @VERSION@
edsp.h
Go to the documentation of this file.
00001 // -*- mode: cpp; mode: fold -*-
00008                                                                         /*}}}*/
00009 #ifndef PKGLIB_EDSP_H
00010 #define PKGLIB_EDSP_H
00011 
00012 #include <apt-pkg/pkgcache.h>
00013 
00014 #include <list>
00015 #include <string>
00016 
00017 namespace APT {
00018         class PackageSet;
00019 };
00020 class pkgDepCache;
00021 class OpProgress;
00022 
00023 class EDSP                                                              /*{{{*/
00024 {
00025         // we could use pkgCache::DepType and ::Priority, but these would be localized strings…
00026         static const char * const PrioMap[];
00027         static const char * const DepMap[];
00028 
00029         bool static ReadLine(int const input, std::string &line);
00030         bool static StringToBool(char const *answer, bool const defValue);
00031 
00032         void static WriteScenarioVersion(pkgDepCache &Cache, FILE* output,
00033                                          pkgCache::PkgIterator const &Pkg,
00034                                          pkgCache::VerIterator const &Ver);
00035         void static WriteScenarioDependency(pkgDepCache &Cache, FILE* output,
00036                                             pkgCache::PkgIterator const &Pkg,
00037                                             pkgCache::VerIterator const &Ver);
00038         void static WriteScenarioLimitedDependency(pkgDepCache &Cache, FILE* output,
00039                                                    pkgCache::PkgIterator const &Pkg,
00040                                                    pkgCache::VerIterator const &Ver,
00041                                                    APT::PackageSet const &pkgset);
00042 public:
00059         bool static WriteRequest(pkgDepCache &Cache, FILE* output,
00060                                  bool const upgrade = false,
00061                                  bool const distUpgrade = false,
00062                                  bool const autoRemove = false,
00063                                 OpProgress *Progress = NULL);
00064 
00082         bool static WriteScenario(pkgDepCache &Cache, FILE* output, OpProgress *Progress = NULL);
00083 
00099         bool static WriteLimitedScenario(pkgDepCache &Cache, FILE* output,
00100                                          APT::PackageSet const &pkgset,
00101                                          OpProgress *Progress = NULL);
00102 
00116         bool static ReadResponse(int const input, pkgDepCache &Cache, OpProgress *Progress = NULL);
00117 
00134         bool static ReadRequest(int const input, std::list<std::string> &install,
00135                         std::list<std::string> &remove, bool &upgrade,
00136                         bool &distUpgrade, bool &autoRemove);
00137 
00150         bool static ApplyRequest(std::list<std::string> const &install,
00151                                  std::list<std::string> const &remove,
00152                                  pkgDepCache &Cache);
00153 
00166         bool static WriteSolution(pkgDepCache &Cache, FILE* output);
00167 
00174         bool static WriteProgress(unsigned short const percent, const char* const message, FILE* output);
00175 
00191         bool static WriteError(char const * const uuid, std::string const &message, FILE* output);
00192 
00193 
00206         bool static ExecuteSolver(const char* const solver, int *solver_in, int *solver_out);
00207 
00222         bool static ResolveExternal(const char* const solver, pkgDepCache &Cache,
00223                                     bool const upgrade, bool const distUpgrade,
00224                                     bool const autoRemove, OpProgress *Progress = NULL);
00225 };
00226                                                                         /*}}}*/
00227 #endif