libzypp: zyppng::sat::Solvable Class Reference

libzypp 17.38.14

zyppng::sat::Solvable Class Reference

A Solvable object within the sat Pool. More...

`#include <zypp/ng/sat/solvable.h>`

Inheritance diagram for zyppng::sat::Solvable:

## Public Types
using | IdType = detail::SolvableIdType

## Public Member Functions
| Solvable ()
| Default ctor creates noSolvable.
| Solvable (const Solvable &)=default
| Solvable (Solvable &&) noexcept=default
Solvable & | operator= (const Solvable &)=default
Solvable & | operator= (Solvable &&) noexcept=default
| Solvable (IdType id_r)
| PoolImpl ctor.
| operator bool () const
| Evaluate Solvable in a boolean context (`!=` `noSolvable`).
IdString | ident () const
| The identifier.
ResKind | kind () const
| The Solvables ResKind.
bool | isKind (const ResKind &kind_r) const
| Test whether a Solvable is of a certain ResKind.
template<class TRes>
bool | isKind () const
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
template<class TIterator>
bool | isKind (TIterator begin, TIterator end) const
bool | isKind (std::initializer_list< ResKind > range) const
std::string | name () const
| The name (without any ResKind prefix).
Edition | edition () const
| The edition (version-release).
Arch | arch () const
| The architecture.
IdString | vendor () const
| The vendor.
detail::RepoIdType | repository () const
| The repo id this Solvable belongs to.
bool | isSystem () const
| Return whether this Solvable belongs to the system repo.
zypp::Date | buildtime () const
| The items build time.
zypp::Date | installtime () const
| The items install time (`false` if not installed).
bool | identical (const Solvable &rhs) const
| Test whether two Solvables have the same content.
bool | sameNVRA (const Solvable &rhs) const
| Test for same name-version-release.arch.
Access to the \ref Solvable dependencies.
Note Prerequires are a subset of requires.
Capabilities | dep_provides () const
Capabilities | dep_requires () const
Capabilities | dep_conflicts () const
Capabilities | dep_obsoletes () const
Capabilities | dep_recommends () const
Capabilities | dep_suggests () const
Capabilities | dep_enhances () const
Capabilities | dep_supplements () const
Capabilities | dep_prerequires () const
Capabilities | dep (Dep which_r) const
| Return Capabilities selected by Dep constant.
Capabilities | operator[] (Dep which_r) const
CapabilitySet | providesNamespace (const std::string &namespace_r) const
| Return the namespaced provides 'namespace([value])[ op edition]' of this Solvable.
CapabilitySet | valuesOfNamespace (const std::string &namespace_r) const
| Return 'value[ op edition]' for namespaced provides 'namespace(value)[ op edition]'.
std::pair< bool, CapabilitySet > | matchesSolvable (const SolvAttr &attr, const Solvable &solv) const
Locale support.
bool | supportsLocales () const
| Whether this `Solvable` claims to support locales.
bool | supportsLocale (const Locale &locale_r) const
| Whether this `Solvable` supports a specific Locale.
bool | supportsLocale (const LocaleSet &locales_r) const
| Whether this `Solvable` supports at least one of the specified locales.
LocaleSet | getSupportedLocales () const
| Return the supported locales.
void | getSupportedLocales (LocaleSet &locales_r) const
CpeId | cpeId () const
| The solvables CpeId if available.
unsigned | mediaNr () const
| Media number the solvable is located on (`0` if no media access required).
zypp::ByteCount | installSize () const
| Installed (unpacked) size.
zypp::ByteCount | downloadSize () const
| Download size.
std::string | distribution () const
| The distribution string.
std::string | summary (const Locale &lang_r=Locale()) const
| Short (singleline) text describing the solvable (opt.
std::string | description (const Locale &lang_r=Locale()) const
| Long (multiline) text describing the solvable (opt.
std::string | insnotify (const Locale &lang_r=Locale()) const
| UI hint text when selecting the solvable for install (opt.
std::string | delnotify (const Locale &lang_r=Locale()) const
| UI hint text when selecting the solvable for uninstall (opt.
std::string | licenseToConfirm (const Locale &lang_r=Locale()) const
| License or agreement to accept before installing the solvable (opt.
bool | needToAcceptLicense () const
| `True` except for well known exceptions (i.e show license but no need to accept it).
Public Member Functions inherited from zyppng::sat::PoolMember< Solvable >
Pool & | pool ()

## Static Public Attributes
static const IdString | patternToken { "pattern()" }
| Indicator provides pattern().
static const IdString | productToken { "product()" }
| Indicator provides product().
static const IdString | retractedToken { "retracted-patch-package()" }
| Indicator provides retracted-patch-package().
static const IdString | ptfMasterToken { "ptf()" }
| Indicator provides ptf().
static const IdString | ptfPackageToken { "ptf-package()" }
| Indicator provides ptf-package().
static const Solvable | noSolvable
| Represents no Solvable.

## Attribute lookup.
See also LookupAttr and ArrayAttr providing a general, more query like interface for attribute retrieval.
IdType | _id
std::string | lookupStrAttribute (const SolvAttr &attr) const
| returns the string attribute value for attr or an empty string if it does not exists.
std::string | lookupStrAttribute (const SolvAttr &attr, const Locale &lang_r) const
unsigned long long | lookupNumAttribute (const SolvAttr &attr) const
| returns the numeric attribute value for attr or 0 if it does not exists.
unsigned long long | lookupNumAttribute (const SolvAttr &attr, unsigned long long notfound_r) const
bool | lookupBoolAttribute (const SolvAttr &attr) const
| returns the boolean attribute value for attr or `false` if it does not exists.
detail::IdType | lookupIdAttribute (const SolvAttr &attr) const
| returns the id attribute value for attr or detail::noId if it does not exists.
zypp::CheckSum | lookupCheckSumAttribute (const SolvAttr &attr) const
| returns the CheckSum attribute value for attr or an empty CheckSum if ir does not exist.
Solvable | nextInPool () const
| Return next Solvable in Pool (or noSolvable).
Solvable | nextInRepo () const
| Return next Solvable in Repo (or noSolvable).
detail::CSolvable * | get () const
| Expert backdoor.
IdType | id () const
| Expert backdoor.

## Detailed Description

A Solvable object within the sat Pool.

Note
  Unfortunately libsolv combines the objects kind and name in a single identifier `"pattern:kde_multimedia"`, except for packages and source packes. They are not prefixed by any kind string. Instead the architecture is abused to store `"src"` and `"nosrc"` values.

Solvable will hide this inconsistency by treating source packages as an own kind of solvable and map their arch to Arch_noarch.

Definition at line 65 of file solvable.h.

## Member Typedef Documentation

## ◆ IdType

using zyppng::sat::Solvable::IdType = detail::SolvableIdType

Definition at line 68 of file solvable.h.

## Constructor & Destructor Documentation

## ◆ Solvable() [1/4]

zyppng::sat::Solvable::Solvable | ( |  | ) |
| inline

Default ctor creates noSolvable.

Definition at line 79 of file solvable.h.

## ◆ Solvable() [2/4]

zyppng::sat::Solvable::Solvable | ( | const Solvable & |  | ) |
| default

## ◆ Solvable() [3/4]

zyppng::sat::Solvable::Solvable | ( | Solvable && |  | ) |
| defaultnoexcept

## ◆ Solvable() [4/4]

zyppng::sat::Solvable::Solvable | ( | IdType | id_r | ) |
| inlineexplicit

PoolImpl ctor.

Definition at line 89 of file solvable.h.

## Member Function Documentation

## ◆ operator=() [1/2]

Solvable & zyppng::sat::Solvable::operator= | ( | const Solvable & |  | ) |
| default

## ◆ operator=() [2/2]

Solvable & zyppng::sat::Solvable::operator= | ( | Solvable && |  | ) |
| defaultnoexcept

## ◆ operator bool()

zyppng::sat::Solvable::operator bool | ( |  | ) | const
| inlineexplicit

Evaluate Solvable in a boolean context (`!=` `noSolvable`).

Definition at line 98 of file solvable.h.

## ◆ ident()

IdString zyppng::sat::Solvable::ident | ( |  | ) | const

The identifier.

This is the solvables name, except for packages and source packes, prefixed by its kind.

Definition at line 179 of file solvable.cc.

## ◆ kind()

ResKind zyppng::sat::Solvable::kind | ( |  | ) | const

The Solvables ResKind.

Definition at line 185 of file solvable.cc.

## ◆ isKind() [1/4]

bool zyppng::sat::Solvable::isKind | ( | const ResKind & | kind_r | ) | const

Test whether a Solvable is of a certain ResKind.

The test is far cheaper than actually retrieving and comparing the kind.

Definition at line 212 of file solvable.cc.

## ◆ isKind() [2/4]

template<class TRes>

bool zyppng::sat::Solvable::isKind | ( |  | ) | const
| inline

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Definition at line 118 of file solvable.h.

## ◆ isKind() [3/4]

template<class TIterator>

bool zyppng::sat::Solvable::isKind | ( | TIterator | begin,
|  | TIterator | end ) const
| inline

Definition at line 122 of file solvable.h.

## ◆ isKind() [4/4]

bool zyppng::sat::Solvable::isKind | ( | std::initializer_list< ResKind > | range | ) | const
| inline

Definition at line 125 of file solvable.h.

## ◆ name()

std::string zyppng::sat::Solvable::name | ( |  | ) | const

The name (without any ResKind prefix).

Definition at line 239 of file solvable.cc.

## ◆ edition()

Edition zyppng::sat::Solvable::edition | ( |  | ) | const

The edition (version-release).

Definition at line 247 of file solvable.cc.

## ◆ arch()

Arch zyppng::sat::Solvable::arch | ( |  | ) | const

The architecture.

Definition at line 253 of file solvable.cc.

## ◆ vendor()

IdString zyppng::sat::Solvable::vendor | ( |  | ) | const

The vendor.

Definition at line 267 of file solvable.cc.

## ◆ repository()

detail::RepoIdType zyppng::sat::Solvable::repository | ( |  | ) | const

The repo id this Solvable belongs to.

Definition at line 273 of file solvable.cc.

## ◆ isSystem()

bool zyppng::sat::Solvable::isSystem | ( |  | ) | const

Return whether this Solvable belongs to the system repo.

Note
  This includes the otherwise hidden systemSolvable.

Definition at line 279 of file solvable.cc.

## ◆ buildtime()

zypp::Date zyppng::sat::Solvable::buildtime | ( |  | ) | const

The items build time.

Definition at line 285 of file solvable.cc.

## ◆ installtime()

zypp::Date zyppng::sat::Solvable::installtime | ( |  | ) | const

The items install time (`false` if not installed).

Definition at line 291 of file solvable.cc.

## ◆ identical()

bool zyppng::sat::Solvable::identical | ( | const Solvable & | rhs | ) | const

Test whether two Solvables have the same content.

Basically the same name, edition, arch, vendor and buildtime.

Definition at line 318 of file solvable.cc.

## ◆ sameNVRA()

bool zyppng::sat::Solvable::sameNVRA | ( | const Solvable & | rhs | ) | const
| inline

Test for same name-version-release.arch.

Definition at line 160 of file solvable.h.

## ◆ dep_provides()

Capabilities zyppng::sat::Solvable::dep_provides | ( |  | ) | const

Definition at line 335 of file solvable.cc.

## ◆ dep_requires()

Capabilities zyppng::sat::Solvable::dep_requires | ( |  | ) | const

Definition at line 340 of file solvable.cc.

## ◆ dep_conflicts()

Capabilities zyppng::sat::Solvable::dep_conflicts | ( |  | ) | const

Definition at line 345 of file solvable.cc.

## ◆ dep_obsoletes()

Capabilities zyppng::sat::Solvable::dep_obsoletes | ( |  | ) | const

Definition at line 350 of file solvable.cc.

## ◆ dep_recommends()

Capabilities zyppng::sat::Solvable::dep_recommends | ( |  | ) | const

Definition at line 355 of file solvable.cc.

## ◆ dep_suggests()

Capabilities zyppng::sat::Solvable::dep_suggests | ( |  | ) | const

Definition at line 360 of file solvable.cc.

## ◆ dep_enhances()

Capabilities zyppng::sat::Solvable::dep_enhances | ( |  | ) | const

Definition at line 365 of file solvable.cc.

## ◆ dep_supplements()

Capabilities zyppng::sat::Solvable::dep_supplements | ( |  | ) | const

Definition at line 370 of file solvable.cc.

## ◆ dep_prerequires()

Capabilities zyppng::sat::Solvable::dep_prerequires | ( |  | ) | const

Definition at line 375 of file solvable.cc.

## ◆ dep()

Capabilities zyppng::sat::Solvable::dep | ( | Dep | which_r | ) | const
| inline

Return Capabilities selected by Dep constant.

Definition at line 180 of file solvable.h.

## ◆ operator[]()

Capabilities zyppng::sat::Solvable::operator[] | ( | Dep | which_r | ) | const
| inline

Definition at line 197 of file solvable.h.

## ◆ providesNamespace()

CapabilitySet zyppng::sat::Solvable::providesNamespace | ( | const std::string & | namespace_r | ) | const

Return the namespaced provides 'namespace([value])[ op edition]' of this Solvable.

Definition at line 384 of file solvable.cc.

## ◆ valuesOfNamespace()

CapabilitySet zyppng::sat::Solvable::valuesOfNamespace | ( | const std::string & | namespace_r | ) | const

Return 'value[ op edition]' for namespaced provides 'namespace(value)[ op edition]'.

Similar to providesNamespace, but the namespace is stripped from the dependencies. This is convenient if the namespace denotes packages that should be looked up. E.g. the `weakremover` namespace used in a products release package denotes the packages that were dropped from the distribution.

See also
  Product::droplist

Definition at line 400 of file solvable.cc.

## ◆ matchesSolvable()

std::pair< bool, CapabilitySet > zyppng::sat::Solvable::matchesSolvable | ( | const SolvAttr & | attr,
|  | const Solvable & | solv ) const

Definition at line 421 of file solvable.cc.

## ◆ supportsLocales()

bool zyppng::sat::Solvable::supportsLocales | ( |  | ) | const

Whether this `Solvable` claims to support locales.

Definition at line 508 of file solvable.cc.

## ◆ supportsLocale() [1/2]

bool zyppng::sat::Solvable::supportsLocale | ( | const Locale & | locale_r | ) | const

Whether this `Solvable` supports a specific Locale.

Definition at line 514 of file solvable.cc.

## ◆ supportsLocale() [2/2]

bool zyppng::sat::Solvable::supportsLocale | ( | const LocaleSet & | locales_r | ) | const

Whether this `Solvable` supports at least one of the specified locales.

Definition at line 520 of file solvable.cc.

## ◆ getSupportedLocales() [1/2]

LocaleSet zyppng::sat::Solvable::getSupportedLocales | ( |  | ) | const

Return the supported locales.

Definition at line 528 of file solvable.cc.

## ◆ getSupportedLocales() [2/2]

void zyppng::sat::Solvable::getSupportedLocales | ( | LocaleSet & | locales_r | ) | const
| inline

Definition at line 229 of file solvable.h.

## ◆ cpeId()

CpeId zyppng::sat::Solvable::cpeId | ( |  | ) | const

The solvables CpeId if available.

Definition at line 538 of file solvable.cc.

## ◆ mediaNr()

unsigned zyppng::sat::Solvable::mediaNr | ( |  | ) | const

Media number the solvable is located on (`0` if no media access required).

Definition at line 544 of file solvable.cc.

## ◆ installSize()

zypp::ByteCount zyppng::sat::Solvable::installSize | ( |  | ) | const

Installed (unpacked) size.

This is just a total number. Many objects provide even more detailed disk usage data. You can use DiskUsageCounter to find out how objects data are distributed across partitions/directories.

// Load directory set into ducounter
DiskUsageCounter ducounter( { "/", "/usr", "/var" } );
// see how noch space the packages use
for ( const PoolItem & pi : pool )
{
cout << pi << ducounter.disk_usage( pi ) << endl;
// I__s_(7)GeoIP-1.4.8-3.1.2.x86_64(@System) {
// dir:[/] [ bs: 0 B ts: 0 B us: 0 B (+-: 1.0 KiB)]
// dir:[/usr] [ bs: 0 B ts: 0 B us: 0 B (+-: 133.0 KiB)]
// dir:[/var] [ bs: 0 B ts: 0 B us: 0 B (+-: 1.1 MiB)]
// }
}
zypp::DiskUsageCounter
Compute disk space occupied by packages across partitions/directories.
Definition DiskUsageCounter.h:33
zypp::PoolItem
Combining sat::Solvable and ResStatus.
Definition PoolItem.h:51
zypp::pool
Definition ByIdent.h:24

See also
  DiskUsageCounter

Definition at line 557 of file solvable.cc.

## ◆ downloadSize()

zypp::ByteCount zyppng::sat::Solvable::downloadSize | ( |  | ) | const

Download size.

Definition at line 563 of file solvable.cc.

## ◆ distribution()

std::string zyppng::sat::Solvable::distribution | ( |  | ) | const

The distribution string.

Definition at line 569 of file solvable.cc.

## ◆ summary()

std::string zyppng::sat::Solvable::summary | ( | const Locale & | lang_r = Locale() | ) | const

Short (singleline) text describing the solvable (opt.

translated).

Definition at line 575 of file solvable.cc.

## ◆ description()

std::string zyppng::sat::Solvable::description | ( | const Locale & | lang_r = Locale() | ) | const

Long (multiline) text describing the solvable (opt.

translated).

Definition at line 581 of file solvable.cc.

## ◆ insnotify()

std::string zyppng::sat::Solvable::insnotify | ( | const Locale & | lang_r = Locale() | ) | const

UI hint text when selecting the solvable for install (opt.

translated).

Definition at line 587 of file solvable.cc.

## ◆ delnotify()

std::string zyppng::sat::Solvable::delnotify | ( | const Locale & | lang_r = Locale() | ) | const

UI hint text when selecting the solvable for uninstall (opt.

translated).

Definition at line 593 of file solvable.cc.

## ◆ licenseToConfirm()

std::string zyppng::sat::Solvable::licenseToConfirm | ( | const Locale & | lang_r = Locale() | ) | const

License or agreement to accept before installing the solvable (opt.

translated).

## ◆ needToAcceptLicense()

bool zyppng::sat::Solvable::needToAcceptLicense | ( |  | ) | const

`True` except for well known exceptions (i.e show license but no need to accept it).

## ◆ lookupStrAttribute() [1/2]

std::string zyppng::sat::Solvable::lookupStrAttribute | ( | const SolvAttr & | attr | ) | const

returns the string attribute value for attr or an empty string if it does not exists.

Definition at line 108 of file solvable.cc.

## ◆ lookupStrAttribute() [2/2]

std::string zyppng::sat::Solvable::lookupStrAttribute | ( | const SolvAttr & | attr,
|  | const Locale & | lang_r ) const

Definition at line 115 of file solvable.cc.

## ◆ lookupNumAttribute() [1/2]

unsigned long long zyppng::sat::Solvable::lookupNumAttribute | ( | const SolvAttr & | attr | ) | const

returns the numeric attribute value for attr or 0 if it does not exists.

Definition at line 136 of file solvable.cc.

## ◆ lookupNumAttribute() [2/2]

unsigned long long zyppng::sat::Solvable::lookupNumAttribute | ( | const SolvAttr & | attr,
|  | unsigned long long | notfound_r ) const

Definition at line 142 of file solvable.cc.

## ◆ lookupBoolAttribute()

bool zyppng::sat::Solvable::lookupBoolAttribute | ( | const SolvAttr & | attr | ) | const

returns the boolean attribute value for attr or `false` if it does not exists.

Definition at line 148 of file solvable.cc.

## ◆ lookupIdAttribute()

detail::IdType zyppng::sat::Solvable::lookupIdAttribute | ( | const SolvAttr & | attr | ) | const

returns the id attribute value for attr or detail::noId if it does not exists.

Definition at line 154 of file solvable.cc.

## ◆ lookupCheckSumAttribute()

zypp::CheckSum zyppng::sat::Solvable::lookupCheckSumAttribute | ( | const SolvAttr & | attr | ) | const

returns the CheckSum attribute value for attr or an empty CheckSum if ir does not exist.

Definition at line 160 of file solvable.cc.

## ◆ nextInPool()

Solvable zyppng::sat::Solvable::nextInPool | ( |  | ) | const

Return next Solvable in Pool (or noSolvable).

Definition at line 88 of file solvable.cc.

## ◆ nextInRepo()

Solvable zyppng::sat::Solvable::nextInRepo | ( |  | ) | const

Return next Solvable in Repo (or noSolvable).

Definition at line 94 of file solvable.cc.

## ◆ get()

detail::CSolvable * zyppng::sat::Solvable::get | ( |  | ) | const

Expert backdoor.

Definition at line 77 of file solvable.cc.

## ◆ id()

IdType zyppng::sat::Solvable::id | ( |  | ) | const
| inline

Expert backdoor.

Definition at line 342 of file solvable.h.

## Member Data Documentation

## ◆ patternToken

const IdString zyppng::sat::Solvable::patternToken { "pattern()" }
| static

Indicator provides pattern().

Definition at line 70 of file solvable.h.

## ◆ productToken

const IdString zyppng::sat::Solvable::productToken { "product()" }
| static

Indicator provides product().

Definition at line 71 of file solvable.h.

## ◆ retractedToken

const IdString zyppng::sat::Solvable::retractedToken { "retracted-patch-package()" }
| static

Indicator provides retracted-patch-package().

Definition at line 73 of file solvable.h.

## ◆ ptfMasterToken

const IdString zyppng::sat::Solvable::ptfMasterToken { "ptf()" }
| static

Indicator provides ptf().

Definition at line 74 of file solvable.h.

## ◆ ptfPackageToken

const IdString zyppng::sat::Solvable::ptfPackageToken { "ptf-package()" }
| static

Indicator provides ptf-package().

Definition at line 75 of file solvable.h.

## ◆ noSolvable

const Solvable zyppng::sat::Solvable::noSolvable
| static

Represents no Solvable.

Definition at line 95 of file solvable.h.

## ◆ _id

IdType zyppng::sat::Solvable::_id
| private

Definition at line 345 of file solvable.h.

The documentation for this class was generated from the following files:

- zypp/ng/sat/solvable.h
- zypp/ng/sat/solvable.cc