XMLParserData.h

Go to the documentation of this file.
00001 /*---------------------------------------------------------------------\
00002 |                          ____ _   __ __ ___                          |
00003 |                         |__  / \ / / . \ . \                         |
00004 |                           / / \ V /|  _/  _/                         |
00005 |                          / /__ | | | | | |                           |
00006 |                         /_____||_| |_| |_|                           |
00007 |                                                                      |
00008 \---------------------------------------------------------------------*/
00009 
00010 #ifndef XMLParserData_h
00011 #define XMLParserData_h
00012 
00013 #include "zypp/base/ReferenceCounted.h"
00014 #include "zypp/base/NonCopyable.h"
00015 #include "zypp/Pathname.h"
00016 #include "zypp/ByteCount.h"
00017 #include "zypp/Date.h"
00018 #include "zypp/TranslatedText.h"
00019 #include <string>
00020 #include <list>
00021 #include <iosfwd>
00022 #include <zypp/base/PtrTypes.h>
00023 
00024 using namespace zypp::base;
00025 
00026 
00027 namespace zypp {
00028   namespace parser {
00029     namespace xmlstore {
00030 
00031       DEFINE_PTR_TYPE(XMLResObjectData);
00032       DEFINE_PTR_TYPE(XMLProductData);
00033       DEFINE_PTR_TYPE(XMLPatternData);
00034       DEFINE_PTR_TYPE(XMLLanguageData);
00035       DEFINE_PTR_TYPE(XMLPatchData);
00036       DEFINE_PTR_TYPE(XMLPatchAtomData);
00037       DEFINE_PTR_TYPE(XMLPatchMessageData);
00038       DEFINE_PTR_TYPE(XMLPatchScriptData);
00039 
00043       class XMLDependency {
00044       public:
00045         XMLDependency();
00046         XMLDependency(const std::string& kind, const std::string& encoded);
00047         std::string kind;
00048         std::string encoded;
00049       };
00050 
00051 
00052       class XMLResObjectData : public base::ReferenceCounted, private base::NonCopyable {
00053       public:
00054         XMLResObjectData();
00055         std::string name;
00056         std::string epoch;
00057         std::string ver;
00058         std::string rel;
00059         std::string arch;
00060         std::list<XMLDependency> provides;
00061         std::list<XMLDependency> conflicts;
00062         std::list<XMLDependency> obsoletes;
00063         std::list<XMLDependency> freshens;
00064         std::list<XMLDependency> requires;
00065         std::list<XMLDependency> prerequires;
00066         std::list<XMLDependency> recommends;
00067         std::list<XMLDependency> suggests;
00068         std::list<XMLDependency> supplements;
00069         std::list<XMLDependency> enhances;
00070 
00071         // in the future move above to XMLResolvableData
00072         TranslatedText summary;
00073         TranslatedText description;
00074 
00075         TranslatedText install_notify;
00076         TranslatedText delete_notify;
00077         TranslatedText license_to_confirm;
00078         std::string vendor;
00079         ByteCount size;
00080         ByteCount downloadSize;
00081         bool install_only;
00082         Date build_time;
00083         Date install_time;
00084 
00085       };
00086 
00090       class XMLPatternData : public XMLResObjectData
00091       {
00092       public:
00093         XMLPatternData();
00094 
00095         std::string default_;
00096         bool userVisible;
00097         TranslatedText category;
00098         std::string icon;
00099         std::string script;
00100       };
00101 
00102       class XMLLanguageData : public XMLResObjectData
00103       {
00104         public:
00105           XMLLanguageData() {};
00106           ~XMLLanguageData() {};
00107       };
00108 
00109       class XMLProductData : public XMLResObjectData
00110       {
00111       public:
00112         XMLProductData() {};
00113         ~XMLProductData() {};
00114 
00115         std::string parser_version;
00116         std::string type;
00117         TranslatedText short_name;
00118         // those are suse specific tags
00119         std::string releasenotesurl;
00120         std::list<std::string> update_urls;
00121         std::list<std::string> extra_urls;
00122         std::list<std::string> optional_urls;
00123         std::list<std::string> flags;
00124         std::string dist_name;
00125         std::string dist_version;
00126       };
00127 
00128       class XMLPatchAtomData : public XMLResObjectData
00129       {
00130         public:
00131           enum AtomType { Atom, Script, Message };
00132           virtual AtomType atomType() { return Atom; };
00133       };
00134 
00135       class XMLPatchScriptData : public XMLPatchAtomData
00136       {
00137         public:
00138           XMLPatchScriptData() {};
00139           virtual AtomType atomType() { return Script; };
00140           std::string doScript;
00141           std::string undoScript;
00142       };
00143 
00144       class XMLPatchMessageData : public XMLPatchAtomData
00145       {
00146         public:
00147           XMLPatchMessageData() {};
00148           virtual AtomType atomType() { return Message; };
00149           TranslatedText text;
00150       };
00151 
00152       class XMLPatchData : public XMLResObjectData
00153       {
00154         public:
00155           XMLPatchData() {};
00156           ~XMLPatchData()
00157           {
00158           }
00159 
00160           std::string patchId;
00161           std::string timestamp;
00162           std::string engine;
00163           std::string category;
00164           bool rebootNeeded;
00165           bool packageManager;
00166           std::string updateScript;
00167           std::list<XMLPatchAtomData_Ptr > atoms;
00168       };
00169 
00170 
00171       /* Easy output */
00172       std::ostream& operator<<(std::ostream &out, const XMLDependency& data);
00173       std::ostream& operator<<(std::ostream &out, const XMLPatternData& data);
00174       std::ostream& operator<<(std::ostream& out, const XMLProductData& data);
00175 
00176 
00177     } // namespace xmlstore
00178   } // namespace parser
00179 } // namespace zypp
00180 
00181 
00182 
00183 
00184 
00185 
00186 #endif

Generated on Tue Sep 25 19:23:03 2007 for libzypp by  doxygen 1.5.3