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/depcache.h>
00013 #include <apt-pkg/cacheset.h>
00014 #include <apt-pkg/progress.h>
00015 
00016 #include <string>
00017 
00018 class EDSP                                                              /*{{{*/
00019 {
00020         // we could use pkgCache::DepType and ::Priority, but these would be localized strings…
00021         static const char * const PrioMap[];
00022         static const char * const DepMap[];
00023 
00024         bool static ReadLine(int const input, std::string &line);
00025         bool static StringToBool(char const *answer, bool const defValue);
00026 
00027         void static WriteScenarioVersion(pkgDepCache &Cache, FILE* output,
00028                                          pkgCache::PkgIterator const &Pkg,
00029                                          pkgCache::VerIterator const &Ver);
00030         void static WriteScenarioDependency(pkgDepCache &Cache, FILE* output,
00031                                             pkgCache::PkgIterator const &Pkg,
00032                                             pkgCache::VerIterator const &Ver);
00033         void static WriteScenarioLimitedDependency(pkgDepCache &Cache, FILE* output,
00034                                                    pkgCache::PkgIterator const &Pkg,
00035                                                    pkgCache::VerIterator const &Ver,
00036                                                    APT::PackageSet const &pkgset);
00037 public:
00054         bool static WriteRequest(pkgDepCache &Cache, FILE* output,
00055                                  bool const upgrade = false,
00056                                  bool const distUpgrade = false,
00057                                  bool const autoRemove = false,
00058                                 OpProgress *Progress = NULL);
00059 
00077         bool static WriteScenario(pkgDepCache &Cache, FILE* output, OpProgress *Progress = NULL);
00078 
00094         bool static WriteLimitedScenario(pkgDepCache &Cache, FILE* output,
00095                                          APT::PackageSet const &pkgset,
00096                                          OpProgress *Progress = NULL);
00097 
00111         bool static ReadResponse(int const input, pkgDepCache &Cache, OpProgress *Progress = NULL);
00112 
00129         bool static ReadRequest(int const input, std::list<std::string> &install,
00130                         std::list<std::string> &remove, bool &upgrade,
00131                         bool &distUpgrade, bool &autoRemove);
00132 
00145         bool static ApplyRequest(std::list<std::string> const &install,
00146                                  std::list<std::string> const &remove,
00147                                  pkgDepCache &Cache);
00148 
00161         bool static WriteSolution(pkgDepCache &Cache, FILE* output);
00162 
00169         bool static WriteProgress(unsigned short const percent, const char* const message, FILE* output);
00170 
00186         bool static WriteError(char const * const uuid, std::string const &message, FILE* output);
00187 
00188 
00201         bool static ExecuteSolver(const char* const solver, int *solver_in, int *solver_out);
00202 
00217         bool static ResolveExternal(const char* const solver, pkgDepCache &Cache,
00218                                     bool const upgrade, bool const distUpgrade,
00219                                     bool const autoRemove, OpProgress *Progress = NULL);
00220 };
00221                                                                         /*}}}*/
00222 #endif