12 #ifndef ZYPPNG_SAT_LOOKUPATTR_H 13 #define ZYPPNG_SAT_LOOKUPATTR_H 31 struct MatchException;
135 explicit
LookupAttr(
Pool & pool, SolvAttr attr_r, Location = SOLV_ATTR );
137 LookupAttr(
Pool & pool, SolvAttr attr_r, SolvAttr parent_r, Location = SOLV_ATTR );
156 iterator begin() const;
159 iterator end() const;
170 template<class TResult, class TAttr = TResult>
178 SolvAttr
attr() const;
181 void setAttr( SolvAttr attr_r );
200 void setStrMatcher( const
StrMatcher & matcher_r );
203 void resetStrMatcher();
213 void setPool(
Location = SOLV_ATTR );
225 void setSolvable(
Solvable solv_r );
228 SolvAttr parent() const;
231 void setParent( SolvAttr attr_r );
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 );
334 const std::string &
getstr()
const {
return _mstring; }
359 void nextSkipSolvAttr();
362 void nextSkipSolvable();
369 { nextSkipSolvAttr(); increment(); }
373 { nextSkipSolvable(); increment(); }
377 { nextSkipRepo(); increment(); }
380 void stayInThisSolvable();
383 void stayInThisRepo();
395 SolvAttr inSolvAttr()
const;
408 bool solvAttrNumeric()
const;
411 bool solvAttrString()
const;
414 bool solvAttrIdString()
const;
417 bool solvAttrCheckSum()
const;
423 bool solvAttrSubEntry()
const;
458 bool subEmpty()
const;
477 iterator subFind(
const SolvAttr& attr_r )
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(); }
567 template<>
inline int LookupAttr::iterator::asType<int>()
const {
return asInt(); }
568 template<>
inline unsigned LookupAttr::iterator::asType<unsigned>()
const {
return asUnsigned(); }
569 template<>
inline unsigned long long LookupAttr::iterator::asType<unsigned long long>()
const {
return asUnsignedLL(); }
570 template<>
inline bool LookupAttr::iterator::asType<bool>()
const {
return asBool(); }
571 template<>
inline const char * LookupAttr::iterator::asType<const char *>()
const {
return c_str(); }
572 template<>
inline std::string LookupAttr::iterator::asType<std::string>()
const {
return asString(); }
573 template<>
inline IdString LookupAttr::iterator::asType<IdString>()
const {
return idStr(); }
574 template<>
CheckSum LookupAttr::iterator::asType<CheckSum>()
const;
576 template<
class TResult,
class TAttr>
582 #endif // ZYPPNG_SAT_LOOKUPATTR_H 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::CDataiterator * operator->() const
Lightweight attribute value lookup.
void swap(DIWrap &rhs) noexcept
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
zypp::sat::detail::SolvableIdType SolvableIdType
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)
detail::IdType id() const
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.
Tp asType() const
Templated return type.
Provides API related macros.
LookupAttr implementation.
DIWrap & operator=(const DIWrap &rhs)
void skipSolvAttr()
Immediately advance to the next SolvAttr.
detail::CDataiterator * _dip
Location
Specify the where to look for the attribule.
std::ptrdiff_t difference_type
zypp::sat::detail::IdType IdType
detail::IdType value_type
detail::CPool * pool() const
zypp::sat::detail::CDataiterator CDataiterator
const std::string & getstr() const
Wrapper around sat detail::CDataiterator.
Solvable solvable() const
Whether to search in one Solvable.
LookupRepoAttr()
Default ctor finds nothing.
Easy-to use interface to the ZYPP dependency resolver.
zypp::sat::detail::RepoIdType RepoIdType
RW_pointer supporting 'copy on write' functionality.