3 * Easy-to use interface to the ZYPP dependency resolver
5 * Author: Stefan Hundhammer <sh@suse.de>
9 #ifndef ZYPP_PROBLEMSOLUTION_H
10 #define ZYPP_PROBLEMSOLUTION_H
15 #include "zypp/ProblemTypes.h"
16 #include "zypp/ResolverProblem.h"
18 /////////////////////////////////////////////////////////////////////////
21 /////////////////////////////////////////////////////////////////////////
22 /// \class ProblemSolution
23 /// \brief Class representing one possible solution to a problem found during resolving
25 /// All problems should have at least 2-3 (mutually exclusive) solutions:
27 /// - Undo: Do not perform the offending transaction
28 /// (do not install the package that had unsatisfied requirements,
29 /// do not remove the package that would break other packages' requirements)
31 /// - Remove referrers: Remove all packages that would break because
32 /// they depend on the package that is requested to be removed
34 /// - Ignore: Inject artificial "provides" for a missing requirement
35 /// (pretend that requirement is satisfied)
36 /////////////////////////////////////////////////////////////////////////
37 class ProblemSolution : public base::ReferenceCounted
40 typedef solver::detail::SolutionAction_Ptr SolutionAction_Ptr;
41 typedef solver::detail::SolutionActionList SolutionActionList;
47 ProblemSolution( std::string description );
50 ProblemSolution( std::string description, std::string details );
53 virtual ~ProblemSolution();
57 * Return a one-line text description of this solution.
59 const std::string & description() const;
62 * Return a (possibly multi-line) detailed description of this
63 * solution or an empty string if there are no useful details.
65 const std::string & details() const;
68 * Return the list of actions forming this solution.
70 const SolutionActionList & actions() const;
73 * Set description of the solution.
75 void setDescription( std::string description );
78 * Set detail description of the solution.
80 void setDetails( std::string details );
83 * Collect multiple action descriptions in \ref details (NL separated)
85 void pushDescriptionDetail( std::string description, bool front = false );
89 * Add an action to the actions list.
91 void addAction( SolutionAction_Ptr action );
96 RWCOW_pointer<Impl> _pimpl;
99 /** \relates ProblemSolution Stream output */
100 std::ostream& operator<<(std::ostream&, const ProblemSolution & obj );
102 /** \relates ProblemSolution Stream output */
103 std::ostream& operator<<(std::ostream&, const ProblemSolutionList & obj );
106 /////////////////////////////////////////////////////////////////////////
107 #endif // ZYPP_PROBLEMSOLUTION_H