12#ifndef ZYPPNG_SAT_LOOKUPATTR_H
13#define ZYPPNG_SAT_LOOKUPATTR_H
41 using zypp::MatchException;
42 using zypp::StrMatcher;
172 template<class TResult, class TAttr = TResult>
303 std::string mstring_r = std::string(),
int flags_r = 0 );
306 const char * mstring_r,
int flags_r = 0 );
314 std::swap(
_dip, rhs._dip );
315 std::swap(
_pool, rhs._pool );
316 std::swap(
_mstring, rhs._mstring );
322 DIWrap( rhs ).swap( *
this );
326 {
DIWrap().swap( *
this ); }
382 void stayInThisSolvable();
385 void stayInThisRepo();
408 reference operator*()
const;
414 {
return !(*
this == rhs); }
423 {
return _dip.get(); }
430 template<
class TResult,
class TAttr>
434 template<
class TResult,
class TAttr>
482 bool solvAttrNumeric()
const;
485 bool solvAttrString()
const;
488 bool solvAttrIdString()
const;
491 bool solvAttrCheckSum()
const;
497 bool solvAttrSubEntry()
const;
514 bool subEmpty()
const;
519 size_type subSize()
const;
553 unsigned asUnsigned()
const;
557 unsigned long long asUnsignedLL()
const;
560 const char * c_str()
const;
576 {
return idStr().id(); }
587 template<
class Tp> Tp
asType()
const {
return Tp(
id() ); }
Provides API related macros.
Convenience char* constructible from std::string and char*, it maps (char*)0 to an empty string.
Access to the sat-pools string space.
String matching option flags as used e.g.
String matching (STRING|SUBSTRING|GLOB|REGEX).
Value proxy returned by LookupAttr::iterator::operator*().
detail::IdType id() const
unsigned asUnsigned() const
This is an overloaded member function, provided for convenience. It differs from the above function o...
LookupAttrValue(detail::CDataiterator *dip, detail::CPool *pool)
int asInt() const
Conversion to numeric types.
LookupAttr::size_type size_type
detail::CDataiterator * _dip
non-owning — current iterator position
IdString idStr() const
As IdString.
Tp asType() const
Templated return type.
bool asBool() const
This is an overloaded member function, provided for convenience. It differs from the above function o...
unsigned long long asUnsignedLL() const
This is an overloaded member function, provided for convenience. It differs from the above function o...
detail::CPool * _pool
non-owning — needed for sub-structure DIWrap construction
const char * c_str() const
Conversion to string types.
LookupAttr implementation.
void nextSkipRepo()
On the next call to operator++ advance to the next Repository.
void skipRepo()
Immediately advance to the next Repository.
void skipSolvAttr()
Immediately advance to the next SolvAttr.
std::forward_iterator_tag iterator_category
void skipSolvable()
Immediately advance to the next Solvable.
LookupAttrValue reference
void nextSkipSolvable()
On the next call to operator++ advance to the next Solvable.
void nextSkipSolvAttr()
On the next call to operator++ advance to the next SolvAttr.
LookupAttrValue value_type
void pointer
proxy type — no stable address
std::ptrdiff_t difference_type
bool operator!=(const iterator &rhs) const
detail::CDataiterator * get() const
Expert backdoor.
bool atEnd() const
Whether this points to the end of a query (iterator is invalid).
void setAttr(SolvAttr attr_r)
Set the SolvAttr to search.
SolvAttr parent() const
Whether to search within a sub-structure (SolvAttr::noAttr if not).
LookupAttr(LookupAttr &&) noexcept=default
void setPool(Location=SOLV_ATTR)
Set search in Pool (all repositories).
iterator end() const
Iterator behind the end of query results.
bool pool() const
Whether to search in Pool.
void setSolvable(Solvable solv_r)
Set search in one Solvable.
iterator begin() const
Iterator to the begin of query results.
void setParent(SolvAttr attr_r)
Set search within a sub-structure (SolvAttr::noAttr for none).
void resetStrMatcher()
Reset the pattern to match.
LookupAttr & operator=(const LookupAttr &)=default
SolvAttr attr() const
The SolvAttr to search.
bool empty() const
Whether the query is empty.
LookupAttr(const LookupAttr &)=default
Location
Specify the where to look for the attribule.
@ REPO_ATTR
Search for repository attributes.
@ SOLV_ATTR
Search for solvable attributes (default).
size_type size() const
Ammount of results.
const StrMatcher & strMatcher() const
The pattern to match.
LookupAttr()
Default ctor finds nothing.
Solvable solvable() const
Whether to search in one Solvable.
void setRepo(Repository repo_r, Location=SOLV_ATTR)
Set search in one Repository.
zypp::RWCOW_pointer< Impl > _pimpl
Repository repo() const
Whether to search in one Repository.
void setStrMatcher(const StrMatcher &matcher_r)
Set the pattern to match.
Lightweight repository attribute value lookup.
LookupRepoAttr()
Default ctor finds nothing.
LookupRepoAttr(Pool &pool, SolvAttr attr_r)
void setPool()
Set search in Pool (all repositories).
Orchestrator for a libsolv pool instance.
A Solvable object within the sat Pool.
Wrapper around sat detail::CDataiterator.
detail::CDataiterator * get() const
detail::CPool * pool() const
DIWrap()
NULL detail::CDataiterator
detail::CDataiterator * operator->() const
void swap(DIWrap &rhs) noexcept
DIWrap & operator=(const DIWrap &rhs)
detail::CDataiterator * _dip
const std::string & getstr() const
Easy-to use interface to the ZYPP dependency resolver.
std::string asString(const Patch::Category &obj)
relates: Patch::Category string representation.
zypp::sat::detail::CDataiterator CDataiterator
zypp::sat::detail::RepoIdType RepoIdType
zypp::sat::detail::CPool CPool
zypp::sat::detail::SolvableIdType SolvableIdType
zypp::sat::detail::IdType IdType
This file contains private API, this might break at any time between releases.
bool operator==(const Capability &lhs, const Capability &rhs)
relates: Capability
Namespace routing for C++20 ranges and C++23 ranges::to<T>() backport.
Exceptions thrown from attribute matching.
RW_pointer supporting 'copy on write' functionality.