36 if ( ! ident_r.
empty() )
42 if ( ! provides_r.
empty() &&
_provides.insert( provides_r ).second )
88 mutable shared_ptr<WhatProvides>
_cache;
91 friend Impl * rwcowClone<Impl>(
const Impl * rhs );
94 {
return new Impl( *
this ); }
100 str <<
"SolvableSpec {" << endl
101 <<
" Idents " << obj.
idents() << endl
102 <<
" Provides " << obj.
provides() << endl
121 {
_pimpl->addIdent( ident_r ); }
124 {
_pimpl->addProvides( provides_r ); }
127 {
_pimpl->parse( spec_r ); }
132 [
this](
int num_r,
const std::string & line_r )->
bool
134 this->
parse( line_r );
141 std::vector<std::string> v;
150 {
return _pimpl->dirty(); }
156 {
return _pimpl->idents().count( ident_r ); }
159 {
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.
static const ResKind srcpackage
SolvableSpec implementation.
void parse(const C_Str &spec_r)
Impl * clone() const
clone for RWCOW_pointer
const WhatProvides & cache() const
bool contains(const sat::Solvable &solv_r) const
const CapabilitySet & provides() const
shared_ptr< WhatProvides > _cache
const IdStringSet & idents() const
void addIdent(IdString ident_r)
void addProvides(Capability provides_r)
std::ostream & operator<<(std::ostream &str, const SolvableSpec::Impl &obj)
Stream output.
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 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).
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 it's 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).
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