libzypp
17.25.6
|
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... | |
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 |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. More... | |
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 | 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) |
Stream output. More... | |
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 113 of file SolvableSpec.cc.
zypp::sat::SolvableSpec::~SolvableSpec | ( | ) |
Dtor.
Definition at line 117 of file SolvableSpec.cc.
void zypp::sat::SolvableSpec::addIdent | ( | IdString | ident_r | ) |
Add all sat::Solvable with this ident_r.
Definition at line 120 of file SolvableSpec.cc.
void zypp::sat::SolvableSpec::addProvides | ( | Capability | provides_r | ) |
A all sat::Solvable matching this provides_r.
Definition at line 123 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 126 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 129 of file SolvableSpec.cc.
|
inline |
Parse and add specs from iterator range.
Definition at line 69 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 139 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 146 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 84 of file SolvableSpec.h.
bool zypp::sat::SolvableSpec::dirty | ( | ) | const |
Whether the cache is needed and dirty.
Definition at line 149 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 152 of file SolvableSpec.cc.
Whether ident_r has been added to the specs (mainly for parser tests).
Definition at line 155 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 158 of file SolvableSpec.cc.
|
friend |
Definition at line 161 of file SolvableSpec.cc.
|
related |
Stream output.
Definition at line 161 of file SolvableSpec.cc.
|
private |