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         _installtime(data->tag_installtime()),
00045         _buildhost(data->tag_buildhost()),
00046         _url(data->tag_url()),
00047         _vendor(data->tag_vendor()),
00048         _license(data->tag_license()),
00049         _packager(data->tag_packager()),
00050         _group(data->tag_group()),
00051         _changelog(data->tag_changelog()),
00052         _type("rpm"), // FIXME in the future
00053 //      _authors(data->authors),
00054 //      _keywords(data->keywords),
00055         _filenames(data->tag_filenames()),
00056 //      _disk_usage(data->diskusage),
00057         _size(data->tag_size()),
00058         _archivesize(data->tag_archivesize())
00059 #if 0
00060         _size_installed( strtol(parsed.sizeInstalled.c_str(), 0, 10)),
00061         _sourcepkg( parsed.sourcerpm),
00062         _dir_sizes(parsed.dirSizes),
00063 #endif
00064       {
00065         // we know we are reading english.
00066         _description.setText(data->tag_description(), Locale("en"));
00067         data->tag_du(_disk_usage);
00068       }
00069 
00071       TranslatedText RPMPackageImpl::summary() const
00072       { return _summary; }
00073 
00075       TranslatedText RPMPackageImpl::description() const
00076       { return _description; }
00077 
00078       ByteCount RPMPackageImpl::size() const
00079       { return _size; }
00080 
00082       Date RPMPackageImpl::buildtime() const
00083       { return _buildtime; }
00084 
00086       std::string RPMPackageImpl::buildhost() const
00087       { return _buildhost; }
00088 
00090       Date RPMPackageImpl::installtime() const
00091       { return _installtime; }
00092 
00094       std::string RPMPackageImpl::distribution() const
00095 #warning fixme
00096       { return string(); }
00097 
00099       Vendor RPMPackageImpl::vendor() const
00100       { return _vendor; }
00101 
00103       Label RPMPackageImpl::license() const
00104       { return _license; }
00105 
00107       std::string RPMPackageImpl::packager() const
00108       { return _packager; }
00109 
00111       PackageGroup RPMPackageImpl::group() const
00112       { return _group; }
00113 
00115       Changelog RPMPackageImpl::changelog() const
00116       { return _changelog; }
00117 
00119       Pathname RPMPackageImpl::location() const
00120       { return _location; }
00121 
00124       std::string RPMPackageImpl::url() const
00125       { return _url; }
00126 
00128       std::string RPMPackageImpl::os() const
00129       // metadata doesn't priovide this attribute
00130       { return PackageImplIf::os(); }
00131 
00133       Text RPMPackageImpl::prein() const
00134       // metadata doesn't priovide this attribute
00135       { return PackageImplIf::prein(); }
00136 
00138       Text RPMPackageImpl::postin() const
00139       // metadata doesn't priovide this attribute
00140       { return PackageImplIf::postin(); }
00141 
00143       Text RPMPackageImpl::preun() const
00144       // metadata doesn't priovide this attribute
00145       { return PackageImplIf::preun(); }
00146 
00148       Text RPMPackageImpl::postun() const
00149       // metadata doesn't priovide this attribute
00150       { return PackageImplIf::postun(); }
00151 
00153       ByteCount RPMPackageImpl::sourcesize() const
00154 #warning fixme
00155       { return 0; }
00156 
00158       ByteCount RPMPackageImpl::archivesize() const
00159       { return _archivesize; }
00160 
00162       std::list<std::string> RPMPackageImpl::authors() const
00163       { return _authors; }
00164 
00166       std::list<std::string> RPMPackageImpl::filenames() const
00167       { return _filenames; }
00168 
00170       std::string RPMPackageImpl::type() const
00171       { return _type; }
00172 
00174       std::list<std::string> RPMPackageImpl::keywords() const
00175       { return _keywords; }
00176 
00178       DiskUsage RPMPackageImpl::diskUsage() const
00179       { return _disk_usage; }
00180 
00182       Source_Ref RPMPackageImpl::source() const
00183       { return _source; }
00184 
00185     } // namespace rpm
00187   } // namespace target
00190 } // namespace zypp

Generated on Thu Jul 6 00:07:26 2006 for zypp by  doxygen 1.4.6