libzypp 17.37.17
ProblemSolution.h
Go to the documentation of this file.
1
8
9#ifndef ZYPP_PROBLEMSOLUTION_H
10#define ZYPP_PROBLEMSOLUTION_H
11
12#include <set>
13#include <list>
14#include <string>
15#include <optional>
16
17#include <zypp/PoolItem.h>
18#include <zypp/ProblemTypes.h>
20
22namespace zypp
23{
41 {
42 public:
43 using SolutionAction_Ptr = solver::detail::SolutionAction_Ptr;
45
48
50 ProblemSolution( std::string description );
51
53 ProblemSolution( std::string description, std::string details );
54
56 ~ProblemSolution() override;
57
58
62 const std::string & description() const;
63
68 const std::string & details() const;
69
73 const SolutionActionList & actions() const;
74
78 void setDescription( std::string description );
79
83 void setDetails( const std::string& details );
84
88 void pushDescriptionDetail( std::string description, bool front = false );
89
90
94 void addAction( const SolutionAction_Ptr& action );
95
96 public:
98 bool skipsPatchesOnly() const;
99
100#ifdef __cpp_lib_optional // YAST/PK explicitly use c++11 until 15-SP3
102 std::optional<std::set<PoolItem>> getIfSkipsPatchesOnly() const;
103#endif
104
105 private:
106 struct Impl;
108 };
109
111 std::ostream& operator<<(std::ostream&, const ProblemSolution & obj ) ZYPP_API;
112
114 std::ostream& operator<<(std::ostream&, const ProblemSolutionList & obj ) ZYPP_API;
115
116} // namespace zypp
118#endif // ZYPP_PROBLEMSOLUTION_H
119
Class representing one possible solution to a problem found during resolving.
void setDescription(std::string description)
Set description of the solution.
void setDetails(const std::string &details)
Set detail description of the solution.
RWCOW_pointer< Impl > _pimpl
bool skipsPatchesOnly() const
The solution contains only 'do not install patch:' actions.
const std::string & description() const
Return a one-line text description of this solution.
solver::detail::SolutionAction_Ptr SolutionAction_Ptr
ProblemSolution()
Constructor.
const SolutionActionList & actions() const
Return the list of actions forming this solution.
solver::detail::SolutionActionList SolutionActionList
void pushDescriptionDetail(std::string description, bool front=false)
Collect multiple action descriptions in details (NL separated)
const std::string & details() const
Return a (possibly multi-line) detailed description of this solution or an empty string if there are ...
void addAction(const SolutionAction_Ptr &action)
Add an action to the actions list.
Base class for reference counted objects.
std::list< SolutionAction_Ptr > SolutionActionList
Definition Types.h:48
Easy-to use interface to the ZYPP dependency resolver.
std::list< ProblemSolution_Ptr > ProblemSolutionList
std::ostream & operator<<(std::ostream &str, const SerialNumber &obj)
const Arch Arch_armv7hnl Arch_armv7nhl ZYPP_API
Definition Arch.h:247
ProblemSolution implementation.
RW_pointer supporting 'copy on write' functionality.
Definition PtrTypes.h:469