edsp.h 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  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. #include <apt-pkg/depcache.h>
  10. #include <string>
  11. class EDSP /*{{{*/
  12. {
  13. bool static ReadLine(int const input, std::string &line);
  14. bool static StringToBool(char const *answer, bool const defValue);
  15. public:
  16. bool static WriteRequest(pkgDepCache &Cache, FILE* output,
  17. bool const upgrade = false,
  18. bool const distUpgrade = false,
  19. bool const autoRemove = false);
  20. bool static WriteScenario(pkgDepCache &Cache, FILE* output);
  21. bool static ReadResponse(FILE* input, pkgDepCache &Cache);
  22. // ReadScenario is provided by the listparser infrastructure
  23. bool static ReadRequest(int const input, std::list<std::string> &install,
  24. std::list<std::string> &remove, bool &upgrade,
  25. bool &distUpgrade, bool &autoRemove);
  26. bool static ApplyRequest(std::list<std::string> const &install,
  27. std::list<std::string> const &remove,
  28. pkgDepCache &Cache);
  29. bool static WriteSolution(pkgDepCache &Cache, FILE* output);
  30. bool static WriteError(std::string const &message, FILE* output);
  31. };
  32. /*}}}*/
  33. #endif