3 * Easy-to use interface to the ZYPP dependency resolver
5 * Author: Stefan Hundhammer <sh@suse.de>
9 #ifndef ZYPP_RESOLVERPROBLEM_H
10 #define ZYPP_RESOLVERPROBLEM_H
15 #include "zypp/ProblemTypes.h"
16 #include "zypp/ProblemSolution.h"
18 /////////////////////////////////////////////////////////////////////////
21 ///////////////////////////////////////////////////////////////////////
22 /// \class ResolverProblem
23 /// \brief Describe a solver problem and offer solutions.
24 ///////////////////////////////////////////////////////////////////////
25 class ResolverProblem : public base::ReferenceCounted
31 ResolverProblem( std::string description );
33 ResolverProblem( std::string description, std::string details );
40 * Return a one-line description of the problem.
42 const std::string & description() const;
45 * Return a (possibly muti-line) detailed description of the problem
46 * or an empty string if there are no useful details.
48 const std::string & details() const;
51 * Return the possible solutions to this problem.
52 * All problems should have at least 2-3 (mutually exclusive) solutions:
54 * - Undo: Do not perform the offending transaction
55 * (do not install the package that had unsatisfied requirements,
56 * do not remove the package that would break other packages' requirements)
58 * - Remove referrers: Remove all packages that would break because
59 * they depend on the package that is requested to be removed
61 * - Ignore: Inject artificial "provides" for a missing requirement
62 * (pretend that requirement is satisfied)
64 const ProblemSolutionList & solutions() const;
68 * Set description of the problem.
70 void setDescription( std::string description );
73 * Set detail description of the problem.
75 void setDetails( std::string details );
78 * Add a solution to this problem. This class takes over ownership of
79 * the problem and will delete it when neccessary.
81 void addSolution( ProblemSolution_Ptr solution, bool inFront = false );
85 RWCOW_pointer<Impl> _pimpl;
88 /** \relates ResolverProblem Stream output */
89 std::ostream & operator<<( std::ostream &, const ResolverProblem & obj );
91 /** \relates ResolverProblem Stream output */
92 std::ostream & operator<<( std::ostream &, const ResolverProblemList & obj );
96 /////////////////////////////////////////////////////////////////////////
97 #endif // ZYPP_RESOLVERPROBLEM_H