ProductImpl.cc

Go to the documentation of this file.
00001 /*---------------------------------------------------------------------\
00002 |                          ____ _   __ __ ___                          |
00003 |                         |__  / \ / / . \ . \                         |
00004 |                           / / \ V /|  _/  _/                         |
00005 |                          / /__ | | | | | |                           |
00006 |                         /_____||_| |_| |_|                           |
00007 |                                                                      |
00008 \---------------------------------------------------------------------*/
00009 
00010 #include "zypp/TranslatedText.h"
00011 #include "zypp/base/String.h"
00012 #include "zypp/base/Logger.h"
00013 #include "zypp/repo/RepositoryImpl.h"
00014 #include "ProductImpl.h"
00015 #include "zypp/cache/CacheAttributes.h"
00016 
00017 
00018 using namespace std;
00019 using namespace zypp::detail;
00020 using namespace::zypp::repo;
00021 
00023 namespace zypp { namespace repo { namespace cached {
00024 
00026 //
00027 //        CLASS NAME : ProductImpl
00028 //
00030 
00033 ProductImpl::ProductImpl (const data::RecordId &id, cached::RepoImpl::Ptr repository_r)
00034     : _repository (repository_r),
00035       _id(id)
00036 {}
00037 
00038 Repository
00039 ProductImpl::repository() const
00040 {
00041   return _repository->selfRepository();
00042 }
00043 
00045 // ResObject Attributes
00047 
00048 TranslatedText ProductImpl::summary() const
00049 {
00050   return _repository->resolvableQuery().queryTranslatedStringAttribute( _id, cache::attrResObjectSummary() );
00051 }
00052 
00053 TranslatedText ProductImpl::description() const
00054 {
00055   return _repository->resolvableQuery().queryTranslatedStringAttribute( _id, cache::attrResObjectDescription() );
00056 }
00057 
00058 TranslatedText ProductImpl::insnotify() const
00059 {
00060   return _repository->resolvableQuery().queryTranslatedStringAttribute( _id, cache::attrResObjectInsnotify() );
00061 }
00062 
00063 TranslatedText ProductImpl::delnotify() const
00064 {
00065   return _repository->resolvableQuery().queryTranslatedStringAttribute( _id, cache::attrResObjectDelnotify() );
00066 }
00067 
00068 TranslatedText ProductImpl::licenseToConfirm() const
00069 {
00070   return _repository->resolvableQuery().queryTranslatedStringAttribute( _id, cache::attrResObjectLicenseToConfirm() );
00071 }
00072 
00073 Vendor ProductImpl::vendor() const
00074 {
00075   return _repository->resolvableQuery().queryStringAttribute( _id, cache::attrResObjectVendor() );
00076 }
00077 
00078 
00079 ByteCount ProductImpl::size() const
00080 {
00081   return _repository->resolvableQuery().queryNumericAttribute( _id, cache::attrResObjectInstalledSize() );
00082 }
00083 
00084 bool ProductImpl::installOnly() const
00085 {
00086   return _repository->resolvableQuery().queryBooleanAttribute( _id, cache::attrResObjectInstallOnly() );
00087 }
00088 
00089 Date ProductImpl::buildtime() const
00090 {
00091   return _repository->resolvableQuery().queryNumericAttribute( _id, cache::attrResObjectBuildTime() );
00092 }
00093 
00094 Date ProductImpl::installtime() const
00095 {
00096   return Date();
00097 }
00098 
00100 // PRODUCT
00102 
00103 std::string ProductImpl::type() const
00104 {
00105   return _repository->resolvableQuery().queryStringAttribute( _id, cache::attrProductType() );
00106 }
00107 
00108 Url ProductImpl::releaseNotesUrl() const
00109 {
00110   return _repository->resolvableQuery().queryStringAttribute( _id, cache::attrProductReleasenotesUrl() );
00111 }
00112 
00113 std::list<Url> ProductImpl::updateUrls() const
00114 {
00115   std::list<Url> urls;
00116   _repository->resolvableQuery().queryStringContainerAttribute( _id, cache::attrProductUpdateUrls(), back_inserter(urls) );
00117   return urls;
00118 }
00119 
00120 std::list<Url> ProductImpl::extraUrls() const
00121 {
00122   std::list<Url> urls;
00123   _repository->resolvableQuery().queryStringContainerAttribute( _id, cache::attrProductExtraUrls(), back_inserter(urls) );
00124   return urls;
00125 }
00126 
00127 std::list<Url> ProductImpl::optionalUrls() const
00128 {
00129   std::list<Url> urls;
00130   _repository->resolvableQuery().queryStringContainerAttribute( _id, cache::attrProductOptionalUrls(), back_inserter(urls) );
00131   return urls;
00132 }
00133 
00134 list<string> ProductImpl::flags() const
00135 {
00136   list<string> flags;
00137   _repository->resolvableQuery().queryStringContainerAttribute( _id, cache::attrProductFlags(), back_inserter(flags) );
00138   return flags;
00139 }
00140 
00141 TranslatedText ProductImpl::shortName() const
00142 {
00143   return _repository->resolvableQuery().queryTranslatedStringAttribute( _id, cache::attrProductShortName() );
00144 }
00145 
00146 std::string ProductImpl::distributionName() const
00147 {
00148   return _repository->resolvableQuery().queryStringAttribute( _id, cache::attrProductDistributionName() );
00149 }
00150 
00151 Edition ProductImpl::distributionEdition() const
00152 {
00153   return _repository->resolvableQuery().queryStringAttribute( _id, cache::attrProductDistributionEdition() );
00154 }
00155 
00157 } } } // namespace zypp::repo::cached
00159 

Generated on Tue Sep 25 19:23:01 2007 for libzypp by  doxygen 1.5.3