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);
195 void addString(
const std::string & value);
452 bool recover( std::istream &
str,
char delim =
'\n' );
463 void serialize( std::ostream &
str,
char delim =
'\n' )
const;
508 class PoolQueryMatcher;
523 , sat::LookupAttr::iterator
524 , const sat::Solvable
525 , boost::forward_traversal_tag
526 , const sat::Solvable
529 typedef std::vector<sat::LookupAttr::iterator>
Matches;
602 {
return base_reference().inSolvable(); }
617 {
return str << obj.base(); }
633 #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
void setRequireAll(bool require_all=true)
Require that all of the values set by addString or addAttribute match the values of respective attrib...
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.
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
const Matches & matches() 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 setStatusFilterFlags(StatusFilter flags)
Set status filter directly.
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.
std::ostream & dumpOn(std::ostream &str, const PoolQueryIterator &obj)
bool operator==(const PoolQuery &b) const
std::vector< sat::LookupAttr::iterator > Matches
friend class boost::iterator_core_access
matches_iterator matchesEnd() const
End of matches.
std::set< std::string > StrContainer
const StrContainer & repos() const
void setMatchWord()
Set to match words (uses regex)
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.
shared_ptr< PoolQueryMatcher > _matcher
Matches::const_iterator matches_iterator
void setMatchSubstring()
Set to substring (the default).
std::ostream & operator<<(std::ostream &str, const Exception &obj)
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 requireAll() const
Whether all values added via addString() or addAttribute() are required to match the values of the re...
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. by StrMatcher.
std::ostream & dumpOn(std::ostream &str, const Capability &obj)
void addDependency(const sat::SolvAttr &attr, const Edition &edition)
const Edition edition() const
size_type matchesSize() const
Number of attribute matches.
Resolvable kinds. A lowercased string and used as identification. Comparison against string values is...
std::string asString() const
Return a human-readable description of the query.
std::ostream & operator<<(std::ostream &str, const PoolQueryIterator &obj)
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.