libzypp
17.35.14
|
Lightweight attribute value lookup. More...
#include <zypp/sat/LookupAttr.h>
Classes | |
class | Impl |
LookupAttr implememtation. More... | |
class | iterator |
Result iterator. More... | |
class | TransformIterator |
TransformIterator returning an iterator vaue of type TResult . More... | |
Public Types | |
enum | Location { SOLV_ATTR = 0, REPO_ATTR = -1 } |
Specify the where to look for the attribule. More... | |
using | Exception = MatchException |
using | size_type = unsigned int |
Public Member Functions | |
LookupAttr () | |
Default ctor finds nothing. More... | |
LookupAttr (const LookupAttr &)=default | |
LookupAttr (LookupAttr &&) noexcept=default | |
LookupAttr & | operator= (const LookupAttr &)=default |
LookupAttr & | operator= (LookupAttr &&) noexcept=default |
LookupAttr (SolvAttr attr_r, Location=SOLV_ATTR) | |
Lookup SolvAttr in Pool (all repositories). More... | |
LookupAttr (SolvAttr attr_r, SolvAttr parent_r, Location=SOLV_ATTR) | |
LookupAttr (SolvAttr attr_r, Repository repo_r, Location=SOLV_ATTR) | |
Lookup SolvAttr in oneRepository. More... | |
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. More... | |
LookupAttr (SolvAttr attr_r, SolvAttr parent_r, Solvable solv_r) | |
Search result. | |
iterator | begin () const |
Iterator to the begin of query results. More... | |
iterator | end () const |
Iterator behind the end of query results. More... | |
bool | empty () const |
Whether the query is empty. More... | |
size_type | size () const |
Ammount of results. More... | |
What to search. | |
SolvAttr | attr () const |
The SolvAttr to search. More... | |
void | setAttr (SolvAttr attr_r) |
Set the SolvAttr to search. More... | |
Restrict attributes to match a pattern. | |
const StrMatcher & | strMatcher () const |
The pattern to match. More... | |
void | setStrMatcher (const StrMatcher &matcher_r) |
Set the pattern to match. More... | |
void | resetStrMatcher () |
Reset the pattern to match. More... | |
Where to search. | |
bool | pool () const |
Whether to search in Pool. More... | |
void | setPool (Location=SOLV_ATTR) |
Set search in Pool (all repositories). More... | |
Repository | repo () const |
Whether to search in one Repository. More... | |
void | setRepo (Repository repo_r, Location=SOLV_ATTR) |
Set search in one Repository. More... | |
Solvable | solvable () const |
Whether to search in one Solvable. More... | |
void | setSolvable (Solvable solv_r) |
Set search in one Solvable. More... | |
SolvAttr | parent () const |
Whether to search within a sub-structure (SolvAttr::noAttr if not) More... | |
void | setParent (SolvAttr attr_r) |
Set search within a sub-structure (SolvAttr::noAttr for none) More... | |
Private Attributes | |
RWCOW_pointer< Impl > | _pimpl |
Related Functions | |
(Note that these are not member functions.) | |
std::ostream & | operator<< (std::ostream &str, const LookupAttr &obj) ZYPP_API |
std::ostream & | dumpOn (std::ostream &str, const LookupAttr &obj) ZYPP_API |
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 (
Definition at line 109 of file LookupAttr.h.
Definition at line 112 of file LookupAttr.h.
using zypp::sat::LookupAttr::size_type = unsigned int |
Definition at line 115 of file LookupAttr.h.
Specify the where to look for the attribule.
Enumerator | |
---|---|
SOLV_ATTR | Search for solvable attributes (default) |
REPO_ATTR | Search for repository attributes. |
Definition at line 118 of file LookupAttr.h.
zypp::sat::LookupAttr::LookupAttr | ( | ) |
Default ctor finds nothing.
Definition at line 169 of file LookupAttr.cc.
|
default |
|
defaultnoexcept |
Lookup SolvAttr in Pool (all repositories).
Definition at line 173 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 176 of file LookupAttr.cc.
zypp::sat::LookupAttr::LookupAttr | ( | SolvAttr | attr_r, |
Repository | repo_r, | ||
Location | loc_r = SOLV_ATTR |
||
) |
Lookup SolvAttr in oneRepository.
Definition at line 180 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 183 of file LookupAttr.cc.
Lookup SolvAttr in one Solvable.
Definition at line 187 of file LookupAttr.cc.
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 190 of file LookupAttr.cc.
|
default |
|
defaultnoexcept |
LookupAttr::iterator zypp::sat::LookupAttr::begin | ( | ) | const |
Iterator to the begin of query results.
Definition at line 237 of file LookupAttr.cc.
LookupAttr::iterator zypp::sat::LookupAttr::end | ( | ) | const |
Iterator behind the end of query results.
Definition at line 240 of file LookupAttr.cc.
bool zypp::sat::LookupAttr::empty | ( | ) | const |
Whether the query is empty.
Definition at line 243 of file LookupAttr.cc.
LookupAttr::size_type zypp::sat::LookupAttr::size | ( | ) | const |
Ammount of results.
Definition at line 246 of file LookupAttr.cc.
SolvAttr zypp::sat::LookupAttr::attr | ( | ) | const |
The SolvAttr to search.
Definition at line 197 of file LookupAttr.cc.
void zypp::sat::LookupAttr::setAttr | ( | SolvAttr | attr_r | ) |
Set the SolvAttr to search.
Definition at line 200 of file LookupAttr.cc.
const StrMatcher & zypp::sat::LookupAttr::strMatcher | ( | ) | const |
The pattern to match.
You can also evaluate StrMatcher in a boolean context, in order to test whether an StrMatcher is set:
Definition at line 203 of file LookupAttr.cc.
void zypp::sat::LookupAttr::setStrMatcher | ( | const StrMatcher & | matcher_r | ) |
Set the pattern to match.
MatchException | Any of the exceptions thrown by StrMatcher::compile. |
Definition at line 206 of file LookupAttr.cc.
void zypp::sat::LookupAttr::resetStrMatcher | ( | ) |
Reset the pattern to match.
bool zypp::sat::LookupAttr::pool | ( | ) | const |
Whether to search in Pool.
Definition at line 211 of file LookupAttr.cc.
Set search in Pool (all repositories).
Definition at line 214 of file LookupAttr.cc.
Repository zypp::sat::LookupAttr::repo | ( | ) | const |
Whether to search in one Repository.
Definition at line 217 of file LookupAttr.cc.
void zypp::sat::LookupAttr::setRepo | ( | Repository | repo_r, |
Location | loc_r = SOLV_ATTR |
||
) |
Set search in one Repository.
Definition at line 220 of file LookupAttr.cc.
Solvable zypp::sat::LookupAttr::solvable | ( | ) | const |
Whether to search in one Solvable.
Definition at line 223 of file LookupAttr.cc.
void zypp::sat::LookupAttr::setSolvable | ( | Solvable | solv_r | ) |
Set search in one Solvable.
Definition at line 226 of file LookupAttr.cc.
SolvAttr zypp::sat::LookupAttr::parent | ( | ) | const |
Whether to search within a sub-structure (SolvAttr::noAttr if not)
Definition at line 229 of file LookupAttr.cc.
void zypp::sat::LookupAttr::setParent | ( | SolvAttr | attr_r | ) |
Set search within a sub-structure (SolvAttr::noAttr for none)
Definition at line 232 of file LookupAttr.cc.
|
related |
Stream output.
Definition at line 256 of file LookupAttr.cc.
|
related |
Verbose stream output including the query result.
Definition at line 273 of file LookupAttr.cc.
|
private |
Definition at line 233 of file LookupAttr.h.