NVRA.h

Go to the documentation of this file.
00001 /*---------------------------------------------------------------------\
00002 |                          ____ _   __ __ ___                          |
00003 |                         |__  / \ / / . \ . \                         |
00004 |                           / / \ V /|  _/  _/                         |
00005 |                          / /__ | | | | | |                           |
00006 |                         /_____||_| |_| |_|                           |
00007 |                                                                      |
00008 \---------------------------------------------------------------------*/
00012 #ifndef ZYPP_NVRA_H
00013 #define ZYPP_NVRA_H
00014 
00015 #include <iosfwd>
00016 
00017 #include "zypp/NVR.h"
00018 #include "zypp/Arch.h"
00019 
00021 namespace zypp
00022 { 
00023 
00025   //
00026   //    CLASS NAME : NVRA
00027   //
00029   struct NVRA : public NVR
00030   {
00032     NVRA()
00033     {}
00034 
00036     explicit
00037     NVRA( const std::string & name_r,
00038           const Edition & edition_r = Edition(),
00039           const Arch & arch_r = Arch() )
00040     : NVR( name_r, edition_r )
00041     , arch( arch_r )
00042     {}
00043 
00045     explicit
00046     NVRA( const NVR & nvr_r,
00047           const Arch & arch_r = Arch() )
00048     : NVR( nvr_r )
00049     , arch( arch_r )
00050     {}
00051 
00053     explicit
00054     NVRA( ResTraits<Resolvable>::constPtrType res_r );
00055 
00057     Arch arch;
00058 
00059   public:
00061     static int compare( const NVRA & lhs, const NVRA & rhs )
00062     {
00063       int res = NVR::compare( lhs, rhs );
00064       if ( res )
00065         return res;
00066       return lhs.arch.compare( rhs.arch );
00067     }
00068   };
00070 
00072   std::ostream & operator<<( std::ostream & str, const NVRA & obj );
00073 
00075   inline bool operator==( const NVRA & lhs, const NVRA & rhs )
00076   { return compareByRel( Rel::EQ, lhs, rhs ); }
00077 
00079   inline bool operator!=( const NVRA & lhs, const NVRA & rhs )
00080   { return compareByRel( Rel::NE, lhs, rhs ); }
00081 
00083   inline bool operator<( const NVRA & lhs, const NVRA & rhs )
00084   { return compareByRel( Rel::LT, lhs, rhs ); }
00085 
00087 } // namespace zypp
00089 #endif // ZYPP_NVRA_H

Generated on Thu Jul 6 00:07:21 2006 for zypp by  doxygen 1.4.6