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

Generated on Thu Jul 6 00:07:21 2006 for zypp by  doxygen 1.4.6