apt  0.9.14
edsp.h
Go to the documentation of this file.
1 // -*- mode: cpp; mode: fold -*-
8  /*}}}*/
9 #ifndef PKGLIB_EDSP_H
10 #define PKGLIB_EDSP_H
11 
12 #include <apt-pkg/pkgcache.h>
13 #include <apt-pkg/cacheset.h>
14 
15 #include <list>
16 #include <string>
17 
18 #ifndef APT_8_CLEANER_HEADERS
19 #include <apt-pkg/depcache.h>
20 #include <apt-pkg/progress.h>
21 #endif
22 
23 class pkgDepCache;
24 class OpProgress;
25 
26 class EDSP /*{{{*/
27 {
28  // we could use pkgCache::DepType and ::Priority, but these would be localized strings…
29  static const char * const PrioMap[];
30  static const char * const DepMap[];
31 
32  bool static ReadLine(int const input, std::string &line);
33  bool static StringToBool(char const *answer, bool const defValue);
34 
35  void static WriteScenarioVersion(pkgDepCache &Cache, FILE* output,
36  pkgCache::PkgIterator const &Pkg,
37  pkgCache::VerIterator const &Ver);
38  void static WriteScenarioDependency(pkgDepCache &Cache, FILE* output,
39  pkgCache::PkgIterator const &Pkg,
40  pkgCache::VerIterator const &Ver);
41  void static WriteScenarioLimitedDependency(pkgDepCache &Cache, FILE* output,
42  pkgCache::PkgIterator const &Pkg,
43  pkgCache::VerIterator const &Ver,
44  APT::PackageSet const &pkgset);
45 public:
62  bool static WriteRequest(pkgDepCache &Cache, FILE* output,
63  bool const upgrade = false,
64  bool const distUpgrade = false,
65  bool const autoRemove = false,
66  OpProgress *Progress = NULL);
67 
85  bool static WriteScenario(pkgDepCache &Cache, FILE* output, OpProgress *Progress = NULL);
86 
102  bool static WriteLimitedScenario(pkgDepCache &Cache, FILE* output,
103  APT::PackageSet const &pkgset,
104  OpProgress *Progress = NULL);
105 
119  bool static ReadResponse(int const input, pkgDepCache &Cache, OpProgress *Progress = NULL);
120 
137  bool static ReadRequest(int const input, std::list<std::string> &install,
138  std::list<std::string> &remove, bool &upgrade,
139  bool &distUpgrade, bool &autoRemove);
140 
153  bool static ApplyRequest(std::list<std::string> const &install,
154  std::list<std::string> const &remove,
155  pkgDepCache &Cache);
156 
169  bool static WriteSolution(pkgDepCache &Cache, FILE* output);
170 
177  bool static WriteProgress(unsigned short const percent, const char* const message, FILE* output);
178 
194  bool static WriteError(char const * const uuid, std::string const &message, FILE* output);
195 
196 
209  bool static ExecuteSolver(const char* const solver, int *solver_in, int *solver_out);
210 
225  bool static ResolveExternal(const char* const solver, pkgDepCache &Cache,
226  bool const upgrade, bool const distUpgrade,
227  bool const autoRemove, OpProgress *Progress = NULL);
228 };
229  /*}}}*/
230 #endif
Definition: cacheiterators.h:136
static bool ApplyRequest(std::list< std::string > const &install, std::list< std::string > const &remove, pkgDepCache &Cache)
takes the request lists and applies it on the cache
Definition: edsp.cc:431
static bool WriteError(char const *const uuid, std::string const &message, FILE *output)
sends an error report
Definition: edsp.cc:497
static bool ResolveExternal(const char *const solver, pkgDepCache &Cache, bool const upgrade, bool const distUpgrade, bool const autoRemove, OpProgress *Progress=NULL)
call an external resolver to handle the request
Definition: edsp.cc:544
static bool WriteProgress(unsigned short const percent, const char *const message, FILE *output)
sends a progress report
Definition: edsp.cc:488
Definition: edsp.h:26
pkgCache - Structure definitions for the cache file
static bool ExecuteSolver(const char *const solver, int *solver_in, int *solver_out)
executes the given solver and returns the pipe ends
Definition: edsp.cc:504
Definition: progress.h:33
Definition: cacheiterators.h:185
static bool ReadResponse(int const input, pkgDepCache &Cache, OpProgress *Progress=NULL)
waits and acts on the information returned from the solver
Definition: edsp.cc:250
static bool WriteRequest(pkgDepCache &Cache, FILE *output, bool const upgrade=false, bool const distUpgrade=false, bool const autoRemove=false, OpProgress *Progress=NULL)
creates the EDSP request stanza
Definition: edsp.cc:204
Definition: cacheset.h:159
static bool WriteSolution(pkgDepCache &Cache, FILE *output)
encodes the changes in the Cache as a EDSP solution
Definition: edsp.cc:456
static bool WriteLimitedScenario(pkgDepCache &Cache, FILE *output, APT::PackageSet const &pkgset, OpProgress *Progress=NULL)
creates a limited scenario representing the package universe
Definition: edsp.cc:56
Definition: depcache.h:56
static bool ReadRequest(int const input, std::list< std::string > &install, std::list< std::string > &remove, bool &upgrade, bool &distUpgrade, bool &autoRemove)
search and read the request stanza for action later
Definition: edsp.cc:365
static bool WriteScenario(pkgDepCache &Cache, FILE *output, OpProgress *Progress=NULL)
creates the scenario representing the package universe
Definition: edsp.cc:38