12 #ifndef ZYPP_SAT_LOOKUPATTR_H 13 #define ZYPP_SAT_LOOKUPATTR_H 158 size_type
size()
const;
161 template<
class TResult,
class TAttr = TResult>
301 const 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( _mstring, rhs.
_mstring );
332 const std::string &
getstr()
const {
return _mstring; }
352 , detail::CDataiterator *
354 , boost::forward_traversal_tag
362 void nextSkipSolvAttr();
365 void nextSkipSolvable();
372 { nextSkipSolvAttr(); increment(); }
376 { nextSkipSolvable(); increment(); }
380 { nextSkipRepo(); increment(); }
383 void stayInThisSolvable();
386 void stayInThisRepo();
411 bool solvAttrNumeric()
const;
414 bool solvAttrString()
const;
417 bool solvAttrIdString()
const;
420 bool solvAttrCheckSum()
const;
426 bool solvAttrSubEntry()
const;
460 bool subEmpty()
const;
495 unsigned asUnsigned()
const;
499 unsigned long long asUnsignedLL()
const;
502 const char * c_str()
const;
517 {
return idStr().
id(); }
528 template<
class Tp> Tp
asType()
const {
return Tp(
id()); }
551 friend class boost::iterator_core_access;
553 template <
class OtherDerived,
class OtherIterator,
class V,
class C,
class R,
class D>
554 bool equal(
const boost::iterator_adaptor<OtherDerived, OtherIterator, V, C, R, D> & rhs )
const 556 return (
bool(base()) ==
bool(rhs.base()) )
557 && ( ! base() || dip_equal( *base(), *rhs.base() ) );
569 {
return _dip.get(); }
582 template<>
inline int LookupAttr::iterator::asType<int>()
const {
return asInt(); }
583 template<>
inline unsigned LookupAttr::iterator::asType<unsigned>()
const {
return asUnsigned(); }
584 template<>
inline unsigned long long LookupAttr::iterator::asType<unsigned long long>()
const {
return asUnsignedLL(); }
585 template<>
inline bool LookupAttr::iterator::asType<bool>()
const {
return asBool(); }
586 template<>
inline const char * LookupAttr::iterator::asType<const char *>()
const {
return c_str(); }
587 template<>
inline std::string LookupAttr::iterator::asType<std::string>()
const {
return asString(); }
588 template<>
inline IdString LookupAttr::iterator::asType<IdString>()
const {
return idStr(); }
589 template<>
CheckSum LookupAttr::iterator::asType<CheckSum>()
const;
591 template<
class TResult,
class TAttr>
607 {
return str << &obj; }
609 #endif // ZYPP_SAT_LOOKUPATTR_H DIWrap()
NULL detail::CDataiterator
Tp asType() const
Templated return type.
void skipSolvAttr()
Immediately advance to the next SolvAttr.
int IdType
Generic Id type.
A Solvable object within the sat Pool.
void setPool(Location=SOLV_ATTR)
Set search in Pool (all repositories).
::_Dataiterator CDataiterator
Wrapped libsolv C data type exposed as backdoor.
void setAttr(SolvAttr attr_r)
Set the SolvAttr to search.
std::string asString(const DefaultIntegral< Tp, TInitial > &obj)
bool atEnd() const
Whether this points to the end of a query (Iterator is invalid).
IdType id() const
Expert backdoor.
String matching (STRING|SUBSTRING|GLOB|REGEX).
Lightweight attribute value lookup.
::_Repo * RepoIdType
Id type to connect Repo and sat-repo.
void resetStrMatcher()
Reset the pattern to match.
void setParent(SolvAttr attr_r)
Set search within a sub-structure (SolvAttr::noAttr for none)
void setSolvable(Solvable solv_r)
Set search in one Solvable.
String related utilities and Regular expression matching.
unsigned SolvableIdType
Id type to connect Solvable and sat-solvable.
Access to the sat-pools string space.
RWCOW_pointer< Impl > _pimpl
Search for solvable attributes (default)
LookupAttr::TransformIterator based container to retrieve list attributes.
Exceptions thrown from attribute matching.
void skipRepo()
Immediately advance to the next Repository.
LookupAttr()
Default ctor finds nothing.
LookupAttr implememtation.
SolvAttr parent() const
Whether to search within a sub-structure (SolvAttr::noAttr if not)
void skipSolvable()
Immediately advance to the next Solvable.
const std::string & getstr() const
DIWrap & operator=(const DIWrap &rhs)
bool pool() const
Whether to search in Pool.
iterator end() const
Iterator behind the end of query results.
void setRepo(Repository repo_r, Location=SOLV_ATTR)
Set search in one Repository.
Lightweight repository attribute value lookup.
std::ostream & dumpOn(std::ostream &str, const LookupAttr &obj)
Convenience char* constructible from std::string and char*, it maps (char*)0 to an empty string...
SolvAttr attr() const
The SolvAttr to search.
LookupRepoAttr(SolvAttr attr_r)
Wrapper around sat detail::CDataiterator.
void setStrMatcher(const StrMatcher &matcher_r)
Set the pattern to match.
const StrMatcher & strMatcher() const
The pattern to match.
detail::CDataiterator * operator->() const
LookupRepoAttr()
Default ctor finds nothing.
bool empty() const
Whether the query is empty.
void setPool()
Set search in Pool (all repositories).
detail::IdType id() const
size_type size() const
Ammount of results.
std::ostream & operator<<(std::ostream &str, const LookupAttr &obj)
bool equal(const boost::iterator_adaptor< OtherDerived, OtherIterator, V, C, R, D > &rhs) const
Solvable solvable() const
Whether to search in one Solvable.
detail::CDataiterator * _dip
Easy-to use interface to the ZYPP dependency resolver.
Repository repo() const
Whether to search in one Repository.
Location
Specify the where to look for the attribule.
iterator begin() const
Iterator to the begin of query results.
Search for repository attributes.