1 /*---------------------------------------------------------------------\
3 | |__ / \ / / . \ . \ |
8 \---------------------------------------------------------------------*/
18 #include "zypp/Edition.h"
19 #include "zypp/ResTraits.h"
20 #include "zypp/RelCompare.h"
22 ///////////////////////////////////////////////////////////////////
24 { /////////////////////////////////////////////////////////////////
26 ///////////////////////////////////////////////////////////////////
30 /** Helper storing Name and Edition. */
39 NVR( const std::string & name_r,
40 const Edition & edition_r = Edition() )
42 , edition( edition_r )
45 /** Ctor from Resolvable::constPtr */
47 NVR( ResTraits<Resolvable>::constPtrType res_r );
55 /** Comparison mostly for std::container */
56 static int compare( const NVR & lhs, const NVR & rhs )
58 int res = lhs.name.compare( rhs.name );
61 return lhs.edition.compare( rhs.edition );
64 ///////////////////////////////////////////////////////////////////
66 /** \relates NVR Stream output */
67 std::ostream & operator<<( std::ostream & str, const NVR & obj );
70 inline bool operator==( const NVR & lhs, const NVR & rhs )
71 { return compareByRel( Rel::EQ, lhs, rhs ); }
74 inline bool operator!=( const NVR & lhs, const NVR & rhs )
75 { return compareByRel( Rel::NE, lhs, rhs ); }
77 /** \relates NVR Order in std::container */
78 inline bool operator<( const NVR & lhs, const NVR & rhs )
79 { return compareByRel( Rel::LT, lhs, rhs ); }
81 /////////////////////////////////////////////////////////////////
83 ///////////////////////////////////////////////////////////////////