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
20namespace zypp
21{
22
24 //
25 // CLASS NAME : Dep
26 //
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
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
91 { return _type; }
92
93 private:
96 : _type( type_r )
97 {}
98
100 };
101
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
Provides API related macros.
Definition ansi.h:855
String related utilities and Regular expression matching.
Easy-to use interface to the ZYPP dependency resolver.
bool operator<(const Capability &lhs, const Capability &rhs)
relates: Capability Arbitrary order.
Definition Capability.h:317
bool operator!=(const Capability &lhs, const Capability &rhs)
relates: Capability
Definition Capability.h:313
bool operator==(const Capability &lhs, const Capability &rhs)
relates: Capability
Definition Capability.h:309
std::string asUserString(VendorSupportOption opt)
converts the support option to a name intended to be printed to the user.
const Arch Arch_empty ZYPP_API
relates: Arch This is an empty Arch represented by an empty string.
Definition Arch.h:173
std::string asString(const Patch::Category &obj)
relates: Patch::Category string representation.
Definition Patch.cc:122
std::ostream & operator<<(std::ostream &str, const Capabilities &obj)
relates: Capabilities Stream output
Enumeration class of dependency types.
Definition Dep.h:31
Dep(for_use_in_switch type_r)
Ctor to initialize the dependency type contants.
Definition Dep.h:95
static const Dep PROVIDES ZYPP_API
Definition Dep.h:43
for_use_in_switch
Enumarators provided only for use inSwitch statement.
Definition Dep.h:57
@ SUGGESTS_e
Definition Dep.h:64
@ REQUIRES_e
Definition Dep.h:60
@ PREREQUIRES_e
Definition Dep.h:59
@ RECOMMENDS_e
Definition Dep.h:63
@ SUPPLEMENTS_e
Definition Dep.h:66
@ PROVIDES_e
Definition Dep.h:58
@ CONFLICTS_e
Definition Dep.h:61
@ ENHANCES_e
Definition Dep.h:65
@ OBSOLETES_e
Definition Dep.h:62
for_use_in_switch _type
The operator.
Definition Dep.h:99
for_use_in_switch inSwitch() const
Enumarator provided for use in switch statement.
Definition Dep.h:90
const std::string & asString() const ZYPP_API
String representation of dependency type.
Definition Dep.cc:76
Dep(const std::string &strval_r)
Ctor from string.
Definition Dep.cc:67