Go to the documentation of this file.
12 #ifndef ZYPP_POOLQUERY_H
13 #define ZYPP_POOLQUERY_H
34 class PoolQueryIterator;
93 typedef std::set<ResKind>
Kinds;
161 void addRepo(
const std::string &repoalias);
194 void addString(
const std::string & value);
434 bool recover( std::istream &
str,
char delim =
'\n' );
445 void serialize( std::ostream &
str,
char delim =
'\n' )
const;
474 void setRequireAll(
bool require_all =
true ) ZYPP_DEPRECATED;
496 class PoolQueryMatcher;
511 , sat::LookupAttr::iterator
512 , const sat::Solvable
513 , boost::forward_traversal_tag
514 , const sat::Solvable
517 typedef std::vector<sat::LookupAttr::iterator>
Matches;
528 : _matcher( matcher_r )
587 friend class boost::iterator_core_access;
590 {
return base_reference().inSolvable(); }
595 const Matches & matches()
const;
605 {
return str << obj.base(); }
621 #endif // ZYPP_POOLQUERY_H
const AttrRawStrMap & attributes() const
Map (map<SolvAttr, StrContainer>) of attribute values added via addAttribute(), addDep in string form...
std::set< ResKind > Kinds
PoolQueryIterator(const shared_ptr< PoolQueryMatcher > &matcher_r)
\Ref PoolQuery ctor.
A Solvable object within the sat Pool.
void addString(const std::string &value)
Add a global query string.
void setFilesMatchBasename(bool value=true)
This is an overloaded member function, provided for convenience. It differs from the above function o...
void setFlags(const Match &flags)
Free function to set libsolv repo search flags.
StatusFilter
Installed status filter setters.
bool requireAll() const ZYPP_DEPRECATED
void addAttribute(const sat::SolvAttr &attr, const std::string &value="")
Filter by the value of the specified attr attribute.
void setMatchGlob()
Set to match globs.
void addDependency(const sat::SolvAttr &attr, const std::string &name)
void addDependency(const sat::SolvAttr &attr, const Rel &op, const Edition &edition, const Arch &arch)
Match::Mode matchMode() const
Returns string matching mode as enum.
void addDependency(const sat::SolvAttr &attr, const std::string &name, const Arch &arch)
bool matchesEmpty() const
False unless this is the end iterator.
void addDependency(const sat::SolvAttr &attr, const std::string &name, const Rel &op, const Edition &edition)
Query "name|global op edition".
void setCaseSensitive(bool value=true)
Turn case sentitivity on or off (unsets or sets SEARCH_NOCASE flag).
PoolQuery iterator as returned by PoolQuery::begin.
bool operator<(const PoolQuery &b) const
Mode
Mode flags (mutual exclusive).
void execute(ProcessResolvable fnc)
Executes the query with the current settings.
const StrContainer & strings() const
Search strings added via addString()
Edition represents [epoch:]version[-release]
Mode mode() const
Return the mode part.
void setMatchRegex()
Set to use the query strings as regexes.
bool operator!=(const PoolQuery &b) const
void addDependency(const sat::SolvAttr &attr)
Matches::size_type size_type
detail::PoolQueryIterator const_iterator
void addKind(const ResKind &kind)
Filter by selectable kind.
void addDependency(const sat::SolvAttr &attr, const std::string &name, const Edition &edition)
size_type size() const
Number of solvables in the query result.
const Kinds & kinds() const
bool filesMatchFullPath() const
Whether searching in filelists looks at the full path or just at the basenames.
void setRequireAll(bool require_all=true) ZYPP_DEPRECATED
void setStatusFilterFlags(StatusFilter flags)
Set status filter directly.
Wrapper for const correct access via Smart pointer types.
void addRepo(const std::string &repoalias)
Filter by repo.
const StrContainer & attribute(const sat::SolvAttr &attr) const
bool caseSensitive() const
returns true if search is case sensitive
void serialize(std::ostream &str, char delim='\n') const
Writes a machine-readable string representation of the query to stream.
bool operator==(const PoolQuery &b) const
std::vector< sat::LookupAttr::iterator > Matches
std::ostream & dumpOn(std::ostream &str, const PoolQuery &obj)
Detailed stream output.
matches_iterator matchesEnd() const
End of matches.
std::set< std::string > StrContainer
const StrContainer & repos() const
void setMatchWord()
Set substring to match words.
const_iterator end() const
An iterator pointing to the end of the query result.
void setInstalledOnly()
Return only @System repo packages.
Easy-to use interface to the ZYPP dependency resolver.
const_iterator begin() const
Query result accessers.
void addDependency(const sat::SolvAttr &attr, const std::string &name, const Edition &edition, const Arch &arch)
const Rel editionRel() const
bool recover(std::istream &str, char delim='\n')
Reads from stream query.
std::map< sat::SolvAttr, StrContainer > AttrRawStrMap
Base class providing common iterator types based on a Solvable iterator.
void setEdition(const Edition &edition, const Rel &op=Rel::EQ)
Set version condition.
std::string asString() const
Return a human-readable description of the query.
shared_ptr< PoolQueryMatcher > _matcher
Matches::const_iterator matches_iterator
void setMatchSubstring()
Set to substring (the default).
bool empty() const
Whether the result is empty.
void addDependency(const sat::SolvAttr &attr, const Edition &edition, const Arch &arch)
void addDependency(const sat::SolvAttr &attr, const Arch &arch)
RW_pointer< Impl > _pimpl
Pointer to implementation.
void setMatchExact()
Set to match exact string instead of substring.
bool matchSubstring() const
StatusFilter statusFilterFlags() const
Match flags() const
Free function to get libsolv repo search flags.
matches_iterator matchesBegin() const
Begin of matches.
String related utilities and Regular expression matching.
function< bool(const sat::Solvable &)> ProcessResolvable
shared_ptr< Matches > _matches
sat::Solvable dereference() const
bool filesMatchBasename() const
This is an overloaded member function, provided for convenience. It differs from the above function o...
void setFilesMatchFullPath(bool value=true)
If set (default), look at the full path when searching in filelists.
String matching option flags as used e.g.
void addDependency(const sat::SolvAttr &attr, const Edition &edition)
const Edition edition() const
size_type matchesSize() const
Number of attribute matches.
std::ostream & operator<<(std::ostream &str, const PoolQueryIterator &obj)
Stream output.
void addDependency(const sat::SolvAttr &attr, const Rel &op, const Edition &edition)
void setUninstalledOnly()
Return only packages from repos other than @System.
PoolQueryIterator()
Default ctor is also end.