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 <iostream>
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 YUMBaseVersion {
00152       public:
00153         std::string epoch;
00154         std::string ver;
00155         std::string rel;
00156         std::string md5sum;
00157         std::string buildtime;
00158         std::string source_info;
00159       };
00160 
00161       class YUMObjectData : public base::ReferenceCounted, private base::NonCopyable {
00162       public:
00163 
00164         std::string name;
00165         std::string epoch;
00166         std::string ver;
00167         std::string rel;
00168         std::string arch;
00169         std::list<YUMDependency> provides;
00170         std::list<YUMDependency> conflicts;
00171         std::list<YUMDependency> obsoletes;
00172         std::list<YUMDependency> freshens;
00173         std::list<YUMDependency> requires;
00174         std::list<YUMDependency> recommends;
00175         std::list<YUMDependency> suggests;
00176         std::list<YUMDependency> supplements;
00177         std::list<YUMDependency> enhances;
00178       };
00179 
00180       class YUMPatchAtom : public YUMObjectData {
00181       public:
00182         enum AtomType { Package, Script, Message };
00183         virtual AtomType atomType() = 0;
00184       };
00185 
00186       class YUMPlainRpm {
00187       public:
00188         std::string arch;
00189         std::string filename;
00190         std::string downloadsize;
00191         std::string md5sum;
00192         std::string buildtime;
00193       };
00194 
00195       class YUMPatchRpm {
00196       public:
00197         std::string arch;
00198         std::string filename;
00199         std::string downloadsize;
00200         std::string md5sum;
00201         std::string buildtime;
00202         std::list<YUMBaseVersion> baseVersions;
00203         std::string checksumType;
00204         std::string checksum;
00205         std::string location;
00206         std::string media;
00207       };
00208 
00209       class YUMDeltaRpm {
00210       public:
00211         std::string arch;
00212         std::string filename;
00213         std::string downloadsize;
00214         std::string md5sum;
00215         std::string buildtime;
00216         YUMBaseVersion baseVersion;
00217         std::string checksumType;
00218         std::string checksum;
00219         std::string location;
00220         std::string media;
00221       };
00222 
00223 
00224       class YUMPatchPackage : public YUMPatchAtom {
00225       public:
00226         YUMPatchPackage() : installOnly( false ) {};
00227         virtual AtomType atomType() { return Package; };
00228         // data for primary
00229         std::string arch;
00230         std::string type;
00231         std::string checksumType;
00232         std::string checksumPkgid;
00233         std::string checksum;
00234         std::string summary;
00235         std::string description;
00236         std::string packager;
00237         std::string url;
00238         std::string timeFile;
00239         std::string timeBuild;
00240         std::string sizePackage;
00241         std::string sizeInstalled;
00242         std::string sizeArchive;
00243         std::string location;
00244         std::string license;
00245         TranslatedText license_to_confirm;
00246         std::string vendor;
00247         std::string group;
00248         std::string buildhost;
00249         std::string sourcerpm;
00250         std::string headerStart;
00251         std::string headerEnd;
00252         std::list<FileData> files;
00253         // SuSE specific data
00254         std::list<std::string> authors;
00255         std::list<std::string> keywords;
00256         std::string  media;
00257         std::list<YUMDirSize> dirSizes;
00258         bool installOnly;
00259         // Change Log
00260         std::list<ChangelogEntry> changelog;
00261         // Package Files
00262         std::list<YUMPlainRpm> plainRpms;
00263         std::list<YUMPatchRpm> patchRpms;
00264         std::list<YUMDeltaRpm> deltaRpms;
00265       };
00266 
00267       class YUMPatchScript : public YUMPatchAtom {
00268       public:
00269         YUMPatchScript() {};
00270         virtual AtomType atomType() { return Script; };
00271         std::string do_script;
00272         std::string undo_script;
00273         std::string do_location;
00274         std::string undo_location;
00275         std::string do_media;
00276         std::string undo_media;
00277         std::string do_checksum_type;
00278         std::string do_checksum;
00279         std::string undo_checksum_type;
00280         std::string undo_checksum;
00281       };
00282 
00283       class YUMPatchMessage : public YUMPatchAtom {
00284       public:
00285         YUMPatchMessage() {};
00286         virtual AtomType atomType() { return Message; };
00287         TranslatedText text;
00288       };
00289 
00290 
00294       class YUMRepomdData : public base::ReferenceCounted, private base::NonCopyable {
00295       public:
00296         YUMRepomdData();
00297         std::string type;
00298         std::string location;
00299         std::string checksumType;
00300         std::string checksum;
00301         std::string timestamp;
00302         std::string openChecksumType;
00303         std::string openChecksum;
00304       };
00305 
00309       class YUMPrimaryData : public YUMObjectData {
00310       public:
00311         YUMPrimaryData();
00312         std::string type;
00313         std::string arch;
00314         std::string checksumType;
00315         std::string checksumPkgid;
00316         std::string checksum;
00317         std::string summary;
00318         std::string description;
00319         std::string packager;
00320         std::string url;
00321         std::string timeFile;
00322         std::string timeBuild;
00323         std::string sizePackage;
00324         std::string sizeInstalled;
00325         std::string sizeArchive;
00326         Pathname location;
00327         std::string license;
00328         std::string vendor;
00329         std::string group;
00330         std::string buildhost;
00331         std::string sourcerpm;
00332         std::string headerStart;
00333         std::string headerEnd;
00334         std::list<FileData> files;
00335 
00336         // SuSE specific data
00337         std::list<std::string> authors;
00338         std::list<std::string> keywords;
00339         std::string  media;
00340         std::list<YUMDirSize> dirSizes;
00341         bool installOnly;
00342         TranslatedText license_to_confirm;
00343       };
00344 
00349       class YUMGroupData : public base::ReferenceCounted, private base::NonCopyable {
00350       public:
00351 
00352         YUMGroupData();
00353         std::string groupId;
00354         TranslatedText name;
00355         std::string default_;
00356         std::string userVisible;
00357         TranslatedText description;
00358         std::list<MetaPkg> grouplist;
00359         std::list<PackageReq> packageList;
00360       };
00361 
00366       class YUMPatternData : public YUMObjectData {
00367       public:
00368 
00369         YUMPatternData();
00370         std::string name;
00371         std::string epoch;
00372         std::string ver;
00373         std::string rel;
00374         std::string arch;
00375         TranslatedText summary;
00376         std::string default_;
00377         std::string userVisible;
00378         TranslatedText description;
00379         TranslatedText category;
00380         std::string icon;
00381         std::string script;
00382       };
00383 
00387       class YUMFileListData : public base::ReferenceCounted, private base::NonCopyable {
00388       public:
00389 
00390         YUMFileListData();
00391 
00392         std::string pkgId;
00393         std::string name;
00394         std::string arch;
00395         std::string epoch;
00396         std::string ver;
00397         std::string rel;
00398         std::list<FileData> files;
00399       };
00400 
00404       class YUMOtherData : public base::ReferenceCounted, private base::NonCopyable {
00405       public:
00406         YUMOtherData();
00407         std::string pkgId;
00408         std::string name;
00409         std::string arch;
00410         std::string epoch;
00411         std::string ver;
00412         std::string rel;
00413         std::list<ChangelogEntry> changelog;
00414       };
00415 
00416     /* ** YUMPatchData not yet finalized **/
00417 
00418       class YUMPatchData : public YUMObjectData {
00419       public:
00420         YUMPatchData();
00421         ~YUMPatchData() {
00422 
00423         }
00424 
00425         std::string patchId;
00426         std::string timestamp;
00427         std::string engine;
00428         TranslatedText summary;
00429         TranslatedText description;
00430         std::string category;
00431         bool rebootNeeded;
00432         bool packageManager;
00433         std::string updateScript;
00434         std::list<shared_ptr<YUMPatchAtom> > atoms;
00435       };
00436 
00437       class YUMPatchesData : public base::ReferenceCounted, private base::NonCopyable {
00438       public:
00439         YUMPatchesData() {};
00440         ~YUMPatchesData() {};
00441 
00442         std::string location;
00443         std::string id;
00444         std::string checksumType;
00445         std::string checksum;
00446       };
00447 
00448       class YUMProductData : public YUMObjectData {
00449       public:
00450         YUMProductData() {};
00451          ~YUMProductData() {};
00452 
00453         std::string type;
00454         std::string vendor;
00455         std::string name; 
00456         TranslatedText summary;
00457         TranslatedText description;
00458         TranslatedText short_name;
00459         // those are suse specific tags
00460         std::string releasenotesurl;
00461       };
00462 
00463       /* Easy output */
00464       std::ostream& operator<<(std::ostream &out, const YUMDependency& data);
00465       std::ostream& operator<<(std::ostream &out, const YUMDirSize& data);
00466       std::ostream& operator<<(std::ostream &out, const YUMRepomdData& data);
00467       std::ostream& operator<<(std::ostream &out, const FileData& data);
00468       std::ostream& operator<<(std::ostream &out, const MetaPkg& data);
00469       std::ostream& operator<<(std::ostream &out, const PackageReq& data);
00470       std::ostream& operator<<(std::ostream &out, const ChangelogEntry& data);
00471       std::ostream& operator<<(std::ostream &out, const YUMRepomdData& data);
00472       std::ostream& operator<<(std::ostream &out, const YUMPrimaryData& data);
00473       std::ostream& operator<<(std::ostream &out, const YUMGroupData& data);
00474       std::ostream& operator<<(std::ostream &out, const YUMPatternData& data);
00475       std::ostream& operator<<(std::ostream &out, const YUMFileListData& data);
00476       std::ostream& operator<<(std::ostream& out, const YUMOtherData& data);
00477       std::ostream& operator<<(std::ostream& out, const YUMPatchData& data);
00478       std::ostream& operator<<(std::ostream& out, const YUMPatchesData& data);
00479       std::ostream& operator<<(std::ostream& out, const YUMProductData& data);
00480       std::ostream& operator<<(std::ostream& out, const zypp::shared_ptr<YUMPatchAtom> data);
00481       std::ostream& operator<<(std::ostream& out, const YUMPatchMessage& data);
00482       std::ostream& operator<<(std::ostream& out, const YUMPatchScript& data);
00483       std::ostream& operator<<(std::ostream& out, const YUMPatchPackage& data);
00484       std::ostream& operator<<(std::ostream& out, const YUMBaseVersion& data);
00485       std::ostream& operator<<(std::ostream& out, const YUMPlainRpm& data);
00486       std::ostream& operator<<(std::ostream& out, const YUMPatchRpm& data);
00487       std::ostream& operator<<(std::ostream& out, const YUMDeltaRpm& data);
00488 
00489     } // namespace yum
00490   } // namespace parser
00491 } // namespace zypp
00492 
00493 
00494 
00495 
00496 
00497 
00498 #endif

Generated on Thu May 4 16:03:23 2006 for zypp by  doxygen 1.4.6