12#ifndef ZYPPNG_SAT_LOOKUPATTR_H
13#define ZYPPNG_SAT_LOOKUPATTR_H
39 using zypp::MatchException;
40 using zypp::StrMatcher;
170 template<class TResult, class TAttr = TResult>
301 std::string mstring_r = std::string(),
int flags_r = 0 );
304 const char * mstring_r,
int flags_r = 0 );
312 std::swap(
_dip, rhs._dip );
313 std::swap(
_pool, rhs._pool );
314 std::swap(
_mstring, rhs._mstring );
320 DIWrap( rhs ).swap( *
this );
324 {
DIWrap().swap( *
this ); }
380 void stayInThisSolvable();
383 void stayInThisRepo();
408 bool solvAttrNumeric()
const;
411 bool solvAttrString()
const;
414 bool solvAttrIdString()
const;
417 bool solvAttrCheckSum()
const;
423 bool solvAttrSubEntry()
const;
458 bool subEmpty()
const;
493 unsigned asUnsigned()
const;
497 unsigned long long asUnsignedLL()
const;
500 const char * c_str()
const;
515 {
return idStr().id(); }
526 template<
class Tp> Tp
asType()
const {
return Tp(
id()); }
545 reference operator*()
const;
551 {
return !(*
this == rhs); }
560 {
return _dip.get(); }
576 template<
class TResult,
class TAttr>
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).
unsigned long long asUnsignedLL() const
This is an overloaded member function, provided for convenience. It differs from the above function o...
unsigned asUnsigned() const
This is an overloaded member function, provided for convenience. It differs from the above function o...
Tp asType() const
Templated return type.
IdString idStr() const
As IdStr.
bool asBool() const
This is an overloaded member function, provided for convenience. It differs from the above function o...
const char * c_str() const
Conversion to string types.
int asInt() const
Conversion to numeric 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.
Tp asType() const
Templated return type.
std::forward_iterator_tag iterator_category
void skipSolvable()
Immediately advance to the next Solvable.
IdString idStr() const
As IdString.
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.
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).
detail::IdType id() const
detail::IdType value_type
Lightweight attribute value lookup.
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.
const Arch Arch_empty ZYPP_API
relates: Arch This is an empty Arch represented by an empty string.
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
Exceptions thrown from attribute matching.
RW_pointer supporting 'copy on write' functionality.