libzypp  17.35.19
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 #include <utility>
17 
18 #include <zypp/base/Functional.h>
19 #include <zypp/ui/Selectable.h>
20 
22 namespace zypp
23 {
24  namespace ui
26  {
27  namespace selfilter
29  {
30 
32  struct ByKind
33  {
34  ByKind( ResKind kind_r )
35  : _kind(std::move( kind_r ))
36  {}
37 
38  bool operator()( const Selectable::constPtr & obj ) const
39  {
40  return obj && obj->kind() == _kind;
41  }
42 
44  };
45 
47  struct ByName
48  {
49  ByName( std::string name_r )
50  : _name(std::move( name_r ))
51  {}
52 
53  bool operator()( const ui::Selectable::constPtr & obj ) const
54  { return obj && obj->name() == _name; }
55 
56  std::string _name;
57  };
58 
61  {
62  bool operator()( const ui::Selectable::constPtr & obj ) const
63  { return obj && !obj->installedEmpty(); }
64  };
65 
68  {
69  bool operator()( const ui::Selectable::constPtr & obj ) const
70  { return obj && obj->hasCandidateObj(); }
71  };
72 
73  struct ByStatus
75  {
76  ByStatus( Status status_r )
77  : _status( status_r )
78  {}
79 
80  bool operator()( const ui::Selectable::constPtr & obj ) const
81  { return obj && obj->status() == _status; }
82 
84  };
85 
87  } // namespace selfilter
90  } // namespace ui
93 } // namespace zypp
95 #endif // ZYPP_UI_SELFILTERS_H
Status
UI status Status values calculated by Selectable.
Definition: Status.h:35
bool operator()(const ui::Selectable::constPtr &obj) const
Definition: SelFilters.h:53
Definition: Arch.h:363
ByStatus(Status status_r)
Definition: SelFilters.h:76
intrusive_ptr< const Selectable > constPtr
Definition: Selectable.h:59
ByKind(ResKind kind_r)
Definition: SelFilters.h:34
bool operator()(const ui::Selectable::constPtr &obj) const
Definition: SelFilters.h:62
bool operator()(const Selectable::constPtr &obj) const
Definition: SelFilters.h:38
bool operator()(const ui::Selectable::constPtr &obj) const
Definition: SelFilters.h:69
bool operator()(const ui::Selectable::constPtr &obj) const
Definition: SelFilters.h:80
Resolvable kinds.
Definition: ResKind.h:32
Easy-to use interface to the ZYPP dependency resolver.
Definition: Application.cc:19
ByName(std::string name_r)
Definition: SelFilters.h:49