1 /*---------------------------------------------------------------------\
3 | |__ / \ / / . \ . \ |
8 \---------------------------------------------------------------------*/
10 #include "zypp/TranslatedText.h"
11 #include "zypp/base/String.h"
12 #include "zypp/base/Logger.h"
13 #include "zypp/repo/RepositoryImpl.h"
14 #include "ProductImpl.h"
15 #include "zypp/cache/CacheAttributes.h"
19 using namespace zypp::detail;
20 using namespace::zypp::repo;
22 ///////////////////////////////////////////////////////////////////
23 namespace zypp { namespace repo { namespace cached {
25 ///////////////////////////////////////////////////////////////////
27 // CLASS NAME : ProductImpl
29 ///////////////////////////////////////////////////////////////////
33 ProductImpl::ProductImpl (const data::RecordId &id, cached::RepoImpl::Ptr repository_r)
34 : _repository (repository_r),
39 ProductImpl::repository() const
41 return _repository->selfRepository();
44 ///////////////////////////////////////////////////
45 // ResObject Attributes
46 ///////////////////////////////////////////////////
48 TranslatedText ProductImpl::summary() const
50 return _repository->resolvableQuery().queryTranslatedStringAttribute( _id, cache::attrResObjectSummary() );
53 TranslatedText ProductImpl::description() const
55 return _repository->resolvableQuery().queryTranslatedStringAttribute( _id, cache::attrResObjectDescription() );
58 TranslatedText ProductImpl::insnotify() const
60 return _repository->resolvableQuery().queryTranslatedStringAttribute( _id, cache::attrResObjectInsnotify() );
63 TranslatedText ProductImpl::delnotify() const
65 return _repository->resolvableQuery().queryTranslatedStringAttribute( _id, cache::attrResObjectDelnotify() );
68 TranslatedText ProductImpl::licenseToConfirm() const
70 return _repository->resolvableQuery().queryTranslatedStringAttribute( _id, cache::attrResObjectLicenseToConfirm() );
73 Vendor ProductImpl::vendor() const
75 return _repository->resolvableQuery().queryStringAttribute( _id, cache::attrResObjectVendor() );
79 ByteCount ProductImpl::size() const
81 return _repository->resolvableQuery().queryNumericAttribute( _id, cache::attrResObjectInstalledSize() );
84 bool ProductImpl::installOnly() const
86 return _repository->resolvableQuery().queryBooleanAttribute( _id, cache::attrResObjectInstallOnly() );
89 Date ProductImpl::buildtime() const
91 return _repository->resolvableQuery().queryNumericAttribute( _id, cache::attrResObjectBuildTime() );
94 Date ProductImpl::installtime() const
99 //////////////////////////////////////////
101 /////////////////////////////////////////
103 std::string ProductImpl::type() const
105 return _repository->resolvableQuery().queryStringAttribute( _id, cache::attrProductType() );
108 Url ProductImpl::releaseNotesUrl() const
110 return _repository->resolvableQuery().queryStringAttribute( _id, cache::attrProductReleasenotesUrl() );
113 std::list<Url> ProductImpl::updateUrls() const
116 _repository->resolvableQuery().queryStringContainerAttribute( _id, cache::attrProductUpdateUrls(), back_inserter(urls) );
120 std::list<Url> ProductImpl::extraUrls() const
123 _repository->resolvableQuery().queryStringContainerAttribute( _id, cache::attrProductExtraUrls(), back_inserter(urls) );
127 std::list<Url> ProductImpl::optionalUrls() const
130 _repository->resolvableQuery().queryStringContainerAttribute( _id, cache::attrProductOptionalUrls(), back_inserter(urls) );
134 list<string> ProductImpl::flags() const
137 _repository->resolvableQuery().queryStringContainerAttribute( _id, cache::attrProductFlags(), back_inserter(flags) );
141 TranslatedText ProductImpl::shortName() const
143 return _repository->resolvableQuery().queryTranslatedStringAttribute( _id, cache::attrProductShortName() );
146 std::string ProductImpl::distributionName() const
148 return _repository->resolvableQuery().queryStringAttribute( _id, cache::attrProductDistributionName() );
151 Edition ProductImpl::distributionEdition() const
153 return Edition( _repository->resolvableQuery().queryStringAttribute( _id, cache::attrProductDistributionEdition() ) );
156 /////////////////////////////////////////////////////////////////
157 } } } // namespace zypp::repo::cached
158 ///////////////////////////////////////////////////////////////////