libzypp 17.31.23
|
Define a set of Solvables by ident and provides. More...
#include <sat/SolvableSpec.h>
Classes | |
class | Impl |
SolvableSpec implementation. More... | |
Public Member Functions | |
SolvableSpec () | |
Default ctor. | |
~SolvableSpec () | |
Dtor. | |
void | addIdent (IdString ident_r) |
Add all sat::Solvable with this ident_r. | |
void | addProvides (Capability provides_r) |
A all sat::Solvable matching this provides_r. | |
bool | addIdenticalInstalledToo () const |
Extend the provides set to include idential installed items as well. | |
void | addIdenticalInstalledToo (bool yesno_r) |
void | parse (const C_Str &spec_r) |
Parse and add spec from a string (IDENT or provides:CAPABILITY`). | |
void | parseFrom (const InputStream &istr_r) |
Parse file istr_r and add its specs (one per line, #-comments). | |
template<class TIterator > | |
void | parseFrom (TIterator begin, TIterator end) |
Parse and add specs from iterator range. | |
void | splitParseFrom (const C_Str &multispec_r) |
Convenience using str::splitEscaped(", \t") to parse multiple specs from one line. | |
bool | contains (const sat::Solvable &solv_r) const |
Test whether solv_r matches the spec. | |
template<class Derived > | |
bool | contains (const SolvableType< Derived > &solv_r) const |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
bool | dirty () const |
Whether the cache is needed and dirty. | |
void | setDirty () const |
Explicitly flag the cache as dirty, so it will be rebuilt on the next request. | |
bool | empty () const |
Whether neither idents nor provides are set. | |
bool | containsIdent (const IdString &ident_r) const |
Whether ident_r has been added to the specs (mainly for parser tests). | |
bool | containsProvides (const Capability &provides_r) const |
Whether provides_r has been added to the sepcs (mainly for parser tests). | |
Private Attributes | |
RWCOW_pointer< Impl > | _pimpl |
Implementation class. | |
Friends | |
std::ostream & | operator<< (std::ostream &str, const SolvableSpec &obj) |
Related Functions | |
(Note that these are not member functions.) | |
std::ostream & | operator<< (std::ostream &str, const SolvableSpec &obj) |
Stream output. | |
Define a set of Solvables by ident and provides.
Able to keep the definition of solvable sets like in 'needreboot' or 'multiversion'. The associated file parser allows reading stored definitions (one IDENT
or provides:CAPABILITY‘ per line; empty lines and lines starting with ’#' are ignored).
The use of provides requires re-computation of the solvable set, whenever the solvable pool changes. This computation via WhatProvides is expensive, that's why a built in cache is also offered.
Definition at line 44 of file SolvableSpec.h.
zypp::sat::SolvableSpec::SolvableSpec | ( | ) |
Default ctor.
Definition at line 145 of file SolvableSpec.cc.
zypp::sat::SolvableSpec::~SolvableSpec | ( | ) |
Dtor.
Definition at line 149 of file SolvableSpec.cc.
void zypp::sat::SolvableSpec::addIdent | ( | IdString | ident_r | ) |
Add all sat::Solvable with this ident_r.
Definition at line 152 of file SolvableSpec.cc.
void zypp::sat::SolvableSpec::addProvides | ( | Capability | provides_r | ) |
A all sat::Solvable matching this provides_r.
Definition at line 155 of file SolvableSpec.cc.
bool zypp::sat::SolvableSpec::addIdenticalInstalledToo | ( | ) | const |
Extend the provides set to include idential installed items as well.
Hack for retracted packages, where the indicator provides is injected into the available items, but is not present in the installed items.
Definition at line 158 of file SolvableSpec.cc.
void zypp::sat::SolvableSpec::addIdenticalInstalledToo | ( | bool | yesno_r | ) |
Definition at line 160 of file SolvableSpec.cc.
void zypp::sat::SolvableSpec::parse | ( | const C_Str & | spec_r | ) |
Parse and add spec from a string (IDENT
or provides:CAPABILITY`).
Definition at line 163 of file SolvableSpec.cc.
void zypp::sat::SolvableSpec::parseFrom | ( | const InputStream & | istr_r | ) |
Parse file istr_r and add its specs (one per line, #-comments).
Definition at line 166 of file SolvableSpec.cc.
|
inline |
Parse and add specs from iterator range.
Definition at line 76 of file SolvableSpec.h.
void zypp::sat::SolvableSpec::splitParseFrom | ( | const C_Str & | multispec_r | ) |
Convenience using str::splitEscaped(", \t") to parse multiple specs from one line.
Definition at line 176 of file SolvableSpec.cc.
bool zypp::sat::SolvableSpec::contains | ( | const sat::Solvable & | solv_r | ) | const |
Test whether solv_r matches the spec.
(Re-)builds the WhatProvides cache on demand.
Definition at line 183 of file SolvableSpec.cc.
|
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 91 of file SolvableSpec.h.
bool zypp::sat::SolvableSpec::dirty | ( | ) | const |
Whether the cache is needed and dirty.
Definition at line 186 of file SolvableSpec.cc.
void zypp::sat::SolvableSpec::setDirty | ( | ) | const |
Explicitly flag the cache as dirty, so it will be rebuilt on the next request.
To be called if the ResPool content has changed. Intentionally const
as this does not change the set of spects (though the set of matches might change).
Definition at line 189 of file SolvableSpec.cc.
bool zypp::sat::SolvableSpec::empty | ( | ) | const |
Whether neither idents nor provides are set.
Definition at line 192 of file SolvableSpec.cc.
Whether ident_r has been added to the specs (mainly for parser tests).
Definition at line 195 of file SolvableSpec.cc.
bool zypp::sat::SolvableSpec::containsProvides | ( | const Capability & | provides_r | ) | const |
Whether provides_r has been added to the sepcs (mainly for parser tests).
Definition at line 198 of file SolvableSpec.cc.
|
friend |
Definition at line 201 of file SolvableSpec.cc.
|
related |
Stream output.
Definition at line 201 of file SolvableSpec.cc.
|
private |