1 /*---------------------------------------------------------------------\
3 | |__ / \ / / . \ . \ |
8 \---------------------------------------------------------------------*/
9 /** \file zypp/detail/PackageImplIf.h
12 #ifndef ZYPP_DETAIL_PACKAGEIMPLIF_H
13 #define ZYPP_DETAIL_PACKAGEIMPLIF_H
15 #include "zypp/detail/ResObjectImplIf.h"
16 #include "zypp/Edition.h"
17 #include "zypp/Arch.h"
18 #include "zypp/Changelog.h"
20 ///////////////////////////////////////////////////////////////////
22 { /////////////////////////////////////////////////////////////////
26 ///////////////////////////////////////////////////////////////////
28 { /////////////////////////////////////////////////////////////////
30 ///////////////////////////////////////////////////////////////////
32 // CLASS NAME : PackageImplIf
34 /** Abstact Package implementation interface.
36 class PackageImplIf : public ResObjectImplIf
39 typedef Package ResType;
43 CheckSum(const std::string & type, const std::string & checksum)
47 std::string type() { return _type; }
48 std::string checksum() { return _checksum; }
51 std::string _checksum;
56 BaseVersion(const Edition & edition,
57 const CheckSum & checksum,
58 const Date & buildtime)
61 , _buildtime(buildtime)
63 Edition edition() const { return _edition; }
64 CheckSum checksum() const { return _checksum; }
65 Date buildtime() const { return _buildtime; }
68 PackageImplIf::CheckSum _checksum;
74 DeltaRpm(const Arch & arch,
75 const std::string & filename,
76 const FSize & downloadsize,
77 const CheckSum & checksum,
78 const Date & buildtime,
79 const BaseVersion & base_version)
82 , _downloadsize(downloadsize)
84 , _buildtime(buildtime)
85 , _base_version(base_version)
87 Arch arch() { return _arch; }
88 std::string filename() { return _filename; }
89 FSize downloadsize() { return _downloadsize; }
90 CheckSum checksum() { return _checksum; }
91 Date buildtime() { return _buildtime; }
92 BaseVersion baseVersion() { return _base_version; }
95 std::string _filename;
99 BaseVersion _base_version;
104 PatchRpm(const Arch & arch,
105 const std::string & filename,
106 const FSize & downloadsize,
107 const CheckSum & checksum,
108 const Date & buildtime,
109 const std::list<BaseVersion> & base_versions)
111 , _filename(filename)
112 , _downloadsize(downloadsize)
113 , _checksum(checksum)
114 , _buildtime(buildtime)
115 , _base_versions(base_versions)
117 Arch arch() { return _arch; }
118 std::string filename() { return _filename; }
119 FSize downloadsize() { return _downloadsize; }
120 CheckSum checksum() { return _checksum; }
121 Date buildtime() { return _buildtime; }
122 std::list<BaseVersion> baseVersions() { return _base_versions; }
125 std::string _filename;
129 std::list<BaseVersion> _base_versions;
134 * @short Holds data about how much space will be needed per directory
139 DirSize(const std::string& path,
140 const std::string& size,
141 const std::string& fileCount)
142 : path(path), sizeKByte(size), fileCount(fileCount)
144 const std::string path;
145 const std::string sizeKByte;
146 const std::string fileCount;
150 * @short Holds Data about file and file type
158 FileData(const std::string &name,
159 const std::string &type)
160 : name(name), type(type)
166 /** \name Rpm Package Attributes. */
169 virtual Date buildtime() const PURE_VIRTUAL;
171 virtual std::string buildhost() const PURE_VIRTUAL;
173 virtual Date installtime() const PURE_VIRTUAL;
175 virtual std::string distribution() const PURE_VIRTUAL;
177 virtual Vendor vendor() const PURE_VIRTUAL;
179 virtual Label license() const PURE_VIRTUAL;
181 virtual std::string packager() const PURE_VIRTUAL;
183 virtual PackageGroup group() const PURE_VIRTUAL;
185 virtual Changelog changelog() const PURE_VIRTUAL;
186 /** Don't ship it as class Url, because it might be
187 * in fact anything but a legal Url. */
188 virtual std::string url() const PURE_VIRTUAL;
190 virtual std::string os() const PURE_VIRTUAL;
192 virtual Text prein() const PURE_VIRTUAL;
194 virtual Text postin() const PURE_VIRTUAL;
196 virtual Text preun() const PURE_VIRTUAL;
198 virtual Text postun() const PURE_VIRTUAL;
200 virtual FSize sourcesize() const PURE_VIRTUAL;
202 virtual FSize archivesize() const PURE_VIRTUAL;
204 virtual Text authors() const PURE_VIRTUAL;
206 virtual Text filenames() const PURE_VIRTUAL;
209 /** \name Additional Package Attributes.
210 * \todo review what's actually needed here. Maybe worth grouping
211 * all the package rertieval related stuff in a class. Easier to ship
216 virtual License licenseToConfirm() const PURE_VIRTUAL;
219 virtual std::string sourceloc() const PURE_VIRTUAL;
221 virtual void du( PkgDu & dudata_r ) const PURE_VIRTUAL;
223 virtual std::string location() const PURE_VIRTUAL;
225 virtual unsigned int medianr() const PURE_VIRTUAL;
227 virtual PackageKeywords keywords() const PURE_VIRTUAL;
229 virtual std::string md5sum() const PURE_VIRTUAL;
231 virtual std::string externalUrl() const PURE_VIRTUAL;
233 virtual std::list<Edition> patchRpmBaseVersions() const PURE_VIRTUAL;
235 virtual FSize patchRpmSize() const PURE_VIRTUAL;
237 virtual bool forceInstall() const PURE_VIRTUAL;
239 virtual std::string patchRpmMD5() const PURE_VIRTUAL;
241 virtual bool isRemote() const PURE_VIRTUAL;
243 virtual PMError providePkgToInstall( Pathname& path_r ) const PURE_VIRTUAL;
245 virtual PMError provideSrcPkgToInstall( Pathname& path_r ) const PURE_VIRTUAL;
247 virtual constInstSrcPtr source() const PURE_VIRTUAL;
249 virtual std::list<PMPackageDelta> deltas() const PURE_VIRTUAL;
253 ///////////////////////////////////////////////////////////////////
255 /////////////////////////////////////////////////////////////////
256 } // namespace detail
257 ///////////////////////////////////////////////////////////////////
258 /////////////////////////////////////////////////////////////////
260 ///////////////////////////////////////////////////////////////////
261 #endif // ZYPP_DETAIL_PACKAGEIMPLIF_H