libzypp  17.38.7
Dep.h
Go to the documentation of this file.
1 /*---------------------------------------------------------------------\
2 | ____ _ __ __ ___ |
3 | |__ / \ / / . \ . \ |
4 | / / \ V /| _/ _/ |
5 | / /__ | | | | | | |
6 | /_____||_| |_| |_| |
7 | |
8 \---------------------------------------------------------------------*/
12 #ifndef ZYPP_DEP_H
13 #define ZYPP_DEP_H
14 
15 #include <zypp-core/Globals.h>
16 #include <iosfwd>
17 #include <string>
18 
20 namespace zypp
21 {
22 
24  //
25  // CLASS NAME : Dep
26  //
30  struct ZYPP_API Dep
31  {
32  friend bool operator==( const Dep & lhs, const Dep & rhs );
33  friend bool operator!=( const Dep & lhs, const Dep & rhs );
35  friend bool operator<( const Dep & lhs, const Dep & rhs );
36 
43  static const Dep PROVIDES ZYPP_API;
44  static const Dep PREREQUIRES ZYPP_API;
45  static const Dep REQUIRES ZYPP_API;
46  static const Dep CONFLICTS ZYPP_API;
47  static const Dep OBSOLETES ZYPP_API;
48  static const Dep RECOMMENDS ZYPP_API;
49  static const Dep SUGGESTS ZYPP_API;
50  static const Dep ENHANCES ZYPP_API;
51  static const Dep SUPPLEMENTS ZYPP_API;
53 
67  };
68 
76  explicit
77  Dep( const std::string & strval_r );
78 
82  const std::string & asString() const ZYPP_API;
83 
87  std::string asUserString() const ZYPP_API;
88 
90  for_use_in_switch inSwitch() const
91  { return _type; }
92 
93  private:
96  : _type( type_r )
97  {}
100  };
102 
104  inline std::ostream & operator<<( std::ostream & str, const Dep & obj )
105  { return str << obj.asString(); }
106 
108 
110  inline bool operator==( const Dep & lhs, const Dep & rhs )
111  { return lhs._type == rhs._type; }
112 
114  inline bool operator!=( const Dep & lhs, const Dep & rhs )
115  { return lhs._type != rhs._type; }
116 
118  inline bool operator<( const Dep & lhs, const Dep & rhs )
119  { return lhs._type < rhs._type; }
120 
122 } // namespace zypp
124 #endif // ZYPP_DEP_H
static const Dep RECOMMENDS ZYPP_API
Definition: Dep.h:48
bool operator==(const Capability &lhs, const Capability &rhs)
relates: Capability
Definition: Capability.h:309
for_use_in_switch
Enumarators provided only for use inSwitch statement.
Definition: Dep.h:57
static const Dep ENHANCES ZYPP_API
Definition: Dep.h:50
Enumeration class of dependency types.
Definition: Dep.h:30
const std::string & asString() const ZYPP_API
String representation of dependency type.
Definition: Dep.cc:76
std::string asString(const Patch::Category &obj)
relates: Patch::Category string representation.
Definition: Patch.cc:122
String related utilities and Regular expression matching.
Definition: ansi.h:854
std::string asUserString(VendorSupportOption opt)
converts the support option to a name intended to be printed to the user.
static const Dep SUPPLEMENTS ZYPP_API
Definition: Dep.h:51
const Arch Arch_empty ZYPP_API
relates: Arch This is an empty Arch represented by an empty string.
Definition: Arch.h:173
static const Dep PROVIDES ZYPP_API
Definition: Dep.h:43
Provides API related macros.
bool operator!=(const Capability &lhs, const Capability &rhs)
relates: Capability
Definition: Capability.h:313
static const Dep SUGGESTS ZYPP_API
Definition: Dep.h:49
static const Dep CONFLICTS ZYPP_API
Definition: Dep.h:46
static const Dep PREREQUIRES ZYPP_API
Definition: Dep.h:44
bool operator<(const Capability &lhs, const Capability &rhs)
relates: Capability Arbitrary order.
Definition: Capability.h:317
std::ostream & operator<<(std::ostream &str, const Capabilities &obj)
relates: Capabilities Stream output
Definition: Capabilities.cc:65
static const Dep REQUIRES ZYPP_API
Definition: Dep.h:45
Easy-to use interface to the ZYPP dependency resolver.
Definition: CodePitfalls.doc:1
static const Dep OBSOLETES ZYPP_API
Definition: Dep.h:47
for_use_in_switch _type
The operator.
Definition: Dep.h:99
Dep(for_use_in_switch type_r)
Ctor to initialize the dependency type contants.
Definition: Dep.h:95