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