libzypp 17.37.10

Target.cc
Go to the documentation of this file.
1/*---------------------------------------------------------------------\
2| ____ _ __ __ ___ |
3| |__ / \ / / . \ . \ |
4| / / \ V /| _/ _/ |
5| / /__ | | | | | | |
6| /_____||_| |_| |_| |
7| |
8\---------------------------------------------------------------------*/
12#include <cassert>
13
14#include <iostream>
15
16#include <zypp/Target.h>
17#include <zypp/target/TargetImpl.h>
18
19 using std::endl;
20
22 namespace zypp
23{
24
25 IMPL_PTR_TYPE(Target);
26
28 //
29 // METHOD NAME : Target::Target
30 // METHOD TYPE : Ctor
31 //
32 Target::Target( const Pathname & root, bool doRebuild_r )
33 : _pimpl( new Impl(root,doRebuild_r) )
34 {
35 }
36
38 //
39 // METHOD NAME : Target::Target
40 // METHOD TYPE : Ctor
41 //
42 Target::Target( const Impl_Ptr & impl_r )
43 : _pimpl( impl_r )
44 {
45 assert( impl_r );
46 }
47
48 std::ostream & operator<<( std::ostream & str, const Target::DistributionLabel & obj )
49 {
50 str << "summary=" << obj.summary << endl;
51 str << "shortName=" << obj.shortName << endl;
52 return str;
53 }
54
56 //
57 // Forward to TargetImpl:
58 //
60
61 void Target::buildCache()
62 { _pimpl->buildCache(); }
63
64 void Target::cleanCache()
65 { _pimpl->clearCache(); }
66
67 void Target::load()
68 { _pimpl->load(); }
69
70 void Target::reload()
71 { _pimpl->reload(); }
72
73 void Target::unload()
74 { _pimpl->unload(); }
75
76 target::rpm::RpmDb & Target::rpmDb()
77 { return _pimpl->rpm(); }
78
79 Pathname Target::root() const
80 { return _pimpl->root(); }
81
82 bool Target::providesFile (const std::string & name_str, const std::string & path_str) const
83 { return _pimpl->providesFile (name_str, path_str); }
84
85 std::string Target::whoOwnsFile (const std::string & path_str) const
86 { return _pimpl->whoOwnsFile (path_str); }
87
88 std::ostream & Target::dumpOn( std::ostream & str ) const
89 { return _pimpl->dumpOn( str ); }
90
91 Product::constPtr Target::baseProduct() const
92 { return _pimpl->baseProduct(); }
93
94 LocaleSet Target::requestedLocales() const
95 { return _pimpl->requestedLocales(); }
96 LocaleSet Target::requestedLocales( const Pathname & root_r )
97 { return target::TargetImpl::requestedLocales( root_r ); }
98
99 void Target::updateAutoInstalled()
100 { return _pimpl->updateAutoInstalled(); }
101
102 std::string Target::targetDistribution() const
103 { return _pimpl->targetDistribution(); }
104 std::string Target::targetDistribution( const Pathname & root_r )
105 { return target::TargetImpl::targetDistribution( root_r ); }
106
107 std::string Target::targetDistributionRelease() const
108 { return _pimpl->targetDistributionRelease(); }
109 std::string Target::targetDistributionRelease( const Pathname & root_r )
110 { return target::TargetImpl::targetDistributionRelease( root_r ); }
111
112 std::string Target::targetDistributionFlavor() const
113 { return _pimpl->targetDistributionFlavor(); }
114 std::string Target::targetDistributionFlavor( const Pathname & root_r )
115 { return target::TargetImpl::targetDistributionFlavor( root_r ); }
116
117 Target::DistributionLabel Target::distributionLabel() const
118 { return _pimpl->distributionLabel(); }
119 Target::DistributionLabel Target::distributionLabel( const Pathname & root_r )
120 { return target::TargetImpl::distributionLabel( root_r ); }
121
122 std::string Target::distributionVersion() const
123 { return _pimpl->distributionVersion(); }
124 std::string Target::distributionVersion( const Pathname & root_r )
125 { return target::TargetImpl::distributionVersion( root_r ); }
126
127 std::string Target::distributionFlavor() const
128 { return _pimpl->distributionFlavor(); }
129 std::string Target::distributionFlavor( const Pathname & root_r )
130 { return target::TargetImpl::distributionFlavor( root_r ); }
131
132 std::string Target::anonymousUniqueId() const
133 { return _pimpl->anonymousUniqueId(); }
134 std::string Target::anonymousUniqueId( const Pathname & root_r )
135 { return target::TargetImpl::anonymousUniqueId( root_r ); }
136
137 const VendorAttr & Target::vendorAttr() const
138 { return _pimpl->vendorAttr(); }
139 void Target::vendorAttr( VendorAttr vendorAttr_r )
140 { _pimpl->vendorAttr( std::move(vendorAttr_r) ); }
141
143} // namespace zypp
TargetImpl.h
Target.h
zypp::Product::constPtr
TraitsType::constPtrType constPtr
Definition Product.h:39
zypp::Target
Definition Target.h:51
zypp::Target::Target
Target(const Pathname &root="/", bool doRebuild_r=false) ZYPP_LOCAL
Ctor.
Definition Target.cc:32
zypp::Target::distributionFlavor
std::string distributionFlavor() const
This is flavor attribute of the installed base product but does not require the target to be loaded a...
Definition Target.cc:127
zypp::Target::root
Pathname root() const
Return the root set for this target.
Definition Target.cc:79
zypp::Target::anonymousUniqueId
std::string anonymousUniqueId() const
anonymous unique id
Definition Target.cc:132
zypp::Target::dumpOn
std::ostream & dumpOn(std::ostream &str) const override
Stream output.
Definition Target.cc:88
zypp::Target::reload
void reload()
Definition Target.cc:70
zypp::Target::baseProduct
Product::constPtr baseProduct() const
returns the target base installed product, also known as the distribution or platform.
Definition Target.cc:91
zypp::Target::targetDistribution
std::string targetDistribution() const
This is register.target attribute of the installed base product.
Definition Target.cc:102
zypp::Target::targetDistributionRelease
std::string targetDistributionRelease() const
This is register.release attribute of the installed base product.
Definition Target.cc:107
zypp::Target::Impl_Ptr
intrusive_ptr< Impl > Impl_Ptr
Definition Target.h:54
zypp::Target::requestedLocales
LocaleSet requestedLocales() const
Languages to be supported by the system.
Definition Target.cc:94
zypp::Target::rpmDb
target::rpm::RpmDb & rpmDb()
Refference to the RPM database.
Definition Target.cc:76
zypp::Target::buildCache
void buildCache()
builds or refreshes the target cache
Definition Target.cc:61
zypp::Target::whoOwnsFile
std::string whoOwnsFile(const std::string &path_str) const
Return name of package owning path_str or empty string if no installed package owns path_str.
Definition Target.cc:85
zypp::Target::_pimpl
RW_pointer< Impl, rw_pointer::Intrusive< Impl > > _pimpl
Pointer to implementation.
Definition Target.h:246
zypp::Target::vendorAttr
const VendorAttr & vendorAttr() const
The targets current vendor equivalence settings.
Definition Target.cc:137
zypp::Target::targetDistributionFlavor
std::string targetDistributionFlavor() const
This is register.flavor attribute of the installed base product.
Definition Target.cc:112
zypp::Target::Impl
target::TargetImpl Impl
Definition Target.h:53
zypp::Target::providesFile
bool providesFile(const std::string &name_str, const std::string &path_str) const
If the package is installed and provides the file Needed to evaluate split provides during Resolver::...
Definition Target.cc:82
zypp::Target::updateAutoInstalled
void updateAutoInstalled()
Update the database of autoinstalled packages.
Definition Target.cc:99
zypp::Target::unload
void unload()
unload target resolvables from the pool
Definition Target.cc:73
zypp::Target::distributionVersion
std::string distributionVersion() const
This is version attribute of the installed base product.
Definition Target.cc:122
zypp::Target::cleanCache
void cleanCache()
cleans the target cache (.solv files)
Definition Target.cc:64
zypp::Target::distributionLabel
DistributionLabel distributionLabel() const
This is shortName and summary attribute of the installed base product.
Definition Target.cc:117
zypp::Target::load
void load()
load resolvables into the pool
Definition Target.cc:67
zypp::VendorAttr
Definition of vendor equivalence.
Definition VendorAttr.h:61
zypp::filesystem::Pathname
Pathname.
Definition Pathname.h:47
zypp::target::TargetImpl::targetDistributionRelease
std::string targetDistributionRelease() const
This is register.release attribute of the installed base product.
Definition TargetImpl.cc:3039
zypp::target::TargetImpl::targetDistribution
std::string targetDistribution() const
This is register.target attribute of the installed base product.
Definition TargetImpl.cc:3033
zypp::target::TargetImpl::requestedLocales
LocaleSet requestedLocales() const
Languages to be supported by the system.
Definition TargetImpl.h:155
zypp::target::TargetImpl::distributionVersion
std::string distributionVersion() const
This is version attribute of the installed base product.
Definition TargetImpl.cc:3069
zypp::target::TargetImpl::distributionLabel
Target::DistributionLabel distributionLabel() const
This is shortName and summary attribute of the installed base product.
Definition TargetImpl.cc:3051
zypp::target::TargetImpl::distributionFlavor
std::string distributionFlavor() const
This is flavor attribute of the installed base product but does not require the target to be loaded a...
Definition TargetImpl.cc:3098
zypp::target::TargetImpl::anonymousUniqueId
std::string anonymousUniqueId() const
anonymous unique id
Definition TargetImpl.cc:3124
zypp::target::TargetImpl::targetDistributionFlavor
std::string targetDistributionFlavor() const
This is register.flavor attribute of the installed base product.
Definition TargetImpl.cc:3045
zypp::target::rpm::RpmDb
Interface to the rpm program.
Definition RpmDb.h:51
str
String related utilities and Regular expression matching.
zypp
Easy-to use interface to the ZYPP dependency resolver.
Definition Application.cc:20
zypp::LocaleSet
std::unordered_set< Locale > LocaleSet
Definition Locale.h:29
zypp::operator<<
std::ostream & operator<<(std::ostream &str, const SerialNumber &obj)
Definition SerialNumber.cc:52
zypp::Target::DistributionLabel
Definition Target.h:168
zypp::Target::DistributionLabel::shortName
std::string shortName
Definition Target.h:168
zypp::Target::DistributionLabel::summary
std::string summary
Definition Target.h:168
IMPL_PTR_TYPE
#define IMPL_PTR_TYPE(NAME)
Definition ReferenceCounted.h:137