Main Page | Namespace List | Class Hierarchy | Class List | File List | Namespace Members | Class Members | File Members

PkgName.h

Go to the documentation of this file.
00001 #ifndef _PkgName_h
00002 #define _PkgName_h
00003 
00004 #include <y2util/Ustring.h>
00005 #include <y2pm/PkgEdition.h>
00006 
00007 
00009 //
00010 //      CLASS NAME : PkgName
00014 class PkgName : public Ustring {
00015 
00016   private:
00017 
00018     static UstringHash _nameHash;
00019 
00020   public:
00021 
00022     explicit PkgName( const std::string & n = "" ) : Ustring( _nameHash, n ) {}
00023 };
00024 
00026 
00028 //
00029 //      CLASS NAME : PkgNameEd
00035 struct PkgNameEd {
00036 
00037   public:
00038 
00039         PkgName    name;
00040         PkgEdition edition;
00041 
00045         PkgNameEd( const PkgName & n, const PkgEdition & e )
00046                 : name(n), edition(e) {}
00047 
00048         // default copy constructor and assigment are ok
00049 
00050         bool operator==( const PkgNameEd & ne2 ) const {
00051                 return name == ne2.name && edition == ne2.edition;
00052         }
00053         bool operator!=( const PkgNameEd & ne2 ) const {
00054                 return !operator==( ne2 );
00055         }
00056 
00057         bool operator<( const PkgNameEd & ne2 ) const {
00058           return( name < ne2.name
00059                   || ( name == ne2.name && edition < ne2.edition ) );
00060         }
00061 
00062         std::string asString() const;
00063 
00064         friend std::ostream& operator<<( std::ostream&, const PkgNameEd& );
00065 
00066       public:
00071         static std::string toString( const PkgNameEd & t );
00072 
00077         static PkgNameEd fromString( std::string s );
00078 };
00079 
00080 
00081 #endif  /* _PkgName_h */
00082 
00083 
00084 // Local Variables:
00085 // tab-width: 4
00086 // End:

Generated on Fri Nov 9 14:30:31 2007 for yast2-packagemanager by doxygen 1.3.6