13#include <zypp/base/LogTools.h>
14#include <zypp/base/IOStream.h>
37 if ( ! ident_r.
empty() )
43 if ( ! provides_r.
empty() &&
_provides.insert( provides_r ).second )
83 for (
const auto & solv : *
_cache ) {
84 if ( solv.isSystem() )
123 friend Impl * rwcowClone<Impl>(
const Impl * rhs );
126 {
return new Impl( *
this ); }
132 str <<
"SolvableSpec {" << endl
133 <<
" Idents " << obj.
idents() << endl
134 <<
" Provides " << obj.
provides() << endl
153 {
_pimpl->addIdent( ident_r ); }
156 {
_pimpl->addProvides( provides_r ); }
159 {
return _pimpl->addIdenticalInstalledToo(); }
161 {
_pimpl->addIdenticalInstalledToo( yesno_r ); }
164 {
_pimpl->parse( spec_r ); }
169 [
this](
int num_r,
const std::string & line_r )->
bool
171 this->
parse( line_r );
178 std::vector<std::string> v;
187 {
return _pimpl->dirty(); }
193 {
return _pimpl->idents().empty() &&
_pimpl->provides().empty(); }
196 {
return _pimpl->idents().count( ident_r ); }
199 {
return _pimpl->provides().count( provides_r ); }
Convenience char* constructible from std::string and char*, it maps (char*)0 to an empty string.
const char * c_str() const
bool empty() const
Whether the Capability is empty.
Access to the sat-pools string space.
constexpr bool empty() const
Whether the string is empty.
Combining sat::Solvable and ResStatus.
static const ResKind srcpackage
Solvable set wrapper to allow adding additional convenience iterators.
void clear()
Clear the container.
bool insert(const TSolv &solv_r)
Insert a Solvable.
bool contains(const TSolv &solv_r) const
SolvableSpec implementation.
void parse(const C_Str &spec_r)
const WhatProvides & cache() const
const CapabilitySet & provides() const
bool addIdenticalInstalledToo() const
bool _addIdenticalInstalledToo
bool contains(const sat::Solvable &solv_r) const
Impl * clone() const
clone for RWCOW_pointer
shared_ptr< WhatProvides > _cache
void addIdenticalInstalledToo(bool yesno_r)
void addIdent(IdString ident_r)
void addProvides(Capability provides_r)
std::ostream & operator<<(std::ostream &str, const SolvableSpec::Impl &obj)
Stream output.
const IdStringSet & idents() const
SolvableSet _cacheIdenticalInstalled
Define a set of Solvables by ident and provides.
void parse(const C_Str &spec_r)
Parse and add spec from a string (IDENT or provides:CAPABILITY`).
bool dirty() const
Whether the cache is needed and dirty.
bool containsIdent(const IdString &ident_r) const
Whether ident_r has been added to the specs (mainly for parser tests).
void splitParseFrom(const C_Str &multispec_r)
Convenience using str::splitEscaped(", \t") to parse multiple specs from one line.
RWCOW_pointer< Impl > _pimpl
Implementation class.
bool addIdenticalInstalledToo() const
Extend the provides set to include idential installed items as well.
bool contains(const sat::Solvable &solv_r) const
Test whether solv_r matches the spec.
bool containsProvides(const Capability &provides_r) const
Whether provides_r has been added to the sepcs (mainly for parser tests).
bool empty() const
Whether neither idents nor provides are set.
SolvableSpec()
Default ctor.
void setDirty() const
Explicitly flag the cache as dirty, so it will be rebuilt on the next request.
void addProvides(Capability provides_r)
A all sat::Solvable matching this provides_r.
void addIdent(IdString ident_r)
Add all sat::Solvable with this ident_r.
void parseFrom(const InputStream &istr_r)
Parse file istr_r and add its specs (one per line, #-comments).
A Solvable object within the sat Pool.
bool isKind(const ResKind &kind_r) const
Test whether a Solvable is of a certain ResKind.
IdString ident() const
The identifier.
Container of Solvable providing a Capability (read only).
static Ptr get(const pool::ByIdent &ident_r)
Get the Selctable.
String related utilities and Regular expression matching.
int simpleParseFile(std::istream &str_r, ParseFlags flags_r, function< bool(int, std::string)> consume_r)
Simple lineparser optionally trimming and skipping comments.
std::ostream & operator<<(std::ostream &str, const FileConflicts &obj)
bool hasPrefix(const C_Str &str_r, const C_Str &prefix_r)
Return whether str_r has prefix prefix_r.
unsigned splitEscaped(const C_Str &line_r, TOutputIterator result_r, const C_Str &sepchars_r=" \t", bool withEmpty=false)
Split line_r into words with respect to escape delimeters.
Easy-to use interface to the ZYPP dependency resolver.
std::unordered_set< Capability > CapabilitySet
std::unordered_set< IdString > IdStringSet