12 #ifndef ZYPP_SAT_LOOKUPATTR_H 13 #define ZYPP_SAT_LOOKUPATTR_H 162 size_type
size()
const;
304 const std::string & mstring_r = std::string(),
int flags_r = 0 );
307 const char * mstring_r,
int flags_r = 0 );
315 std::swap( _dip, rhs.
_dip );
316 std::swap( _mstring, rhs.
_mstring );
329 explicit operator bool()
const 334 ::_Dataiterator *
get()
const {
return _dip; }
335 const std::string &
getstr()
const {
return _mstring; }
357 , boost::forward_traversal_tag
365 void nextSkipSolvAttr();
368 void nextSkipSolvable();
375 { nextSkipSolvAttr(); increment(); }
379 { nextSkipSolvable(); increment(); }
383 { nextSkipRepo(); increment(); }
386 void stayInThisSolvable();
389 void stayInThisRepo();
414 bool solvAttrNumeric()
const;
417 bool solvAttrString()
const;
420 bool solvAttrIdString()
const;
423 bool solvAttrCheckSum()
const;
429 bool solvAttrSubEntry()
const;
463 bool subEmpty()
const;
498 unsigned asUnsigned()
const;
502 unsigned long long asUnsignedLL()
const;
505 const char * c_str()
const;
520 {
return idStr().
id(); }
531 template<
class _Tp> _Tp
asType()
const {
return _Tp(
id()); }
554 friend class boost::iterator_core_access;
556 template <
class OtherDerived,
class OtherIterator,
class V,
class C,
class R,
class D>
557 bool equal(
const boost::iterator_adaptor<OtherDerived, OtherIterator, V, C, R, D> & rhs )
const 559 return (
bool(base()) ==
bool(rhs.base()) )
560 && ( ! base() || dip_equal( *base(), *rhs.base() ) );
563 bool dip_equal( const ::_Dataiterator & lhs, const ::_Dataiterator & rhs )
const;
571 ::_Dataiterator *
get()
const 572 {
return _dip.get(); }
585 template<>
inline int LookupAttr::iterator::asType<int>()
const {
return asInt(); }
586 template<>
inline unsigned LookupAttr::iterator::asType<unsigned>()
const {
return asUnsigned(); }
587 template<>
inline unsigned long long LookupAttr::iterator::asType<unsigned long long>()
const {
return asUnsignedLL(); }
588 template<>
inline bool LookupAttr::iterator::asType<bool>()
const {
return asBool(); }
589 template<>
inline const char * LookupAttr::iterator::asType<const char *>()
const {
return c_str(); }
590 template<>
inline std::string LookupAttr::iterator::asType<std::string>()
const {
return asString(); }
591 template<>
inline IdString LookupAttr::iterator::asType<IdString>()
const {
return idStr(); }
592 template<>
CheckSum LookupAttr::iterator::asType<CheckSum>()
const;
594 template<
class _ResultT,
class _AttrT>
606 std::ostream &
operator<<( std::ostream &
str, const ::_Dataiterator * obj );
609 inline std::ostream &
operator<<( std::ostream &
str, const ::_Dataiterator & obj )
610 {
return str << &obj; }
612 #endif // ZYPP_SAT_LOOKUPATTR_H DIWrap()
NULL ::_Dataiterator
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).
void setAttr(SolvAttr attr_r)
Set the SolvAttr to search.
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.
_Tp asType() const
Templated return type.
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 ::_Dataiterator.
void setStrMatcher(const StrMatcher &matcher_r)
Set the pattern to match.
const StrMatcher & strMatcher() const
The pattern to match.
LookupRepoAttr()
Default ctor finds nothing.
bool empty() const
Whether the query is empty.
std::string asString(const Patch::SeverityFlag &obj)
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
::_Dataiterator * operator->() const
Solvable solvable() const
Whether to search in one Solvable.
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.