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

packageversion.h

Go to the documentation of this file.
00001 /*!\file packageversion.h
00002         \brief Declerations for PackageVersion.
00003         Should be included wherever PackageVersion is used.*/
00004         
00005 #ifndef __PACKAGEVERSION_H__
00006 #define __PACKAGEVERSION_H__
00007 
00008 #include "package.h"
00009 #include "pmstring.h"
00010 
00011 //!A small class acting as a bitmask for masking on different archs.
00012 /*!Essentially a bitmask with flags allowing you to
00013   set masked states on various archs.*/
00014 class MaskedStates
00015 {
00016         public:
00017                 MaskedStates();                                         //!<Constructor.
00018                 void Reset(MaskedStatus state);         //!<Reset all vars to provided value.
00019                 
00020                 long Alpha : 3;         //!<0..3 2 bit type.
00021                 long Amd64 : 3;         //!<0..3 2 bit type.
00022                 long Arm : 3;           //!<0..3 2 bit type.
00023                 long Hppa : 3;          //!<0..3 2 bit type.
00024                 long Ia64 : 3;          //!<0..3 2 bit type.
00025                 long Mips : 3;          //!<0..3 2 bit type.
00026                 long Ppc : 3;           //!<0..3 2 bit type.
00027                 long Ppc64 : 3;         //!<0..3 2 bit type.
00028                 long PpcMacOs : 3;      //!<0..3 2 bit type.
00029                 long S390 : 3;          //!<0..3 2 bit type.
00030                 long Sh : 3;            //!<0..3 2 bit type.
00031                 long Sparc : 3;         //!<0..3 2 bit type.
00032                 long X86 : 3;           //!<0..3 2 bit type.
00033 };
00034 
00035 /*!Keywords for packages, all obvious. Keep in this order to allow
00036   the check if(Keyword%2==0) to be true if keyword is unstable.*/
00037 enum Keyword
00038 {
00039         eAlphaUnstable,
00040         eAlphaStable,
00041         eAmd64Unstable,
00042         eAmd64Stable,
00043         eArmUnstable,
00044         eArmStable,
00045         eHppaUnstable,
00046         eHppaStable,
00047         eIa64Unstable,
00048         eIa64Stable,
00049         eMipsUnstable,
00050         eMipsStable,
00051         ePpcUnstable,
00052         ePpcStable,
00053         ePpc64Unstable,
00054         ePpc64Stable,
00055         ePpcMacOsUnstable,
00056         ePpcMacOsStable,
00057         eS390Unstable,
00058         eS390Stable,
00059         eShUnstable,
00060         eShStable,
00061         eSparcUnstable,
00062         eSparcStable,
00063         eX86Unstable,
00064         eX86Stable
00065 };
00066 
00067 //!PackageVersion is the class that represents a version of a Package.
00068 /*!PackageVersion is the main "object" class in the api. It contains all the
00069   information we know about a package before it becomes installed and as such,
00070   is a heavily used class.*/
00071 class PackageVersion : public Package
00072 {
00073         public:
00074                 PackageVersion();                                                       //!<Constructor.
00075                 PackageVersion(PMString version);                       //!<Constructor with version.
00076                 PackageVersion(const PackageVersion &copy);     //!<Copy constructor with PackageVersion.
00077                 PackageVersion(const Package &copy);            //!<Copy constructor with Package.
00078                 virtual ~PackageVersion();                                      //!<Destructor.
00079         
00080                 bool operator== (const PackageVersion& param);  //!<Equality operator.
00081                 bool operator!= (const PackageVersion& param);  //!<Non equality operator.
00082                 bool operator== (const Package& param);                 //!<Equality operator - with Package.
00083                 bool operator!= (const Package& param);                 //!<Non equality operator - with Package.
00084         
00085                 virtual Dbt GetKey();                   //!<Returns DB Key.
00086                 virtual Dbt GetData();                  //!<Returns DB Data.
00087                 virtual void ReadData(Dbt data);//!<Reads DB Data.
00088                 virtual void ReadKey(Dbt key);  //!<Reads DB Key.
00089         
00090                 void ProcessMasking(PMString maskedString);     //!<Process the usual portage masking string.
00091                 void CalculateSize();                                           //!<Open the versions digest file and calculate the size.
00092         
00093                 bool IsHardmasked(Keyword keyword);                             //!<Returns true if is eHardMasked.
00094                 bool IsUnstable(Keyword keyword);                               //!<Returns true if is eUnstable.
00095                 bool IsStable(Keyword keyword);                                 //!<Returns true if is eStable.
00096                 bool CheckVersionWithKeyword(Keyword keyword);  //!<Returns true if versionMaskedState complies with keyword.
00097         
00098                 MaskedStates versionMaskedState;        //!<Version's masked state on different archs.
00099                 PMString version;                                       //!<Version.
00100                 PMString sourceUrl;                                     //!<Url for sources.
00101                 PMString possibleVirtuals;                      //!<Possible virtuals this package provides, can be dependent on useflags.
00102                 PMString slot;                                          //!<Slot version goes into.
00103                 PMString licence;                                       //!<Licence.
00104                 PMString compileDepend;                         //!<Compile time dependencies ( usual portage string format ).
00105                 PMString runDepend;                                     //!<Run time dependencies ( usual portage string format ).
00106                 PMString postDepend;                            //!<Post time dependencies ( usual portage string format ).
00107                 int fileSize;                                           //!<Filesize needed to be downloaded for this version.
00108         
00109         protected:
00110 };
00111 
00112 #endif

Generated on Wed May 25 15:29:54 2005 for Package Management System for Gentoo Linux by  doxygen 1.4.1