RpmPackageImpl.cc

Go to the documentation of this file.
00001 /*---------------------------------------------------------------------\
00002 |                          ____ _   __ __ ___                          |
00003 |                         |__  / \ / / . \ . \                         |
00004 |                           / / \ V /|  _/  _/                         |
00005 |                          / /__ | | | | | |                           |
00006 |                         /_____||_| |_| |_|                           |
00007 |                                                                      |
00008 \---------------------------------------------------------------------*/
00013 #include "zypp/target/rpm/RpmPackageImpl.h"
00014 #include "zypp/base/String.h"
00015 #include "zypp/base/Logger.h"
00016 
00017 #include <list>
00018 #include <string>
00019 
00020 using namespace std;
00021 using namespace zypp::detail;
00022 
00024 namespace zypp
00025 { 
00026 
00027   namespace target
00028   { 
00029     namespace rpm
00030     {
00032       //
00033       //        CLASS NAME : RPMPackageImpl
00034       //
00036 
00037 
00038       RPMPackageImpl::RPMPackageImpl(
00039         const RpmHeader::constPtr data
00040       )
00041         : _summary(data->tag_summary(), Locale("en")),
00042         _description(),
00043         _buildtime(data->tag_buildtime()),
00044         _buildhost(data->tag_buildhost()),
00045         _url(data->tag_url()),
00046         _vendor(data->tag_vendor()),
00047         _license(data->tag_license()),
00048         _packager(data->tag_packager()),
00049         _group(data->tag_group()),
00050         _changelog(data->tag_changelog()),
00051         _type("rpm"), // FIXME in the future
00052 //      _authors(data->authors),
00053 //      _keywords(data->keywords),
00054         _filenames(data->tag_filenames()),
00055 //      _disk_usage(data->diskusage),
00056         _size(data->tag_size()),
00057         _archivesize(data->tag_archivesize())
00058 #if 0
00059         _size_installed( strtol(parsed.sizeInstalled.c_str(), 0, 10)),
00060         _sourcepkg( parsed.sourcerpm),
00061         _dir_sizes(parsed.dirSizes),
00062 #endif
00063       {
00064         // we know we are reading english.
00065         _description.setText(data->tag_description(), Locale("en"));
00066         data->tag_du(_disk_usage);
00067       }
00068 
00070       TranslatedText RPMPackageImpl::summary() const
00071       { return _summary; }
00072 
00074       TranslatedText RPMPackageImpl::description() const
00075       { return _description; }
00076 
00077       ByteCount RPMPackageImpl::size() const
00078       { return _size; }
00079 
00080       bool RPMPackageImpl::providesSources() const
00081       { return ResObjectImplIf::providesSources(); }
00082 
00083       Label RPMPackageImpl::instSrcLabel() const
00084       { return ResObjectImplIf::instSrcLabel(); }
00085 
00086       Vendor RPMPackageImpl::instSrcVendor() const
00087       { return ResObjectImplIf::instSrcVendor(); }
00088 
00090       Date RPMPackageImpl::buildtime() const
00091       { return _buildtime; }
00092 
00094       std::string RPMPackageImpl::buildhost() const
00095       { return _buildhost; }
00096 
00098       Date RPMPackageImpl::installtime() const
00099       { return PackageImplIf::installtime(); }
00100 
00102       std::string RPMPackageImpl::distribution() const
00103 #warning fixme
00104       { return string(); }
00105 
00107       Vendor RPMPackageImpl::vendor() const
00108       { return _vendor; }
00109 
00111       Label RPMPackageImpl::license() const
00112       { return _license; }
00113 
00115       std::string RPMPackageImpl::packager() const
00116       { return _packager; }
00117 
00119       PackageGroup RPMPackageImpl::group() const
00120       { return _group; }
00121 
00123       Changelog RPMPackageImpl::changelog() const
00124       { return _changelog; }
00125 
00127       Pathname RPMPackageImpl::location() const
00128       { return _location; }
00129 
00132       std::string RPMPackageImpl::url() const
00133       { return _url; }
00134 
00136       std::string RPMPackageImpl::os() const
00137       // metadata doesn't priovide this attribute
00138       { return PackageImplIf::os(); }
00139 
00141       Text RPMPackageImpl::prein() const
00142       // metadata doesn't priovide this attribute
00143       { return PackageImplIf::prein(); }
00144 
00146       Text RPMPackageImpl::postin() const
00147       // metadata doesn't priovide this attribute
00148       { return PackageImplIf::postin(); }
00149 
00151       Text RPMPackageImpl::preun() const
00152       // metadata doesn't priovide this attribute
00153       { return PackageImplIf::preun(); }
00154 
00156       Text RPMPackageImpl::postun() const
00157       // metadata doesn't priovide this attribute
00158       { return PackageImplIf::postun(); }
00159 
00161       ByteCount RPMPackageImpl::sourcesize() const
00162 #warning fixme
00163       { return 0; }
00164 
00166       ByteCount RPMPackageImpl::archivesize() const
00167       { return _archivesize; }
00168 
00170       std::list<std::string> RPMPackageImpl::authors() const
00171       { return _authors; }
00172 
00174       std::list<std::string> RPMPackageImpl::filenames() const
00175       { return _filenames; }
00176 
00177       License RPMPackageImpl::licenseToConfirm() const
00178       { return _license_to_confirm; }
00179 
00181       std::string RPMPackageImpl::type() const
00182       { return _type; }
00183 
00185       std::list<std::string> RPMPackageImpl::keywords() const
00186       { return _keywords; }
00187 
00189       DiskUsage RPMPackageImpl::diskUsage() const
00190       { return _disk_usage; }
00191 
00193       Source_Ref RPMPackageImpl::source() const
00194       { return _source; }
00195 #if 0
00196 
00197       unsigned RPMPackageImpl::packageSize() const
00198       { return _size_package; }
00200       unsigned RPMPackageImpl::archiveSize() const
00201       { return _size_archive; }
00203       unsigned RPMPackageImpl::installedSize() const
00204       { return _size_installed; }
00205 // FIXME do not understand items below
00207       bool RPMPackageImpl::providesSources() const
00208       {
00209         return false;
00210       }
00212       std::string RPMPackageImpl::instSrcLabel() const
00213       {
00214         return "";
00215       }
00217       std::string RPMPackageImpl::instSrcVendor() const
00218       {
00219         return "";
00220       }
00222       unsigned RPMPackageImpl::instSrcRank() const
00223       {
00224         return 0;
00225       }
00227       std::string RPMPackageImpl::buildhost() const
00228       {
00229         return _buildhost;
00230       }
00232       std::string RPMPackageImpl::distribution() const
00233       {
00234         return "";
00235       }
00237       std::string RPMPackageImpl::vendor() const
00238       {
00239         return _vendor;
00240       }
00242       std::string RPMPackageImpl::license() const
00243       {
00244         return _license;
00245       }
00247       std::list<std::string> RPMPackageImpl::licenseToConfirm() const
00248       {
00249         return std::list<std::string>();
00250       }
00252       std::string RPMPackageImpl::packager() const
00253       {
00254         return _packager;
00255       }
00257       std::string RPMPackageImpl::group() const
00258       {
00259         return _group;
00260       }
00262       std::list<std::string> RPMPackageImpl::changelog() const
00263       {}
00265       std::string RPMPackageImpl::url() const
00266       {
00267         return _url;
00268       }
00270       std::string RPMPackageImpl::os() const
00271       {}
00273       std::list<std::string> RPMPackageImpl::prein() const
00274       {}
00276       std::list<std::string> RPMPackageImpl::postin() const
00277       {}
00279       std::list<std::string> RPMPackageImpl::preun() const
00280       {}
00282       std::list<std::string> RPMPackageImpl::postun() const
00283       {}
00285       std::string RPMPackageImpl::sourcepkg() const
00286       { return _sourcepkg; }
00288       std::list<std::string> RPMPackageImpl::authors() const
00289       { return _authors; }
00291       std::list<std::string> RPMPackageImpl::filenames() const
00292       {}
00294       std::list<std::string> RPMPackageImpl::recommends() const
00295       {}
00297       std::list<std::string> RPMPackageImpl::suggests() const
00298       {}
00300       std::string RPMPackageImpl::location() const
00301       {}
00303       std::string RPMPackageImpl::md5sum() const
00304       {}
00306       std::string RPMPackageImpl::externalUrl() const
00307       {}
00309       std::list<Edition> RPMPackageImpl::patchRpmBaseVersions() const
00310       {}
00312       unsigned RPMPackageImpl::patchRpmSize() const
00313       {}
00315       bool RPMPackageImpl::forceInstall() const
00316       {}
00318       std::string RPMPackageImpl::patchRpmMD5() const
00319       {}
00321       bool RPMPackageImpl::isRemote() const
00322       {}
00324       bool RPMPackageImpl::prefererCandidate() const
00325       {}
00326 
00327 #endif
00328 
00329     } // namespace rpm
00331   } // namespace target
00334 } // namespace zypp

Generated on Thu May 4 16:03:30 2006 for zypp by  doxygen 1.4.6