12 #ifndef ZYPP_SAT_LOOKUPATTR_H 13 #define ZYPP_SAT_LOOKUPATTR_H 19 #include <zypp-core/base/DefaultIntegral> 30 struct MatchException;
153 iterator
begin() const;
156 iterator
end() const;
167 template<class TResult, class TAttr = TResult>
307 std::string mstring_r = std::string(),
int flags_r = 0 );
310 const char * mstring_r,
int flags_r = 0 );
318 std::swap( _dip, rhs._dip );
319 std::swap( _mstring, rhs._mstring );
338 const std::string &
getstr()
const {
return _mstring; }
358 , detail::CDataiterator *
360 , boost::forward_traversal_tag
368 void nextSkipSolvAttr();
371 void nextSkipSolvable();
378 { nextSkipSolvAttr(); increment(); }
382 { nextSkipSolvable(); increment(); }
386 { nextSkipRepo(); increment(); }
389 void stayInThisSolvable();
392 void stayInThisRepo();
417 bool solvAttrNumeric()
const;
420 bool solvAttrString()
const;
423 bool solvAttrIdString()
const;
426 bool solvAttrCheckSum()
const;
432 bool solvAttrSubEntry()
const;
466 bool subEmpty()
const;
501 unsigned asUnsigned()
const;
505 unsigned long long asUnsignedLL()
const;
508 const char * c_str()
const;
523 {
return idStr().id(); }
534 template<
class Tp> Tp
asType()
const {
return Tp(
id()); }
557 friend class boost::iterator_core_access;
559 template <
class OtherDerived,
class OtherIterator,
class V,
class C,
class R,
class D>
560 bool equal(
const boost::iterator_adaptor<OtherDerived, OtherIterator, V, C, R, D> & rhs )
const 562 return (
bool(base()) ==
bool(rhs.base()) )
563 && ( ! base() || dip_equal( *base(), *rhs.base() ) );
575 {
return _dip.get(); }
588 template<>
inline int LookupAttr::iterator::asType<int>()
const {
return asInt(); }
589 template<>
inline unsigned LookupAttr::iterator::asType<unsigned>()
const {
return asUnsigned(); }
590 template<>
inline unsigned long long LookupAttr::iterator::asType<unsigned long long>()
const {
return asUnsignedLL(); }
591 template<>
inline bool LookupAttr::iterator::asType<bool>()
const {
return asBool(); }
592 template<>
inline const char * LookupAttr::iterator::asType<const char *>()
const {
return c_str(); }
593 template<>
inline std::string LookupAttr::iterator::asType<std::string>()
const {
return asString(); }
594 template<>
inline IdString LookupAttr::iterator::asType<IdString>()
const {
return idStr(); }
595 template<>
CheckSum LookupAttr::iterator::asType<CheckSum>()
const;
597 template<
class TResult,
class TAttr>
613 {
return str << &obj; }
615 #endif // ZYPP_SAT_LOOKUPATTR_H std::string asString(const Patch::Category &obj)
DIWrap()
NULL detail::CDataiterator
SolvAttr parent() const
Whether to search within a sub-structure (SolvAttr::noAttr if not)
void skipSolvAttr()
Immediately advance to the next SolvAttr.
A Solvable object within the sat Pool.
void setPool(Location=SOLV_ATTR)
Set search in Pool (all repositories).
LookupAttr & operator=(const LookupAttr &)=default
Solvable solvable() const
Whether to search in one Solvable.
void setAttr(SolvAttr attr_r)
Set the SolvAttr to search.
::s_Dataiterator CDataiterator
Wrapped libsolv C data type exposed as backdoor.
String matching (STRING|SUBSTRING|GLOB|REGEX).
const StrMatcher & strMatcher() const
The pattern to match.
Lightweight attribute value lookup.
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.
bool equal(const boost::iterator_adaptor< OtherDerived, OtherIterator, V, C, R, D > &rhs) const
String related utilities and Regular expression matching.
std::ostream & operator<<(std::ostream &str, const SerialNumber &obj)
int IdType
Generic Id type.
Access to the sat-pools string space.
RWCOW_pointer< Impl > _pimpl
Search for solvable attributes (default)
const std::string & getstr() const
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.
void skipSolvable()
Immediately advance to the next Solvable.
iterator end() const
Iterator behind the end of query results.
detail::IdType id() const
DIWrap & operator=(const DIWrap &rhs)
void setRepo(Repository repo_r, Location=SOLV_ATTR)
Set search in one Repository.
Tp asType() const
Templated return type.
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...
LookupRepoAttr(SolvAttr attr_r)
Wrapper around sat detail::CDataiterator.
void setStrMatcher(const StrMatcher &matcher_r)
Set the pattern to match.
LookupRepoAttr()
Default ctor finds nothing.
bool pool() const
Whether to search in Pool.
SolvAttr attr() const
The SolvAttr to search.
Repository repo() const
Whether to search in one Repository.
detail::CDataiterator * operator->() const
void setPool()
Set search in Pool (all repositories).
CRepo * RepoIdType
Id type to connect Repo and sat-repo.
std::ostream & operator<<(std::ostream &str, const LookupAttr &obj)
detail::CDataiterator * _dip
unsigned int SolvableIdType
Id type to connect Solvable and sat-solvable.
size_type size() const
Ammount of results.
bool atEnd() const
Whether this points to the end of a query (Iterator is invalid).
Easy-to use interface to the ZYPP dependency resolver.
Location
Specify the where to look for the attribule.
bool empty() const
Whether the query is empty.
iterator begin() const
Iterator to the begin of query results.
RW_pointer supporting 'copy on write' functionality.
Search for repository attributes.
void swap(DIWrap &rhs) noexcept