00001
00002
00003
00004
00005
00006
00007
00008
00012 #ifndef ZYPP_DATA_RESOLVABLEDATA_H
00013 #define ZYPP_DATA_RESOLVABLEDATA_H
00014
00015 #include <iosfwd>
00016 #include <list>
00017
00018 #include "zypp/base/PtrTypes.h"
00019 #include "zypp/base/ReferenceCounted.h"
00020 #include "zypp/base/NonCopyable.h"
00021
00022 #include "zypp/data/RecordId.h"
00023 #include "zypp/capability/CapabilityImpl.h"
00024 #include "zypp/Pathname.h"
00025 #include "zypp/Resolvable.h"
00026 #include "zypp/NVR.h"
00027 #include "zypp/Edition.h"
00028 #include "zypp/ByteCount.h"
00029 #include "zypp/Arch.h"
00030 #include "zypp/CheckSum.h"
00031 #include "zypp/Changelog.h"
00032 #include "zypp/Url.h"
00033 #include "zypp/Date.h"
00034 #include "zypp/TranslatedText.h"
00035 #include "zypp/OnMediaLocation.h"
00036 #include "zypp/DiskUsage.h"
00037
00038 namespace zypp
00039 {
00040 namespace data
00041 {
00043 typedef std::set<capability::CapabilityImpl::Ptr> DependencyList;
00044 typedef std::map<zypp::Dep, DependencyList> Dependencies;
00045
00046 typedef DefaultIntegral<unsigned,0u> MediaNr;
00047
00049 typedef std::list<std::string> Filenames;
00050
00052
00053 DEFINE_PTR_TYPE(Resolvable);
00054
00056 class Resolvable : public base::ReferenceCounted, private base::NonCopyable
00057 {
00058 public:
00059 Resolvable()
00060 {};
00061
00063 zypp::Resolvable::Kind kind;
00065 std::string name;
00067 Edition edition;
00069 Arch arch;
00071 Dependencies deps;
00072 };
00073
00075
00076 DEFINE_PTR_TYPE(ResObject);
00077
00079 class ResObject : public Resolvable
00080 {
00081 public:
00082 ResObject()
00083 {}
00084
00086 std::string sharedDataTag;
00088 RecordId shareDataWith;
00089
00090
00092 std::string vendor;
00094 ByteCount installedSize;
00096 Date buildTime;
00097
00098
00100 DefaultIntegral<bool,false> installOnly;
00101
00102
00104 TranslatedText summary;
00106 TranslatedText description;
00108 TranslatedText licenseToConfirm;
00110 TranslatedText insnotify;
00112 TranslatedText delnotify;
00113
00114
00116 RecordId repository;
00117 protected:
00119 virtual std::ostream & dumpOn( std::ostream & str ) const;
00120 };
00121
00123
00124 DEFINE_PTR_TYPE(Atom);
00125
00126
00127 class Atom : public ResObject
00128 {
00129 public:
00130 Atom()
00131 {};
00132 };
00133
00135
00136 DEFINE_PTR_TYPE(Script);
00137
00138
00139 class Script : public ResObject
00140 {
00141 public:
00142 Script()
00143 {};
00144
00146 std::string doScript;
00148 OnMediaLocation doScriptLocation;
00149
00151 std::string undoScript;
00153 OnMediaLocation undoScriptLocation;
00154 };
00155
00157
00158 DEFINE_PTR_TYPE(Message);
00159
00160
00161 class Message : public ResObject
00162 {
00163 public:
00164 Message()
00165 {};
00166
00168 TranslatedText text;
00169 };
00170
00172
00173 DEFINE_PTR_TYPE(Patch);
00174
00175
00176 class Patch : public ResObject
00177 {
00178 public:
00179 Patch()
00180 {};
00181
00183 std::string id;
00185 Date timestamp;
00187 std::string category;
00188
00189
00191 DefaultIntegral<bool,false> rebootNeeded;
00193 DefaultIntegral<bool,false> affectsPkgManager;
00194
00196 std::string updateScript;
00197
00202 std::set<ResObject_Ptr> atoms;
00203 };
00204
00206
00207 DEFINE_PTR_TYPE(Pattern);
00208
00209
00210 class Pattern : public ResObject
00211 {
00212 public:
00213 Pattern()
00214 {}
00215
00216
00218 DefaultIntegral<bool,false> isDefault;
00220 DefaultIntegral<bool,false> userVisible;
00221
00223 TranslatedText category;
00224
00226 std::string icon;
00228 std::string order;
00230 std::string script;
00231
00233 DependencyList includes;
00235 DependencyList extends;
00236 };
00237
00239
00240 DEFINE_PTR_TYPE(Product);
00241
00242
00243 class Product : public ResObject
00244 {
00245 public:
00246 Product()
00247 {};
00248
00250 std::string type;
00251
00253 TranslatedText shortName;
00255 TranslatedText longName;
00256
00260 std::list<std::string> flags;
00261
00263 Url releasenotesUrl;
00265 std::list<Url> updateUrls;
00267 std::list<Url> extraUrls;
00269 std::list<Url> optionalUrls;
00270
00272 std::string distributionName;
00274 Edition distributionEdition;
00275 };
00276
00278
00279 DEFINE_PTR_TYPE(Packagebase);
00280
00287 class Packagebase : public ResObject
00288 {
00289 public:
00290 enum PackageType { BIN, SRC, ATOM };
00291 virtual PackageType packageType() const = 0;
00292
00293 public:
00295 std::string group;
00297 std::set<std::string> keywords;
00298
00300 Changelog changelog;
00302 std::list<std::string> authors;
00303
00304
00306 std::string buildhost;
00308 std::string distribution;
00310 std::string license;
00312 std::string packager;
00314 std::string url;
00315
00317 std::string operatingSystem;
00318
00320 std::string prein;
00322 std::string postin;
00324 std::string preun;
00326 std::string postun;
00327
00328 OnMediaLocation repositoryLocation;
00329 DiskUsage diskusage;
00330 };
00331
00332 DEFINE_PTR_TYPE(Package);
00336 struct Package : public Packagebase
00337 {
00338 virtual PackageType packageType() const { return BIN; }
00339
00341 NVR srcPackageIdent;
00342 };
00343
00344 DEFINE_PTR_TYPE(SrcPackage);
00348 struct SrcPackage : public Packagebase
00349 {
00350 virtual PackageType packageType() const { return SRC; }
00351 };
00352
00353
00354
00355
00356
00357
00358
00359 DEFINE_PTR_TYPE(BaseVersion);
00361 struct BaseVersion : public base::ReferenceCounted, private base::NonCopyable
00362 {
00363 Edition edition;
00364 };
00365
00367 struct RpmBase : public base::ReferenceCounted, private base::NonCopyable
00368 {
00369
00370
00371 std::string name;
00372 Edition edition;
00373 Arch arch;
00374 OnMediaLocation location;
00375 Date buildTime;
00376 Date fileTime;
00377 ByteCount archiveSize;
00378 protected:
00380 virtual std::ostream & dumpOn( std::ostream & str ) const;
00381 };
00382
00383 DEFINE_PTR_TYPE(PatchRpm);
00385 struct PatchRpm : RpmBase
00386 {
00387 std::set<BaseVersion_Ptr> baseVersions;
00388 };
00389
00390 DEFINE_PTR_TYPE(DeltaRpm);
00392 struct DeltaRpm : RpmBase
00393 {
00394 struct DeltaBaseVersion : BaseVersion
00395 {
00396 Date buildTime;
00397 CheckSum checkSum;
00398 std::string sequenceInfo;
00399 };
00400
00401 DeltaBaseVersion baseVersion;
00402 };
00403
00404 DEFINE_PTR_TYPE(PackageAtom);
00410 struct PackageAtom : public Package
00411 {
00412 std::set<PatchRpm_Ptr> patchRpms;
00413 std::set<DeltaRpm_Ptr> deltaRpms;
00414
00415 };
00416
00417
00418
00420
00421 }
00422 }
00423 #endif // ZYPP_DATA_RESOLVABLEDATA_H