12 #ifndef ZYPPNG_SAT_LOOKUPATTR_H 13 #define ZYPPNG_SAT_LOOKUPATTR_H 32 struct MatchException;
39 class LookupAttrValue;
158 iterator
begin() const;
161 iterator
end() const;
172 template<class TResult, class TAttr = TResult>
180 SolvAttr
attr() const;
183 void setAttr( SolvAttr attr_r );
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 );
336 const std::string &
getstr()
const {
return _mstring; }
361 void nextSkipSolvAttr();
364 void nextSkipSolvable();
371 { nextSkipSolvAttr(); increment(); }
375 { nextSkipSolvable(); increment(); }
379 { nextSkipRepo(); increment(); }
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>
460 : _dip( dip ), _pool(
pool )
473 SolvAttr inSolvAttr()
const;
482 bool solvAttrNumeric()
const;
485 bool solvAttrString()
const;
488 bool solvAttrIdString()
const;
491 bool solvAttrCheckSum()
const;
497 bool solvAttrSubEntry()
const;
514 bool subEmpty()
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() ); }
596 template<>
inline int LookupAttrValue::asType<int>()
const {
return asInt(); }
597 template<>
inline unsigned LookupAttrValue::asType<unsigned>()
const {
return asUnsigned(); }
598 template<>
inline unsigned long long LookupAttrValue::asType<unsigned long long>()
const {
return asUnsignedLL(); }
599 template<>
inline bool LookupAttrValue::asType<bool>()
const {
return asBool(); }
600 template<>
inline const char * LookupAttrValue::asType<const char *>()
const {
return c_str(); }
601 template<>
inline std::string LookupAttrValue::asType<std::string>()
const {
return asString(); }
602 template<>
inline IdString LookupAttrValue::asType<IdString>()
const {
return idStr(); }
603 template<>
CheckSum LookupAttrValue::asType<CheckSum>()
const;
607 #endif // ZYPPNG_SAT_LOOKUPATTR_H const StrMatcher & strMatcher() const
The pattern to match.
LookupAttrValue(detail::CDataiterator *dip, detail::CPool *pool)
A Solvable object within the sat Pool.
void setPool()
Set search in Pool (all repositories).
bool operator!=(const iterator &rhs) const
bool operator==(const Capability &lhs, const Capability &rhs)
relates: Capability
Lightweight repository attribute value lookup.
std::string asString(const Patch::Category &obj)
relates: Patch::Category string representation.
DIWrap()
NULL detail::CDataiterator
String matching (STRING|SUBSTRING|GLOB|REGEX).
void setSolvable(Solvable solv_r)
Set search in one Solvable.
detail::IdType id() const
detail::CDataiterator * operator->() const
Search for solvable attributes (default)
Lightweight attribute value lookup.
void swap(DIWrap &rhs) noexcept
void setAttr(SolvAttr attr_r)
Set the SolvAttr to search.
Value proxy returned by LookupAttr::iterator::operator*().
Access to the sat-pools string space.
Orchestrator for a libsolv pool instance.
Exceptions thrown from attribute matching.
void setPool(Location=SOLV_ATTR)
Set search in Pool (all repositories).
zypp::sat::detail::CPool CPool
void setParent(SolvAttr attr_r)
Set search within a sub-structure (SolvAttr::noAttr for none)
LookupAttr()
Default ctor finds nothing.
zypp::sat::detail::SolvableIdType SolvableIdType
bool empty() const
Whether the query is empty.
void skipSolvable()
Immediately advance to the next Solvable.
void skipRepo()
Immediately advance to the next Repository.
bool atEnd() const
Whether this points to the end of a query (iterator is invalid).
LookupRepoAttr(Pool &pool, SolvAttr attr_r)
void setRepo(Repository repo_r, Location=SOLV_ATTR)
Set search in one Repository.
Repository repo() const
Whether to search in one Repository.
void setStrMatcher(const StrMatcher &matcher_r)
Set the pattern to match.
std::forward_iterator_tag iterator_category
Convenience char* constructible from std::string and char*, it maps (char*)0 to an empty string...
This file contains private API, this might break at any time between releases.
Provides API related macros.
LookupAttr implementation.
DIWrap & operator=(const DIWrap &rhs)
void skipSolvAttr()
Immediately advance to the next SolvAttr.
size_type size() const
Ammount of results.
detail::CDataiterator * _dip
Location
Specify the where to look for the attribule.
std::ptrdiff_t difference_type
SolvAttr parent() const
Whether to search within a sub-structure (SolvAttr::noAttr if not)
LookupAttr::size_type size_type
zypp::sat::detail::IdType IdType
iterator begin() const
Iterator to the begin of query results.
Namespace routing for C++20 ranges and C++23 ranges::to<T>() backport.
zypp::RWCOW_pointer< Impl > _pimpl
detail::CPool * pool() const
Search for repository attributes.
detail::CPool * _pool
non-owning — needed for sub-structure DIWrap construction
zypp::sat::detail::CDataiterator CDataiterator
const std::string & getstr() const
void pointer
proxy type — no stable address
detail::CDataiterator * _dip
non-owning — current iterator position
Wrapper around sat detail::CDataiterator.
LookupAttr & operator=(const LookupAttr &)=default
iterator end() const
Iterator behind the end of query results.
Tp asType() const
Templated return type.
Solvable solvable() const
Whether to search in one Solvable.
LookupRepoAttr()
Default ctor finds nothing.
void resetStrMatcher()
Reset the pattern to match.
Easy-to use interface to the ZYPP dependency resolver.
zypp::sat::detail::RepoIdType RepoIdType
SolvAttr attr() const
The SolvAttr to search.
RW_pointer supporting 'copy on write' functionality.
bool pool() const
Whether to search in Pool.