00001
00002
00003
00004
00005
00006
00007
00008
00012 #ifndef ZYPP_DEP_H
00013 #define ZYPP_DEP_H
00014
00015 #include <iosfwd>
00016 #include <string>
00017
00019 namespace zypp
00020 {
00021
00023
00024
00025
00029 struct Dep
00030 {
00031 friend bool operator==( const Dep & lhs, const Dep & rhs );
00032 friend bool operator!=( const Dep & lhs, const Dep & rhs );
00034 friend bool operator<( const Dep & lhs, const Dep & rhs );
00035
00042 static const Dep PROVIDES;
00043 static const Dep PREREQUIRES;
00044 static const Dep REQUIRES;
00045 static const Dep CONFLICTS;
00046 static const Dep OBSOLETES;
00047 static const Dep RECOMMENDS;
00048 static const Dep SUGGESTS;
00049 static const Dep FRESHENS;
00050 static const Dep ENHANCES;
00051 static const Dep SUPPLEMENTS;
00053
00057 enum for_use_in_switch {
00058 PROVIDES_e,
00059 PREREQUIRES_e,
00060 REQUIRES_e,
00061 CONFLICTS_e,
00062 OBSOLETES_e,
00063 RECOMMENDS_e,
00064 SUGGESTS_e,
00065 FRESHENS_e,
00066 ENHANCES_e,
00067 SUPPLEMENTS_e,
00068 };
00069
00077 explicit
00078 Dep( const std::string & strval_r );
00079
00083 const std::string & asString() const;
00084
00086 for_use_in_switch inSwitch() const
00087 { return _type; }
00088
00089 private:
00091 Dep( for_use_in_switch type_r )
00092 : _type( type_r )
00093 {}
00095 for_use_in_switch _type;
00096 };
00098
00100 inline std::ostream & operator<<( std::ostream & str, const Dep & obj )
00101 { return str << obj.asString(); }
00102
00104
00106 inline bool operator==( const Dep & lhs, const Dep & rhs )
00107 { return lhs._type == rhs._type; }
00108
00110 inline bool operator!=( const Dep & lhs, const Dep & rhs )
00111 { return lhs._type != rhs._type; }
00112
00114 inline bool operator<( const Dep & lhs, const Dep & rhs )
00115 { return lhs._type < rhs._type; }
00116
00118 }
00120 #endif // ZYPP_DEP_H