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 ); }
350 , detail::CDataiterator *
352 , boost::forward_traversal_tag
381 void stayInThisSolvable();
384 void stayInThisRepo();
409 bool solvAttrNumeric()
const;
412 bool solvAttrString()
const;
415 bool solvAttrIdString()
const;
418 bool solvAttrCheckSum()
const;
424 bool solvAttrSubEntry()
const;
459 bool subEmpty()
const;
494 unsigned asUnsigned()
const;
498 unsigned long long asUnsignedLL()
const;
501 const char * c_str()
const;
516 {
return idStr().id(); }
527 template<
class Tp> Tp
asType()
const {
return Tp(
id()); }
547 friend class boost::iterator_core_access;
549 template <
class OtherDerived,
class OtherIterator,
class V,
class C,
class R,
class D>
550 bool equal(
const boost::iterator_adaptor<OtherDerived, OtherIterator, V, C, R, D> & rhs )
const
552 return (
bool(
base()) ==
bool(rhs.base()) )
565 {
return _dip.get(); }
581 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.
bool dip_equal(const detail::CDataiterator &lhs, const detail::CDataiterator &rhs) const
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.
bool equal(const boost::iterator_adaptor< OtherDerived, OtherIterator, V, C, R, D > &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
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.
Exceptions thrown from attribute matching.
RW_pointer supporting 'copy on write' functionality.