14#ifndef ZYPP_NG_SAT_SOLVABLESPEC_H_INCLUDED
15#define ZYPP_NG_SAT_SOLVABLESPEC_H_INCLUDED
22#include <unordered_set>
80 {
if ( !ident_r.
empty() )
_idents.insert( std::move(ident_r) ); }
87 {
return _idents.count( ident_r ) != 0; }
106 {
return _provides.count( cap_r ) != 0; }
119 void parse( std::string_view spec_r );
126 template <
class TIterator>
128 {
for ( ; begin != end; ++begin )
parse( *begin ); }
177 using SolvIdSet = std::unordered_set<detail::SolvableIdType>;
189 {
return _ids.empty(); }
Access to the sat-pools string space.
constexpr bool empty() const
Whether the string is empty.
bool empty() const
Whether the Capability is empty.
bool contains(const Solvable &solv_r) const
O(1) membership test — no pool access required.
EvaluatedSolvableSpec(EvaluatedSolvableSpec &&)=default
EvaluatedSolvableSpec & operator=(const EvaluatedSolvableSpec &)=default
EvaluatedSolvableSpec(const EvaluatedSolvableSpec &)=default
const SolvIdSet & ids() const
Direct access to the resolved id set (e.g.
EvaluatedSolvableSpec(PreparedPool &pp_r, const SolvableSpec &spec_r)
Construct by evaluating spec_r against pp_r.
EvaluatedSolvableSpec & operator=(EvaluatedSolvableSpec &&)=default
bool empty() const
Whether no solvable matched the spec at construction time.
std::unordered_set< detail::SolvableIdType > SolvIdSet
Orchestrator for a libsolv pool instance.
A move-only, non-owning view of a Pool that guarantees the whatprovides index is valid.
A pure data container describing a set of solvables by ident and/or provides.
void parse(std::string_view spec_r)
Parse and add a single spec entry.
bool empty() const
Whether the spec has no idents and no provides tokens.
bool containsIdent(const IdString &ident_r) const
Whether ident_r has been added to the spec (for introspection/tests).
SolvableSpec(const SolvableSpec &)=default
void parseFrom(const zypp::InputStream &istr_r)
Parse and add specs from istr_r (one per line; #-comments and empty lines are skipped automatically).
const CapabilitySet & provides() const
const IdStringSet & idents() const
void addIdent(IdString ident_r)
Add ident_r to the ident set.
void parseFrom(TIterator begin, TIterator end)
Parse and add specs from an iterator range of string-like values.
SolvableSpec(SolvableSpec &&)=default
bool contains(Pool &pool_r, const Solvable &solv_r) const
Test whether a single Solvable matches this spec.
SolvableSpec & operator=(SolvableSpec &&)=default
bool containsProvides(const Capability &cap_r) const
Whether cap_r has been added to the spec (for introspection/tests).
void addProvides(Capability cap_r)
Add cap_r to the provides set.
SolvableSpec & operator=(const SolvableSpec &)=default
void splitParseFrom(std::string_view multispec_r)
Split multispec_r on ',', ' ', '\t' and parse each token.
void clear()
Reset to empty state.
A Solvable object within the sat Pool.
std::unordered_set< IdString > IdStringSet
This file contains private API, this might break at any time between releases.
std::unordered_set< Capability > CapabilitySet