|
libzypp
9.1.2
|
Lightweight attribute value lookup. More...
#include <LookupAttr.h>

Classes | |
| class | Impl |
| LookupAttr implememtation. More... | |
| class | iterator |
| Result iterator. More... | |
| class | transformIterator |
TransformIterator returning an iterator value of type _ResultT. More... | |
Public Types | |
| enum | Location { SOLV_ATTR = 0, REPO_ATTR = -1 } |
| Specify the where to look for the attribule. More... | |
| typedef MatchException | Exception |
| typedef unsigned | size_type |
Public Member Functions | |
| LookupAttr () | |
| Default ctor finds nothing. | |
| LookupAttr (SolvAttr attr_r, Location=SOLV_ATTR) | |
| Lookup SolvAttr in Pool (all repositories). | |
| LookupAttr (SolvAttr attr_r, SolvAttr parent_r, Location=SOLV_ATTR) | |
| LookupAttr (SolvAttr attr_r, Repository repo_r, Location=SOLV_ATTR) | |
| Lookup SolvAttr in oneRepository. | |
| LookupAttr (SolvAttr attr_r, SolvAttr parent_r, Repository repo_r, Location=SOLV_ATTR) | |
| LookupAttr (SolvAttr attr_r, Solvable solv_r) | |
| Lookup SolvAttr in one Solvable. | |
| LookupAttr (SolvAttr attr_r, SolvAttr parent_r, Solvable solv_r) | |
Search result. | |
| iterator | begin () const |
| Iterator to the begin of query results. | |
| iterator | end () const |
| Iterator behind the end of query results. | |
| bool | empty () const |
| Whether the query is empty. | |
| size_type | size () const |
| Ammount of results. | |
What to search. | |
| SolvAttr | attr () const |
| The SolvAttr to search. | |
| void | setAttr (SolvAttr attr_r) |
| Set the SolvAttr to search. | |
Restrict attributes to match a pattern. | |
| const AttrMatcher & | attrMatcher () const |
| The pattern to match. | |
| void | setAttrMatcher (const AttrMatcher &matcher_r) |
| Set the pattern to match. | |
| void | resetAttrMatcher () |
| Reset the pattern to match. | |
Where to search. | |
| bool | pool () const |
| Wheter to search in Pool. | |
| void | setPool (Location=SOLV_ATTR) |
| Set search in Pool (all repositories). | |
| Repository | repo () const |
| Wheter to search in one Repository. | |
| void | setRepo (Repository repo_r, Location=SOLV_ATTR) |
| Set search in one Repository. | |
| Solvable | solvable () const |
| Wheter to search in one Solvable. | |
| void | setSolvable (Solvable solv_r) |
| Set search in one Solvable. | |
| SolvAttr | parent () const |
| Whether to search within a sub-structure (SolvAttr::noAttr if not) | |
| void | setParent (SolvAttr attr_r) |
| Set search within a sub-structure (SolvAttr::noAttr for none) | |
Private Attributes | |
| RWCOW_pointer< Impl > | _pimpl |
Related Functions | |
(Note that these are not member functions.) | |
| std::ostream & | operator<< (std::ostream &str, const LookupAttr &obj) |
| std::ostream & | dumpOn (std::ostream &str, const LookupAttr &obj) |
Lightweight attribute value lookup.
Search for an attribute in Pool, one Repository or one Solvable. LookupAttr builds the query, LookupAttr::iterator iterates over the result.
Per default LookupAttr looks for attributes associated with a Solvable. But you may also pass REPO_ATTR as Location argument, to lookup attributes associated with the Repository (e.g. DeltaRpm information).
For convenience
Modifying the query will not affect any running iterator.
Use SolvAttr::allAttr to search all attributes.
To search for attributes located in a sub-structure (flexarray) you also have to pass the sub-structures attribute as parent. Passing SolvAttr::allAttr a parent will lookup the attribute in any sub-structure. Few attributes are known to have a parent (
// Lookup all 'name' attributes: sat::LookupAttr q( sat::SolvAttr::name ); // Lookup all 'name' attributes within a sub-structure 'data': sat::LookupAttr q( sat::SolvAttr::name, sat::SolvAttr::data ); // Lookup all 'name' attributes within any sub-structure: sat::LookupAttr q( sat::SolvAttr::name, sat::SolvAttr::allAttr );
// look for all attributes of one solvable void ditest( sat::Solvable slv_r ) { sat::LookupAttr q( sat::SolvAttr::allAttr, slv_r ); MIL << q << ": " << endl; for_( it, q.begin(), q.end() ) { MIL << " " << it.inSolvAttr() << " = " << it.asString() << endl; } }
// look for an attribute in the pool. sat::LookupAttr q( sat::SolvAttr("susetags:datadir") ); MIL << q << ": " << endl; for_( it, q.begin(), q.end() ) { MIL << " " << it << endl; }
// look for a repo attribute in the pool. sat::LookupRepoAttr q( sat::SolvAttr::repositoryAddedFileProvides ); MIL << q << ": " << endl; for_( it, q.begin(), q.end() ) { MIL << " " << it << endl; }
Definition at line 112 of file LookupAttr.h.
Definition at line 115 of file LookupAttr.h.
| typedef unsigned zypp::sat::LookupAttr::size_type |
Definition at line 118 of file LookupAttr.h.
Specify the where to look for the attribule.
| SOLV_ATTR |
Search for solvable attributes (default) |
| REPO_ATTR |
Search for repository attributes. |
Definition at line 121 of file LookupAttr.h.
Default ctor finds nothing.
Definition at line 168 of file LookupAttr.cc.
| zypp::sat::LookupAttr::LookupAttr | ( | SolvAttr | attr_r, |
| Location | loc_r = SOLV_ATTR |
||
| ) | [explicit] |
Lookup SolvAttr in Pool (all repositories).
Definition at line 172 of file LookupAttr.cc.
| zypp::sat::LookupAttr::LookupAttr | ( | SolvAttr | attr_r, |
| SolvAttr | parent_r, | ||
| Location | loc_r = SOLV_ATTR |
||
| ) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 175 of file LookupAttr.cc.
References _pimpl, and zypp::sat::LookupAttr::Impl::setParent().
| zypp::sat::LookupAttr::LookupAttr | ( | SolvAttr | attr_r, |
| Repository | repo_r, | ||
| Location | loc_r = SOLV_ATTR |
||
| ) |
Lookup SolvAttr in oneRepository.
Definition at line 179 of file LookupAttr.cc.
| zypp::sat::LookupAttr::LookupAttr | ( | SolvAttr | attr_r, |
| SolvAttr | parent_r, | ||
| Repository | repo_r, | ||
| Location | loc_r = SOLV_ATTR |
||
| ) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 182 of file LookupAttr.cc.
References _pimpl, and zypp::sat::LookupAttr::Impl::setParent().
| zypp::sat::LookupAttr::LookupAttr | ( | SolvAttr | attr_r, |
| Solvable | solv_r | ||
| ) |
Lookup SolvAttr in one Solvable.
Definition at line 186 of file LookupAttr.cc.
| zypp::sat::LookupAttr::LookupAttr | ( | SolvAttr | attr_r, |
| SolvAttr | parent_r, | ||
| Solvable | solv_r | ||
| ) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 189 of file LookupAttr.cc.
References _pimpl, and zypp::sat::LookupAttr::Impl::setParent().
Iterator to the begin of query results.
Definition at line 236 of file LookupAttr.cc.
References _pimpl, and zypp::sat::LookupAttr::Impl::begin().
Referenced by zypp::sat::ArrayAttr< _ResultT, _AttrT >::begin(), zypp::Patch::contents(), zypp::repo::DeltaCandidates::deltaRpms(), zypp::sat::dumpOn(), empty(), zypp::Repository::generatedTimestamp(), zypp::detail::PoolQueryMatcher::isAMatch(), zypp::RepoManager::loadFromCache(), zypp::detail::PoolQueryMatcher::matchDetail(), zypp::Repository::ProductInfoIterator::ProductInfoIterator(), zypp::Patch::ReferenceIterator::ReferenceIterator(), size(), zypp::detail::PoolQueryMatcher::startNewQyery(), zypp::Repository::suggestedExpirationTimestamp(), and zypp::Product::urls().
Iterator behind the end of query results.
Definition at line 239 of file LookupAttr.cc.
References _pimpl, and zypp::sat::LookupAttr::Impl::end().
Referenced by zypp::Patch::contents(), zypp::repo::DeltaCandidates::deltaRpms(), zypp::sat::dumpOn(), empty(), zypp::sat::ArrayAttr< _ResultT, _AttrT >::end(), zypp::detail::PoolQueryMatcher::isAMatch(), zypp::detail::PoolQueryMatcher::matchDetail(), size(), zypp::detail::PoolQueryMatcher::startNewQyery(), and zypp::Product::urls().
| bool zypp::sat::LookupAttr::empty | ( | ) | const |
Whether the query is empty.
Definition at line 242 of file LookupAttr.cc.
References begin(), and end().
Referenced by zypp::sat::ArrayAttr< _ResultT, _AttrT >::empty(), zypp::Repository::generatedTimestamp(), zypp::detail::PoolQueryMatcher::isAMatch(), zypp::detail::PoolQueryMatcher::matchDetail(), and zypp::Repository::suggestedExpirationTimestamp().
Ammount of results.
Definition at line 245 of file LookupAttr.cc.
| SolvAttr zypp::sat::LookupAttr::attr | ( | ) | const |
The SolvAttr to search.
Definition at line 196 of file LookupAttr.cc.
References _pimpl, and zypp::sat::LookupAttr::Impl::attr().
Referenced by zypp::sat::operator<<().
| void zypp::sat::LookupAttr::setAttr | ( | SolvAttr | attr_r | ) |
Set the SolvAttr to search.
Definition at line 199 of file LookupAttr.cc.
References _pimpl, and zypp::sat::LookupAttr::Impl::setAttr().
Referenced by zypp::detail::PoolQueryMatcher::startNewQyery().
| const AttrMatcher & zypp::sat::LookupAttr::attrMatcher | ( | ) | const |
The pattern to match.
You can also evaluate AttrMatcher in a boolean context, in order to test whether an AttrMatcher is set:
LookupAttr q; if ( q.attrMatcher() ) ...; // an AttrMatcher is set
Definition at line 202 of file LookupAttr.cc.
References _pimpl, and zypp::sat::LookupAttr::Impl::attrMatcher().
| void zypp::sat::LookupAttr::setAttrMatcher | ( | const AttrMatcher & | matcher_r | ) |
Set the pattern to match.
| MatchException | Any of the exceptions thrown by AttrMatcher::compile. |
Definition at line 205 of file LookupAttr.cc.
References _pimpl, and zypp::sat::LookupAttr::Impl::setAttrMatcher().
Referenced by zypp::detail::PoolQueryMatcher::isAMatch(), zypp::detail::PoolQueryMatcher::matchDetail(), and zypp::detail::PoolQueryMatcher::startNewQyery().
Reset the pattern to match.
| bool zypp::sat::LookupAttr::pool | ( | ) | const |
Wheter to search in Pool.
Definition at line 210 of file LookupAttr.cc.
References _pimpl, and zypp::sat::LookupAttr::Impl::pool().
| void zypp::sat::LookupAttr::setPool | ( | Location | loc_r = SOLV_ATTR | ) |
Set search in Pool (all repositories).
Definition at line 213 of file LookupAttr.cc.
References _pimpl, and zypp::sat::LookupAttr::Impl::setPool().
| Repository zypp::sat::LookupAttr::repo | ( | ) | const |
Wheter to search in one Repository.
Definition at line 216 of file LookupAttr.cc.
References _pimpl, and zypp::sat::LookupAttr::Impl::repo().
Referenced by zypp::sat::operator<<().
| void zypp::sat::LookupAttr::setRepo | ( | Repository | repo_r, |
| Location | loc_r = SOLV_ATTR |
||
| ) |
Set search in one Repository.
Definition at line 219 of file LookupAttr.cc.
References _pimpl, and zypp::sat::LookupAttr::Impl::setRepo().
Referenced by zypp::detail::PoolQueryMatcher::startNewQyery().
| Solvable zypp::sat::LookupAttr::solvable | ( | ) | const |
Wheter to search in one Solvable.
Definition at line 222 of file LookupAttr.cc.
References _pimpl, and zypp::sat::LookupAttr::Impl::solvable().
Referenced by zypp::sat::operator<<().
| void zypp::sat::LookupAttr::setSolvable | ( | Solvable | solv_r | ) |
Set search in one Solvable.
Definition at line 225 of file LookupAttr.cc.
References _pimpl, and zypp::sat::LookupAttr::Impl::setSolvable().
| SolvAttr zypp::sat::LookupAttr::parent | ( | ) | const |
Whether to search within a sub-structure (SolvAttr::noAttr if not)
Definition at line 228 of file LookupAttr.cc.
References _pimpl, and zypp::sat::LookupAttr::Impl::parent().
| void zypp::sat::LookupAttr::setParent | ( | SolvAttr | attr_r | ) |
Set search within a sub-structure (SolvAttr::noAttr for none)
Definition at line 231 of file LookupAttr.cc.
References _pimpl, and zypp::sat::LookupAttr::Impl::setParent().
| std::ostream & operator<< | ( | std::ostream & | str, |
| const LookupAttr & | obj | ||
| ) | [related] |
Stream output.
Definition at line 255 of file LookupAttr.cc.
| std::ostream & dumpOn | ( | std::ostream & | str, |
| const LookupAttr & | obj | ||
| ) | [related] |
Verbose stream output including the query result.
Definition at line 272 of file LookupAttr.cc.
RWCOW_pointer<Impl> zypp::sat::LookupAttr::_pimpl [private] |
Definition at line 230 of file LookupAttr.h.
Referenced by attr(), attrMatcher(), begin(), end(), LookupAttr(), parent(), pool(), repo(), setAttr(), setAttrMatcher(), setParent(), setPool(), setRepo(), setSolvable(), and solvable().
1.7.6.1