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"
19 ///////////////////////////////////////////////////////////////////
21 { /////////////////////////////////////////////////////////////////
25 ///////////////////////////////////////////////////////////////////
27 { /////////////////////////////////////////////////////////////////
29 ///////////////////////////////////////////////////////////////////
31 // CLASS NAME : PackageImplIf
33 /** Abstact Package implementation interface.
35 class PackageImplIf : public ResObjectImplIf
38 typedef Package ResType;
42 CheckSum(const std::string & type, const std::string & checksum)
46 std::string type() { return _type; }
47 std::string checksum() { return _checksum; }
50 std::string _checksum;
55 BaseVersion(const Edition & edition,
56 const CheckSum & checksum,
57 const Date & buildtime)
60 , _buildtime(buildtime)
62 Edition edition() const { return _edition; }
63 CheckSum checksum() const { return _checksum; }
64 Date buildtime() const { return _buildtime; }
67 PackageImplIf::CheckSum _checksum;
73 DeltaRpm(const Arch & arch,
74 const std::string & filename,
75 const FSize & downloadsize,
76 const CheckSum & checksum,
77 const Date & buildtime,
78 const BaseVersion & base_version)
81 , _downloadsize(downloadsize)
83 , _buildtime(buildtime)
84 , _base_version(base_version)
86 Arch arch() { return _arch; }
87 std::string filename() { return _filename; }
88 FSize downloadsize() { return _downloadsize; }
89 CheckSum checksum() { return _checksum; }
90 Date buildtime() { return _buildtime; }
91 BaseVersion baseVersion() { return _base_version; }
94 std::string _filename;
98 BaseVersion _base_version;
103 PatchRpm(const Arch & arch,
104 const std::string & filename,
105 const FSize & downloadsize,
106 const CheckSum & checksum,
107 const Date & buildtime,
108 const std::list<BaseVersion> & base_versions)
110 , _filename(filename)
111 , _downloadsize(downloadsize)
112 , _checksum(checksum)
113 , _buildtime(buildtime)
114 , _base_versions(base_versions)
116 Arch arch() { return _arch; }
117 std::string filename() { return _filename; }
118 FSize downloadsize() { return _downloadsize; }
119 CheckSum checksum() { return _checksum; }
120 Date buildtime() { return _buildtime; }
121 std::list<BaseVersion> baseVersions() { return _base_versions; }
124 std::string _filename;
128 std::list<BaseVersion> _base_versions;
133 * @short Holds data about how much space will be needed per directory
138 DirSize(const std::string& path,
139 const std::string& size,
140 const std::string& fileCount)
141 : path(path), sizeKByte(size), fileCount(fileCount)
143 const std::string path;
144 const std::string sizeKByte;
145 const std::string fileCount;
149 * @short Holds Data about file and file type
157 FileData(const std::string &name,
158 const std::string &type)
159 : name(name), type(type)
165 /** \name Rpm Package Attributes. */
168 virtual Date buildtime() const PURE_VIRTUAL;
170 virtual std::string buildhost() const PURE_VIRTUAL;
172 virtual Date installtime() const PURE_VIRTUAL;
174 virtual std::string distribution() const PURE_VIRTUAL;
176 virtual Vendor vendor() const PURE_VIRTUAL;
178 virtual Label license() const PURE_VIRTUAL;
180 virtual std::string packager() const PURE_VIRTUAL;
182 virtual PackageGroup group() const PURE_VIRTUAL;
184 virtual Text changelog() const PURE_VIRTUAL;
185 /** Don't ship it as class Url, because it might be
186 * in fact anything but a legal Url. */
187 virtual std::string url() const PURE_VIRTUAL;
189 virtual std::string os() const PURE_VIRTUAL;
191 virtual Text prein() const PURE_VIRTUAL;
193 virtual Text postin() const PURE_VIRTUAL;
195 virtual Text preun() const PURE_VIRTUAL;
197 virtual Text postun() const PURE_VIRTUAL;
199 virtual FSize sourcesize() const PURE_VIRTUAL;
201 virtual FSize archivesize() const PURE_VIRTUAL;
203 virtual Text authors() const PURE_VIRTUAL;
205 virtual Text filenames() const PURE_VIRTUAL;
208 /** \name Additional Package Attributes.
209 * \todo review what's actually needed here. Maybe worth grouping
210 * all the package rertieval related stuff in a class. Easier to ship
215 virtual License licenseToConfirm() const PURE_VIRTUAL;
218 virtual std::string sourceloc() const PURE_VIRTUAL;
220 virtual void du( PkgDu & dudata_r ) const PURE_VIRTUAL;
222 virtual std::string location() const PURE_VIRTUAL;
224 virtual unsigned int medianr() const PURE_VIRTUAL;
226 virtual PackageKeywords keywords() const PURE_VIRTUAL;
228 virtual std::string md5sum() const PURE_VIRTUAL;
230 virtual std::string externalUrl() const PURE_VIRTUAL;
232 virtual std::list<Edition> patchRpmBaseVersions() const PURE_VIRTUAL;
234 virtual FSize patchRpmSize() const PURE_VIRTUAL;
236 virtual bool forceInstall() const PURE_VIRTUAL;
238 virtual std::string patchRpmMD5() const PURE_VIRTUAL;
240 virtual bool isRemote() const PURE_VIRTUAL;
242 virtual PMError providePkgToInstall( Pathname& path_r ) const PURE_VIRTUAL;
244 virtual PMError provideSrcPkgToInstall( Pathname& path_r ) const PURE_VIRTUAL;
246 virtual constInstSrcPtr source() const PURE_VIRTUAL;
248 virtual std::list<PMPackageDelta> deltas() const PURE_VIRTUAL;
252 ///////////////////////////////////////////////////////////////////
254 /////////////////////////////////////////////////////////////////
255 } // namespace detail
256 ///////////////////////////////////////////////////////////////////
257 /////////////////////////////////////////////////////////////////
259 ///////////////////////////////////////////////////////////////////
260 #endif // ZYPP_DETAIL_PACKAGEIMPLIF_H