1 /*---------------------------------------------------------------------\
3 | |__ / \ / / . \ . \ |
8 \---------------------------------------------------------------------*/
18 #include "zypp/Arch.h"
20 ///////////////////////////////////////////////////////////////////
22 { /////////////////////////////////////////////////////////////////
24 ///////////////////////////////////////////////////////////////////
28 /** Helper storing Name, Edition and Arch. */
29 struct NVRA : public NVR
37 NVRA( const std::string & name_r,
38 const Edition & edition_r = Edition(),
39 const Arch & arch_r = Arch() )
40 : NVR( name_r, edition_r )
46 NVRA( const NVR & nvr_r,
47 const Arch & arch_r = Arch() )
52 /** Ctor from Resolvable::constPtr */
54 NVRA( ResTraits<Resolvable>::constPtrType res_r );
60 /** Comparison mostly for std::container */
61 static int compare( const NVRA & lhs, const NVRA & rhs )
63 int res = NVR::compare( lhs, rhs );
66 return lhs.arch.compare( rhs.arch );
69 ///////////////////////////////////////////////////////////////////
71 /** \relates NVRA Stream output */
72 std::ostream & operator<<( std::ostream & str, const NVRA & obj );
75 inline bool operator==( const NVRA & lhs, const NVRA & rhs )
76 { return compareByRel( Rel::EQ, lhs, rhs ); }
79 inline bool operator!=( const NVRA & lhs, const NVRA & rhs )
80 { return compareByRel( Rel::NE, lhs, rhs ); }
82 /** \relates NVRA Order in std::container */
83 inline bool operator<( const NVRA & lhs, const NVRA & rhs )
84 { return compareByRel( Rel::LT, lhs, rhs ); }
86 /////////////////////////////////////////////////////////////////
88 ///////////////////////////////////////////////////////////////////