libzypp  17.31.31
SelFilters.h
Go to the documentation of this file.
1 /*---------------------------------------------------------------------\
2 | ____ _ __ __ ___ |
3 | |__ / \ / / . \ . \ |
4 | / / \ V /| _/ _/ |
5 | / /__ | | | | | | |
6 | /_____||_| |_| |_| |
7 | |
8 \---------------------------------------------------------------------*/
12 #ifndef ZYPP_UI_SELFILTERS_H
13 #define ZYPP_UI_SELFILTERS_H
14 
15 #include <string>
16 
17 #include <zypp/base/Functional.h>
18 #include <zypp/ui/Selectable.h>
19 
21 namespace zypp
22 {
23  namespace ui
25  {
26  namespace selfilter
28  {
29 
31  struct ByKind
32  {
33  ByKind( const ResKind & kind_r )
34  : _kind( kind_r )
35  {}
36 
37  bool operator()( const Selectable::constPtr & obj ) const
38  {
39  return obj && obj->kind() == _kind;
40  }
41 
43  };
44 
46  struct ByName
47  {
48  ByName( const std::string & name_r )
49  : _name( name_r )
50  {}
51 
52  bool operator()( const ui::Selectable::constPtr & obj ) const
53  { return obj && obj->name() == _name; }
54 
55  std::string _name;
56  };
57 
60  {
61  bool operator()( const ui::Selectable::constPtr & obj ) const
62  { return obj && !obj->installedEmpty(); }
63  };
64 
67  {
68  bool operator()( const ui::Selectable::constPtr & obj ) const
69  { return obj && obj->hasCandidateObj(); }
70  };
71 
72  struct ByStatus
74  {
75  ByStatus( Status status_r )
76  : _status( status_r )
77  {}
78 
79  bool operator()( const ui::Selectable::constPtr & obj ) const
80  { return obj && obj->status() == _status; }
81 
83  };
84 
86  } // namespace selfilter
89  } // namespace ui
92 } // namespace zypp
94 #endif // ZYPP_UI_SELFILTERS_H
Status
UI status Status values calculated by Selectable.
Definition: Status.h:34
bool operator()(const ui::Selectable::constPtr &obj) const
Definition: SelFilters.h:52
ByStatus(Status status_r)
Definition: SelFilters.h:75
ByName(const std::string &name_r)
Definition: SelFilters.h:48
bool operator()(const ui::Selectable::constPtr &obj) const
Definition: SelFilters.h:61
bool operator()(const Selectable::constPtr &obj) const
Definition: SelFilters.h:37
bool operator()(const ui::Selectable::constPtr &obj) const
Definition: SelFilters.h:68
intrusive_ptr< const Selectable > constPtr
Definition: Selectable.h:58
bool operator()(const ui::Selectable::constPtr &obj) const
Definition: SelFilters.h:79
ByKind(const ResKind &kind_r)
Definition: SelFilters.h:33
Resolvable kinds.
Definition: ResKind.h:32
Easy-to use interface to the ZYPP dependency resolver.
Definition: CodePitfalls.doc:1