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