send the scenario through a pipe to the solver and get the solution back
[ntk/apt.git] / apt-pkg / edsp.h
1 // -*- mode: cpp; mode: fold -*-
2 // Description /*{{{*/
3 /* ######################################################################
4 Set of methods to help writing and reading everything needed for EDSP
5 ##################################################################### */
6 /*}}}*/
7 #ifndef PKGLIB_EDSP_H
8 #define PKGLIB_EDSP_H
9
10 #include <apt-pkg/depcache.h>
11
12 #include <string>
13
14 class EDSP /*{{{*/
15 {
16 bool static ReadLine(int const input, std::string &line);
17 bool static StringToBool(char const *answer, bool const defValue);
18
19 public:
20 bool static WriteRequest(pkgDepCache &Cache, FILE* output,
21 bool const upgrade = false,
22 bool const distUpgrade = false,
23 bool const autoRemove = false);
24 bool static WriteScenario(pkgDepCache &Cache, FILE* output);
25 bool static ReadResponse(int const input, pkgDepCache &Cache);
26
27 // ReadScenario is provided by the listparser infrastructure
28 bool static ReadRequest(int const input, std::list<std::string> &install,
29 std::list<std::string> &remove, bool &upgrade,
30 bool &distUpgrade, bool &autoRemove);
31 bool static ApplyRequest(std::list<std::string> const &install,
32 std::list<std::string> const &remove,
33 pkgDepCache &Cache);
34 bool static WriteSolution(pkgDepCache &Cache, FILE* output);
35 bool static WriteError(std::string const &message, FILE* output);
36
37 };
38 /*}}}*/
39 #endif