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 {
00036 namespace parser
00037 {
00038 namespace yum
00039 {
00040 
00041 DEFINE_PTR_TYPE( YUMRepomdData );
00042 DEFINE_PTR_TYPE( YUMPrimaryData );
00043 DEFINE_PTR_TYPE( YUMGroupData );
00044 DEFINE_PTR_TYPE( YUMPatternData );
00045 DEFINE_PTR_TYPE( YUMFileListData );
00046 DEFINE_PTR_TYPE( YUMOtherData );
00047 DEFINE_PTR_TYPE( YUMPatchData );
00048 DEFINE_PTR_TYPE( YUMPatchesData );
00049 DEFINE_PTR_TYPE( YUMProductData );
00050 DEFINE_PTR_TYPE( YUMPatchPackage );
00051 DEFINE_PTR_TYPE( YUMPatchScript );
00052 DEFINE_PTR_TYPE( YUMPatchMessage );
00053 
00057 class YUMDependency
00058 {
00059 public:
00060   YUMDependency();
00061   YUMDependency(const std::string& kind,
00062                 const std::string& name,
00063                 const std::string& flags,
00064                 const std::string& epoch,
00065                 const std::string& ver,
00066                 const std::string& rel,
00067                 const std::string& pre );
00068   YUMDependency(const std::string& kind,
00069                 const std::string& encoded );
00070   bool isEncoded() const;
00071   std::string kind;
00072   std::string name;
00073   std::string flags;
00074   std::string epoch;
00075   std::string ver;
00076   std::string rel;
00077   std::string pre;
00078   // in case we only store the encoded string
00079   std::string encoded;
00080 };
00081 
00085 class YUMDirSize
00086 {
00087 public:
00088   YUMDirSize();
00089   YUMDirSize(const std::string& path,
00090              const std::string& size,
00091              const std::string& fileCount);
00092   const std::string path;
00093   const std::string sizeKByte;
00094   const std::string fileCount;
00095 };
00096 
00101 class FileData
00102 {
00103 public:
00104   std::string name;
00105   std::string type;
00106   FileData();
00107   FileData(const std::string &name,
00108            const std::string &type);
00109 };
00110 
00115 class MetaPkg
00116 {
00117 public:
00118   MetaPkg();
00119   MetaPkg(const std::string& type,
00120           const std::string& name);
00121   std::string type;
00122   std::string name;
00123 };
00124 
00129 class PackageReq
00130 {
00131 public:
00132   PackageReq();
00133   PackageReq(const std::string& type,
00134              const std::string& epoch,
00135              const std::string& ver,
00136              const std::string& rel,
00137              const std::string& name);
00138   std::string type;
00139   std::string epoch;
00140   std::string ver;
00141   std::string rel;
00142   std::string name;
00143 };
00144 
00148 class ChangelogEntry
00149 {
00150 public:
00151   ChangelogEntry();
00152   ChangelogEntry(const std::string& author,
00153                  const std::string& date,
00154                  const std::string& entry);
00155   std::string author;
00156   std::string date;
00157   std::string entry;
00158 };
00159 
00160 class YUMObjectData : public base::ReferenceCounted, private base::NonCopyable
00161 {
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 {
00183 public:
00184   enum AtomType { Package, Script, Message };
00185   virtual AtomType atomType() = 0;
00186 };
00187 
00188 class YUMPlainRpm
00189 {
00190 public:
00191   std::string arch;
00192   std::string filename;
00193   std::string downloadsize;
00194   std::string md5sum;
00195   std::string buildtime;
00196 };
00197 
00198 struct YUMEdition
00199 {
00200   std::string epoch;
00201   std::string ver;
00202   std::string rel;
00203 };
00204 std::ostream& operator<<(std::ostream& out, const YUMEdition& data);
00205 
00206 struct YUMPatchBaseVersion
00207 {
00208   YUMEdition edition;
00209 };
00210 std::ostream& operator<<(std::ostream& out, const YUMPatchBaseVersion& data);
00211 
00212 struct YUMPatchRpm
00213 {
00214   std::string arch;
00215   std::string filename;
00216   std::string downloadsize;
00217   std::string md5sum;
00218   std::string buildtime;
00219   std::list<YUMPatchBaseVersion> baseVersions;
00220   std::string checksumType;
00221   std::string checksum;
00222   std::string location;
00223   std::string media;
00224 };
00225 std::ostream& operator<<(std::ostream& out, const YUMPatchRpm& data);
00226 
00227 struct YUMDeltaBaseVersion
00228 {
00229   YUMEdition edition;
00230   std::string md5sum;
00231   std::string buildtime;
00232   std::string sequence_info;
00233 };
00234 std::ostream& operator<<(std::ostream& out, const YUMDeltaBaseVersion& data);
00235 
00236 struct YUMDeltaRpm
00237 {
00238   std::string arch;
00239   std::string filename;
00240   std::string downloadsize;
00241   std::string md5sum;
00242   std::string buildtime;
00243   YUMDeltaBaseVersion baseVersion;
00244   std::string checksumType;
00245   std::string checksum;
00246   std::string location;
00247   std::string media;
00248 };
00249 std::ostream& operator<<(std::ostream& out, const YUMDeltaRpm& data);
00250 
00251 
00252 
00253 class YUMPatchPackage : public YUMPatchAtom
00254 {
00255 public:
00256   YUMPatchPackage() : installOnly( false )
00257   {};
00258   virtual AtomType atomType()
00259   {
00260     return Package;
00261   };
00262   // data for primary
00263   std::string arch;
00264   std::string type;
00265   std::string checksumType;
00266   std::string checksumPkgid;
00267   std::string checksum;
00268   std::string summary;
00269   std::string description;
00270   std::string packager;
00271   std::string url;
00272   std::string timeFile;
00273   std::string timeBuild;
00274   std::string sizePackage;
00275   std::string sizeInstalled;
00276   std::string sizeArchive;
00277   std::string location;
00278   std::string license;
00279   TranslatedText license_to_confirm;
00280   std::string vendor;
00281   std::string group;
00282   std::string buildhost;
00283   std::string sourcerpm;
00284   std::string headerStart;
00285   std::string headerEnd;
00286   std::list<FileData> files;
00287   // SuSE specific data
00288   std::list<std::string> authors;
00289   std::list<std::string> keywords;
00290   std::string  media;
00291   std::list<YUMDirSize> dirSizes;
00292   bool installOnly;
00293   // Change Log
00294   std::list<ChangelogEntry> changelog;
00295   // Package Files
00296   std::list<YUMPlainRpm> plainRpms;
00297   std::list<YUMPatchRpm> patchRpms;
00298   std::list<YUMDeltaRpm> deltaRpms;
00299 };
00300 
00301 class YUMPatchScript : public YUMPatchAtom
00302 {
00303 public:
00304   YUMPatchScript()
00305   {};
00306   virtual AtomType atomType()
00307   {
00308     return Script;
00309   };
00310   std::string do_script;
00311   std::string undo_script;
00312   std::string do_location;
00313   std::string undo_location;
00314   std::string do_media;
00315   std::string undo_media;
00316   std::string do_checksum_type;
00317   std::string do_checksum;
00318   std::string undo_checksum_type;
00319   std::string undo_checksum;
00320 };
00321 
00322 class YUMPatchMessage : public YUMPatchAtom
00323 {
00324 public:
00325   YUMPatchMessage()
00326   {};
00327   virtual AtomType atomType()
00328   {
00329     return Message;
00330   };
00331   TranslatedText text;
00332 };
00333 
00334 
00338 class YUMRepomdData : public base::ReferenceCounted, private base::NonCopyable
00339 {
00340 public:
00341   YUMRepomdData();
00342   std::string type;
00343   std::string location;
00344   std::string checksumType;
00345   std::string checksum;
00346   std::string timestamp;
00347   std::string openChecksumType;
00348   std::string openChecksum;
00349 };
00350 
00354 class YUMPrimaryData : public YUMObjectData
00355 {
00356 public:
00357   YUMPrimaryData();
00358   std::string type;
00359   std::string arch;
00360   std::string checksumType;
00361   std::string checksumPkgid;
00362   std::string checksum;
00363   std::string summary;
00364   std::string description;
00365   std::string packager;
00366   std::string url;
00367   std::string timeFile;
00368   std::string timeBuild;
00369   std::string sizePackage;
00370   std::string sizeInstalled;
00371   std::string sizeArchive;
00372   Pathname location;
00373   std::string license;
00374   std::string vendor;
00375   std::string group;
00376   std::string buildhost;
00377   std::string sourcerpm;
00378   std::string headerStart;
00379   std::string headerEnd;
00380   std::list<FileData> files;
00381 
00382   // SuSE specific data
00383   std::list<std::string> authors;
00384   std::list<std::string> keywords;
00385   std::string  media;
00386   std::list<YUMDirSize> dirSizes;
00387   bool installOnly;
00388   TranslatedText license_to_confirm;
00389 };
00390 
00395 class YUMGroupData : public base::ReferenceCounted, private base::NonCopyable
00396 {
00397 public:
00398 
00399   YUMGroupData();
00400   std::string groupId;
00401   TranslatedText name;
00402   std::string default_;
00403   std::string userVisible;
00404   TranslatedText description;
00405   std::list<MetaPkg> grouplist;
00406   std::list<PackageReq> packageList;
00407 };
00408 
00413 class YUMPatternData : public YUMObjectData
00414 {
00415 public:
00416 
00417   YUMPatternData();
00418   std::string name;
00419   std::string epoch;
00420   std::string ver;
00421   std::string rel;
00422   std::string arch;
00423   TranslatedText summary;
00424   std::string default_;
00425   std::string userVisible;
00426   TranslatedText description;
00427   TranslatedText category;
00428   std::string icon;
00429   std::string script;
00430 };
00431 
00435 class YUMFileListData : public base::ReferenceCounted, private base::NonCopyable
00436 {
00437 public:
00438 
00439   YUMFileListData();
00440 
00441   std::string pkgId;
00442   std::string name;
00443   std::string arch;
00444   std::string epoch;
00445   std::string ver;
00446   std::string rel;
00447   std::list<FileData> files;
00448 };
00449 
00453 class YUMOtherData : public base::ReferenceCounted, private base::NonCopyable
00454 {
00455 public:
00456   YUMOtherData();
00457   std::string pkgId;
00458   std::string name;
00459   std::string arch;
00460   std::string epoch;
00461   std::string ver;
00462   std::string rel;
00463   std::list<ChangelogEntry> changelog;
00464 };
00465 
00466 /* ** YUMPatchData not yet finalized **/
00467 
00468 class YUMPatchData : public YUMObjectData
00469 {
00470 public:
00471   YUMPatchData();
00472   ~YUMPatchData()
00473   {
00474   }
00475 
00476   std::string patchId;
00477   std::string timestamp;
00478   std::string engine;
00479   TranslatedText summary;
00480   TranslatedText description;
00481   TranslatedText license_to_confirm;
00482   std::string category;
00483   bool rebootNeeded;
00484   bool packageManager;
00485   std::string updateScript;
00486   std::list<shared_ptr<YUMPatchAtom> > atoms;
00487 };
00488 
00489 class YUMPatchesData : public base::ReferenceCounted, private base::NonCopyable
00490 {
00491 public:
00492   YUMPatchesData()
00493   {};
00494   ~YUMPatchesData()
00495   {};
00496 
00497   std::string location;
00498   std::string id;
00499   std::string checksumType;
00500   std::string checksum;
00501 };
00502 
00503 class YUMProductData : public YUMObjectData
00504 {
00505 public:
00506   YUMProductData()
00507   {};
00508   ~YUMProductData()
00509   {};
00510 
00511   std::string type;
00512   std::string vendor;
00513   std::string name;
00514   TranslatedText summary;
00515   TranslatedText description;
00516   TranslatedText short_name;
00517   // those are suse specific tags
00518   std::string releasenotesurl;
00519 };
00520 
00521 /* Easy output (\todo move to class decl.) */
00522 std::ostream& operator<<(std::ostream &out, const YUMDependency& data);
00523 std::ostream& operator<<(std::ostream &out, const YUMDirSize& data);
00524 std::ostream& operator<<(std::ostream &out, const YUMRepomdData& data);
00525 std::ostream& operator<<(std::ostream &out, const FileData& data);
00526 std::ostream& operator<<(std::ostream &out, const MetaPkg& data);
00527 std::ostream& operator<<(std::ostream &out, const PackageReq& data);
00528 std::ostream& operator<<(std::ostream &out, const ChangelogEntry& data);
00529 std::ostream& operator<<(std::ostream &out, const YUMRepomdData& data);
00530 std::ostream& operator<<(std::ostream &out, const YUMPrimaryData& data);
00531 std::ostream& operator<<(std::ostream &out, const YUMGroupData& data);
00532 std::ostream& operator<<(std::ostream &out, const YUMPatternData& data);
00533 std::ostream& operator<<(std::ostream &out, const YUMFileListData& data);
00534 std::ostream& operator<<(std::ostream& out, const YUMOtherData& data);
00535 std::ostream& operator<<(std::ostream& out, const YUMPatchData& data);
00536 std::ostream& operator<<(std::ostream& out, const YUMPatchesData& data);
00537 std::ostream& operator<<(std::ostream& out, const YUMProductData& data);
00538 std::ostream& operator<<(std::ostream& out, const zypp::shared_ptr<YUMPatchAtom> data);
00539 std::ostream& operator<<(std::ostream& out, const YUMPatchMessage& data);
00540 std::ostream& operator<<(std::ostream& out, const YUMPatchScript& data);
00541 std::ostream& operator<<(std::ostream& out, const YUMPatchPackage& data);
00542 std::ostream& operator<<(std::ostream& out, const YUMPlainRpm& data);
00543 
00544 } // namespace yum
00545 } // namespace parser
00546 } // namespace zypp
00547 
00548 
00549 
00550 
00551 
00552 
00553 #endif

Generated on Tue Nov 28 16:49:30 2006 for zypp by  doxygen 1.5.0