YUMParserData.h

Go to the documentation of this file.
00001 /*---------------------------------------------------------------------\
00002 |                          ____ _   __ __ ___                          |
00003 |                         |__  / \ / / . \ . \                         |
00004 |                           / / \ V /|  _/  _/                         |
00005 |                          / /__ | | | | | |                           |
00006 |                         /_____||_| |_| |_|                           |
00007 |                                                                      |
00008 \---------------------------------------------------------------------*/
00019 #ifndef YUMParserData_h
00020 #define YUMParserData_h
00021 
00022 #include "zypp/base/ReferenceCounted.h"
00023 #include "zypp/base/NonCopyable.h"
00024 #include "zypp/Pathname.h"
00025 #include "zypp/TranslatedText.h"
00026 #include <string>
00027 #include <list>
00028 #include <iosfwd>
00029 #include <zypp/base/PtrTypes.h>
00030 
00031 using namespace zypp::base;
00032 
00033 
00034 namespace zypp {
00035   namespace parser {
00036     namespace yum {
00037 
00038       DEFINE_PTR_TYPE( YUMRepomdData );
00039       DEFINE_PTR_TYPE( YUMPrimaryData );
00040       DEFINE_PTR_TYPE( YUMGroupData );
00041       DEFINE_PTR_TYPE( YUMPatternData );
00042       DEFINE_PTR_TYPE( YUMFileListData );
00043       DEFINE_PTR_TYPE( YUMOtherData );
00044       DEFINE_PTR_TYPE( YUMPatchData );
00045       DEFINE_PTR_TYPE( YUMPatchesData );
00046       DEFINE_PTR_TYPE( YUMProductData );
00047       DEFINE_PTR_TYPE( YUMPatchPackage );
00048       DEFINE_PTR_TYPE( YUMPatchScript );
00049       DEFINE_PTR_TYPE( YUMPatchMessage );
00050 
00054       class YUMDependency {
00055       public:
00056         YUMDependency();
00057         YUMDependency(const std::string& kind,
00058                       const std::string& name,
00059                       const std::string& flags,
00060                       const std::string& epoch,
00061                       const std::string& ver,
00062                       const std::string& rel,
00063                       const std::string& pre );
00064         YUMDependency(const std::string& kind,
00065                       const std::string& encoded );
00066         bool isEncoded() const;
00067         std::string kind;
00068         std::string name;
00069         std::string flags;
00070         std::string epoch;
00071         std::string ver;
00072         std::string rel;
00073         std::string pre;
00074         // in case we only store the encoded string
00075         std::string encoded;
00076       };
00077 
00081       class YUMDirSize {
00082       public:
00083         YUMDirSize();
00084         YUMDirSize(const std::string& path,
00085                   const std::string& size,
00086                   const std::string& fileCount);
00087         const std::string path;
00088         const std::string sizeKByte;
00089         const std::string fileCount;
00090       };
00091 
00096       class FileData {
00097       public:
00098         std::string name;
00099         std::string type;
00100         FileData();
00101         FileData(const std::string &name,
00102                  const std::string &type);
00103       };
00104 
00109       class MetaPkg {
00110       public:
00111         MetaPkg();
00112         MetaPkg(const std::string& type,
00113                 const std::string& name);
00114         std::string type;
00115         std::string name;
00116       };
00117 
00122       class PackageReq {
00123       public:
00124         PackageReq();
00125         PackageReq(const std::string& type,
00126                   const std::string& epoch,
00127                   const std::string& ver,
00128                   const std::string& rel,
00129                   const std::string& name);
00130         std::string type;
00131         std::string epoch;
00132         std::string ver;
00133         std::string rel;
00134         std::string name;
00135       };
00136 
00140       class ChangelogEntry {
00141       public:
00142         ChangelogEntry();
00143         ChangelogEntry(const std::string& author,
00144                       const std::string& date,
00145                       const std::string& entry);
00146         std::string author;
00147         std::string date;
00148         std::string entry;
00149       };
00150 
00151       class YUMObjectData : public base::ReferenceCounted, private base::NonCopyable {
00152       public:
00153 
00154         std::string name;
00155         std::string epoch;
00156         std::string ver;
00157         std::string rel;
00158         std::string arch;
00159         std::list<YUMDependency> provides;
00160         std::list<YUMDependency> conflicts;
00161         std::list<YUMDependency> obsoletes;
00162         std::list<YUMDependency> freshens;
00163         std::list<YUMDependency> requires;
00164         std::list<YUMDependency> prerequires;
00165         std::list<YUMDependency> recommends;
00166         std::list<YUMDependency> suggests;
00167         std::list<YUMDependency> supplements;
00168         std::list<YUMDependency> enhances;
00169       };
00170 
00171       class YUMPatchAtom : public YUMObjectData {
00172       public:
00173         enum AtomType { Package, Script, Message };
00174         virtual AtomType atomType() = 0;
00175       };
00176 
00177       class YUMPlainRpm {
00178       public:
00179         std::string arch;
00180         std::string filename;
00181         std::string downloadsize;
00182         std::string md5sum;
00183         std::string buildtime;
00184       };
00185 
00186       struct YUMEdition {
00187         std::string epoch;
00188         std::string ver;
00189         std::string rel;
00190       };
00191       std::ostream& operator<<(std::ostream& out, const YUMEdition& data);
00192 
00193       struct YUMPatchBaseVersion {
00194         YUMEdition edition;
00195       };
00196       std::ostream& operator<<(std::ostream& out, const YUMPatchBaseVersion& data);
00197 
00198       struct YUMPatchRpm {
00199         std::string arch;
00200         std::string filename;
00201         std::string downloadsize;
00202         std::string md5sum;
00203         std::string buildtime;
00204         std::list<YUMPatchBaseVersion> baseVersions;
00205         std::string checksumType;
00206         std::string checksum;
00207         std::string location;
00208         std::string media;
00209       };
00210       std::ostream& operator<<(std::ostream& out, const YUMPatchRpm& data);
00211 
00212       struct YUMDeltaBaseVersion {
00213         YUMEdition edition;
00214         std::string md5sum;
00215         std::string buildtime;
00216         std::string sequence_info;
00217       };
00218       std::ostream& operator<<(std::ostream& out, const YUMDeltaBaseVersion& data);
00219 
00220       struct YUMDeltaRpm {
00221         std::string arch;
00222         std::string filename;
00223         std::string downloadsize;
00224         std::string md5sum;
00225         std::string buildtime;
00226         YUMDeltaBaseVersion baseVersion;
00227         std::string checksumType;
00228         std::string checksum;
00229         std::string location;
00230         std::string media;
00231       };
00232       std::ostream& operator<<(std::ostream& out, const YUMDeltaRpm& data);
00233 
00234 
00235 
00236       class YUMPatchPackage : public YUMPatchAtom {
00237       public:
00238         YUMPatchPackage() : installOnly( false ) {};
00239         virtual AtomType atomType() { return Package; };
00240         // data for primary
00241         std::string arch;
00242         std::string type;
00243         std::string checksumType;
00244         std::string checksumPkgid;
00245         std::string checksum;
00246         std::string summary;
00247         std::string description;
00248         std::string packager;
00249         std::string url;
00250         std::string timeFile;
00251         std::string timeBuild;
00252         std::string sizePackage;
00253         std::string sizeInstalled;
00254         std::string sizeArchive;
00255         std::string location;
00256         std::string license;
00257         TranslatedText license_to_confirm;
00258         std::string vendor;
00259         std::string group;
00260         std::string buildhost;
00261         std::string sourcerpm;
00262         std::string headerStart;
00263         std::string headerEnd;
00264         std::list<FileData> files;
00265         // SuSE specific data
00266         std::list<std::string> authors;
00267         std::list<std::string> keywords;
00268         std::string  media;
00269         std::list<YUMDirSize> dirSizes;
00270         bool installOnly;
00271         // Change Log
00272         std::list<ChangelogEntry> changelog;
00273         // Package Files
00274         std::list<YUMPlainRpm> plainRpms;
00275         std::list<YUMPatchRpm> patchRpms;
00276         std::list<YUMDeltaRpm> deltaRpms;
00277       };
00278 
00279       class YUMPatchScript : public YUMPatchAtom {
00280       public:
00281         YUMPatchScript() {};
00282         virtual AtomType atomType() { return Script; };
00283         std::string do_script;
00284         std::string undo_script;
00285         std::string do_location;
00286         std::string undo_location;
00287         std::string do_media;
00288         std::string undo_media;
00289         std::string do_checksum_type;
00290         std::string do_checksum;
00291         std::string undo_checksum_type;
00292         std::string undo_checksum;
00293       };
00294 
00295       class YUMPatchMessage : public YUMPatchAtom {
00296       public:
00297         YUMPatchMessage() {};
00298         virtual AtomType atomType() { return Message; };
00299         TranslatedText text;
00300       };
00301 
00302 
00306       class YUMRepomdData : public base::ReferenceCounted, private base::NonCopyable {
00307       public:
00308         YUMRepomdData();
00309         std::string type;
00310         std::string location;
00311         std::string checksumType;
00312         std::string checksum;
00313         std::string timestamp;
00314         std::string openChecksumType;
00315         std::string openChecksum;
00316       };
00317 
00321       class YUMPrimaryData : public YUMObjectData {
00322       public:
00323         YUMPrimaryData();
00324         std::string type;
00325         std::string arch;
00326         std::string checksumType;
00327         std::string checksumPkgid;
00328         std::string checksum;
00329         std::string summary;
00330         std::string description;
00331         std::string packager;
00332         std::string url;
00333         std::string timeFile;
00334         std::string timeBuild;
00335         std::string sizePackage;
00336         std::string sizeInstalled;
00337         std::string sizeArchive;
00338         Pathname location;
00339         std::string license;
00340         std::string vendor;
00341         std::string group;
00342         std::string buildhost;
00343         std::string sourcerpm;
00344         std::string headerStart;
00345         std::string headerEnd;
00346         std::list<FileData> files;
00347 
00348         // SuSE specific data
00349         std::list<std::string> authors;
00350         std::list<std::string> keywords;
00351         std::string  media;
00352         std::list<YUMDirSize> dirSizes;
00353         bool installOnly;
00354         TranslatedText license_to_confirm;
00355       };
00356 
00361       class YUMGroupData : public base::ReferenceCounted, private base::NonCopyable {
00362       public:
00363 
00364         YUMGroupData();
00365         std::string groupId;
00366         TranslatedText name;
00367         std::string default_;
00368         std::string userVisible;
00369         TranslatedText description;
00370         std::list<MetaPkg> grouplist;
00371         std::list<PackageReq> packageList;
00372       };
00373 
00378       class YUMPatternData : public YUMObjectData {
00379       public:
00380 
00381         YUMPatternData();
00382         std::string name;
00383         std::string epoch;
00384         std::string ver;
00385         std::string rel;
00386         std::string arch;
00387         TranslatedText summary;
00388         std::string default_;
00389         std::string userVisible;
00390         TranslatedText description;
00391         TranslatedText category;
00392         std::string icon;
00393         std::string script;
00394       };
00395 
00399       class YUMFileListData : public base::ReferenceCounted, private base::NonCopyable {
00400       public:
00401 
00402         YUMFileListData();
00403 
00404         std::string pkgId;
00405         std::string name;
00406         std::string arch;
00407         std::string epoch;
00408         std::string ver;
00409         std::string rel;
00410         std::list<FileData> files;
00411       };
00412 
00416       class YUMOtherData : public base::ReferenceCounted, private base::NonCopyable {
00417       public:
00418         YUMOtherData();
00419         std::string pkgId;
00420         std::string name;
00421         std::string arch;
00422         std::string epoch;
00423         std::string ver;
00424         std::string rel;
00425         std::list<ChangelogEntry> changelog;
00426       };
00427 
00428     /* ** YUMPatchData not yet finalized **/
00429 
00430       class YUMPatchData : public YUMObjectData {
00431       public:
00432         YUMPatchData();
00433         ~YUMPatchData() {
00434 
00435         }
00436 
00437         std::string patchId;
00438         std::string timestamp;
00439         std::string engine;
00440         TranslatedText summary;
00441         TranslatedText description;
00442         TranslatedText license_to_confirm;
00443         std::string category;
00444         bool rebootNeeded;
00445         bool packageManager;
00446         std::string updateScript;
00447         std::list<shared_ptr<YUMPatchAtom> > atoms;
00448       };
00449 
00450       class YUMPatchesData : public base::ReferenceCounted, private base::NonCopyable {
00451       public:
00452         YUMPatchesData() {};
00453         ~YUMPatchesData() {};
00454 
00455         std::string location;
00456         std::string id;
00457         std::string checksumType;
00458         std::string checksum;
00459       };
00460 
00461       class YUMProductData : public YUMObjectData {
00462       public:
00463         YUMProductData() {};
00464          ~YUMProductData() {};
00465 
00466         std::string type;
00467         std::string vendor;
00468         std::string name;
00469         TranslatedText summary;
00470         TranslatedText description;
00471         TranslatedText short_name;
00472         // those are suse specific tags
00473         std::string releasenotesurl;
00474       };
00475 
00476       /* Easy output (\todo move to class decl.) */
00477       std::ostream& operator<<(std::ostream &out, const YUMDependency& data);
00478       std::ostream& operator<<(std::ostream &out, const YUMDirSize& data);
00479       std::ostream& operator<<(std::ostream &out, const YUMRepomdData& data);
00480       std::ostream& operator<<(std::ostream &out, const FileData& data);
00481       std::ostream& operator<<(std::ostream &out, const MetaPkg& data);
00482       std::ostream& operator<<(std::ostream &out, const PackageReq& data);
00483       std::ostream& operator<<(std::ostream &out, const ChangelogEntry& data);
00484       std::ostream& operator<<(std::ostream &out, const YUMRepomdData& data);
00485       std::ostream& operator<<(std::ostream &out, const YUMPrimaryData& data);
00486       std::ostream& operator<<(std::ostream &out, const YUMGroupData& data);
00487       std::ostream& operator<<(std::ostream &out, const YUMPatternData& data);
00488       std::ostream& operator<<(std::ostream &out, const YUMFileListData& data);
00489       std::ostream& operator<<(std::ostream& out, const YUMOtherData& data);
00490       std::ostream& operator<<(std::ostream& out, const YUMPatchData& data);
00491       std::ostream& operator<<(std::ostream& out, const YUMPatchesData& data);
00492       std::ostream& operator<<(std::ostream& out, const YUMProductData& data);
00493       std::ostream& operator<<(std::ostream& out, const zypp::shared_ptr<YUMPatchAtom> data);
00494       std::ostream& operator<<(std::ostream& out, const YUMPatchMessage& data);
00495       std::ostream& operator<<(std::ostream& out, const YUMPatchScript& data);
00496       std::ostream& operator<<(std::ostream& out, const YUMPatchPackage& data);
00497       std::ostream& operator<<(std::ostream& out, const YUMPlainRpm& data);
00498 
00499     } // namespace yum
00500   } // namespace parser
00501 } // namespace zypp
00502 
00503 
00504 
00505 
00506 
00507 
00508 #endif

Generated on Wed Sep 27 01:16:34 2006 for zypp by  doxygen 1.4.6