libzypp
16.22.5
|
Define a set of Solvables by ident and provides. More...
#include <SolvableSpec.h>
Classes | |
class | Impl |
SolvableSpec implementation. More... | |
Public Member Functions | |
SolvableSpec () | |
Default ctor. More... | |
~SolvableSpec () | |
Dtor. More... | |
void | addIdent (IdString ident_r) |
Add all sat::Solvable with this ident_r. More... | |
void | addProvides (Capability provides_r) |
A all sat::Solvable matching this provides_r. More... | |
bool | addIdenticalInstalledToo () const |
Extend the provides set to include idential installed items as well. More... | |
void | addIdenticalInstalledToo (bool yesno_r) |
void | parse (const C_Str &spec_r) |
Parse and add spec from a string (IDENT or provides:CAPABILITY`). More... | |
void | parseFrom (const InputStream &istr_r) |
Parse file istr_r and add it's specs (one per line, #-comments). More... | |
template<class TIterator > | |
void | parseFrom (TIterator begin, TIterator end) |
Parse and add specs from iterator range. More... | |
void | splitParseFrom (const C_Str &multispec_r) |
Convenience using str::splitEscaped(", \t") to parse multiple specs from one line. More... | |
bool | contains (const sat::Solvable &solv_r) const |
Test whether solv_r matches the spec. More... | |
template<class Derived > | |
bool | contains (const SolvableType< Derived > &solv_r) const |
bool | dirty () const |
Whether the cache is needed and dirty. More... | |
void | setDirty () const |
Explicitly flag the cache as dirty, so it will be rebuilt on the next request. More... | |
bool | empty () const |
Whether neither idents nor provides are set. More... | |
bool | containsIdent (const IdString &ident_r) const |
Whether ident_r has been added to the specs (mainly for parser tests). More... | |
bool | containsProvides (const Capability &provides_r) const |
Whether provides_r has been added to the sepcs (mainly for parser tests). More... | |
Private Attributes | |
RWCOW_pointer< Impl > | _pimpl |
Implementation class. More... | |
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) |
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 146 of file SolvableSpec.cc.
zypp::sat::SolvableSpec::~SolvableSpec | ( | ) |
Dtor.
Definition at line 150 of file SolvableSpec.cc.
void zypp::sat::SolvableSpec::addIdent | ( | IdString | ident_r | ) |
Add all sat::Solvable with this ident_r.
Definition at line 153 of file SolvableSpec.cc.
void zypp::sat::SolvableSpec::addProvides | ( | Capability | provides_r | ) |
A all sat::Solvable matching this provides_r.
Definition at line 156 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 159 of file SolvableSpec.cc.
void zypp::sat::SolvableSpec::addIdenticalInstalledToo | ( | bool | yesno_r | ) |
Definition at line 161 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 164 of file SolvableSpec.cc.
void zypp::sat::SolvableSpec::parseFrom | ( | const InputStream & | istr_r | ) |
Parse file istr_r and add it's specs (one per line, #-comments).
Definition at line 167 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 177 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 184 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 187 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 190 of file SolvableSpec.cc.
bool zypp::sat::SolvableSpec::empty | ( | ) | const |
Whether neither idents nor provides are set.
Definition at line 193 of file SolvableSpec.cc.
Whether ident_r has been added to the specs (mainly for parser tests).
Definition at line 196 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 199 of file SolvableSpec.cc.
|
friend |
Definition at line 202 of file SolvableSpec.cc.
|
related |
Stream output
Definition at line 202 of file SolvableSpec.cc.
|
private |