00001 /*!\file package.h 00002 \brief Declerations for Package and the MaskedStatus enum. 00003 Should be included wherever Packages are used.*/ 00004 00005 #ifndef __PACKAGE_H__ 00006 #define __PACKAGE_H__ 00007 00008 #include <vector> 00009 #include "pmstring.h" 00010 #include <db4.1/db_cxx.h> 00011 00012 //!Enum for Package masked status. 00013 /*!Enum for the Package masked status. Only four status' at 00014 the moment.*/ 00015 enum MaskedStatus 00016 { 00017 eHardMasked = 0, //!<Not to be installed under any circumstances ( as a guide ). 00018 eUnstable, //!<Caution needed. 00019 eStable, //!<Can be installed with no worries. 00020 eVersionSpecific //!<Look at the version mask info. 00021 }; 00022 00023 //!The Package class. 00024 /*!The Package class. Contains all the info specific to a package. Package Version inherits 00025 from this. Contains a few methods that should not be used if it can be helped.*/ 00026 class Package 00027 { 00028 public: 00029 Package(); //!<Default Constructor. 00030 Package(PMString description); //!<Constructor - only supply the description, looks up other things. 00031 Package(PMString category, PMString name); //!<Constructor - suppy name and category. 00032 Package(PMString category, PMString name, MaskedStatus state); //!<Constructor - supply all info. 00033 Package(const Package ©); //!<Copy Constructor. 00034 virtual ~Package(); //!<Destructor. 00035 00036 bool operator== (const Package& param); //!<Equality operator. 00037 bool operator!= (const Package& param); //!<Non equality operator. 00038 00039 virtual Dbt GetKey(); //!<Return the Key used by DB. 00040 virtual Dbt GetData(); //!<Return the Data used by DB. 00041 virtual void ReadData(Dbt data);//!<Read the Data used by DB. 00042 virtual void ReadKey(Dbt key); //!<Read the Key used by DB. 00043 00044 PMString name; //!<Package Name. 00045 PMString category; //!<Package Category. 00046 PMString url; //!<Package url. 00047 PMString description; //!<Package description. 00048 MaskedStatus packageMaskedState;//!<Masked State for this system, set by user. 00049 00050 protected: 00051 std::vector<PMString> _GetInfo(PMString description); //!<Given a description, returns vector of package info. 00052 std::vector<PMString> _FindCategories(PMString name); //!<Given a name, returns a vector of possible categories. 00053 }; 00054 00055 #endif