12 #ifndef ZYPP_POOLQUERY_H
13 #define ZYPP_POOLQUERY_H
34 class PoolQueryIterator;
93 typedef std::set<ResKind>
Kinds;
154 void addRepo(
const std::string &repoalias);
188 void addString(
const std::string & value);
443 bool recover( std::istream &str,
char delim =
'\n' );
454 void serialize( std::ostream &str,
char delim =
'\n' )
const;
498 class PoolQueryMatcher;
513 , sat::LookupAttr::iterator
514 , const sat::Solvable
515 , boost::forward_traversal_tag
516 , const sat::Solvable
519 typedef std::vector<sat::LookupAttr::iterator>
Matches;
592 {
return base_reference().inSolvable(); }
607 {
return str << obj.base(); }
623 #endif // ZYPP_POOLQUERY_H
PoolQueryIterator(const shared_ptr< PoolQueryMatcher > &matcher_r)
PoolQuery ctor.
const Rel editionRel() const
A Solvable object within the sat Pool.
std::ostream & operator<<(std::ostream &str, const PoolQueryIterator &obj)
void setUninstalledOnly()
Return only packages from repos other than .
StatusFilter
Installed status filter setters.
matches_iterator matchesBegin() const
Begin of matches.
void addAttribute(const sat::SolvAttr &attr, const std::string &value="")
Filter by the value of the specified attr attribute.
bool filesMatchBasename() const
void addDependency(const sat::SolvAttr &attr, const Rel &op, const Edition &edition, const Arch &arch)
std::set< ResKind > Kinds
String matching option flags as used e.g.
void addDependency(const sat::SolvAttr &attr, const std::string &name)
std::ostream & dumpOn(std::ostream &str, const PoolQueryIterator &obj)
void addDependency(const sat::SolvAttr &attr, const std::string &name, const Arch &arch)
const StrContainer & strings() const
Search strings added via addString()
const StrContainer & attribute(const sat::SolvAttr &attr) const
PoolQuery iterator as returned by PoolQuery::begin.
void setFlags(const Match &flags)
Free function to set libsolv repo search flags.
void execute(ProcessResolvable fnc)
Executes the query with the current settings.
void addString(const std::string &value)
Add a global query string.
bool filesMatchFullPath() const
Whether searching in filelists looks at the full path or just at the basenames.
void setFilesMatchBasename(bool value=true)
bool operator==(const PoolQuery &b) const
size_type matchesSize() const
Number of attribute matches.
const Edition edition() const
void setMatchGlob()
Set to match globs.
void setMatchRegex()
Set to use the query strings as regexes.
bool recover(std::istream &str, char delim= '\n')
Reads from stream query.
const Matches & matches() const
detail::PoolQueryIterator const_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).
void addDependency(const sat::SolvAttr &attr, const std::string &name, const Edition &edition)
void addKind(const ResKind &kind)
Filter by selectable kind.
Edition represents [epoch:]version[-release]
bool caseSensitive() const
returns true if search is case sensitive
bool matchesEmpty() const
False unless this is the end iterator.
void addDependency(const sat::SolvAttr &attr)
matches_iterator matchesEnd() const
End of matches.
const StrContainer & repos() const
Matches::size_type size_type
bool requireAll() const
Whether all values added via addString() or addAttribute() are required to match the values of the re...
std::vector< sat::LookupAttr::iterator > Matches
bool operator!=(const PoolQuery &b) const
Base class providing common iterator types based on a Solvable iterator.
sat::Solvable dereference() const
Match::Mode matchMode() const
Returns string matching mode as enum.
std::set< std::string > StrContainer
void setStatusFilterFlags(StatusFilter flags)
Set status filter directly.
std::ostream & operator<<(std::ostream &str, const Exception &obj)
void addRepo(const std::string &repoalias)
Filter by repo.
const AttrRawStrMap & attributes() const
Map (map<SolvAttr, StrContainer>) of attribute values added via addAttribute(), addDep in string form...
void setMatchWord()
Set to match words (uses regex)
friend class boost::iterator_core_access
Match flags() const
Free function to get libsolv repo search flags.
std::ostream & dumpOn(std::ostream &str, const Capability &obj)
void setInstalledOnly()
Return only repo packages.
Mode
Mode flags (mutual exclusive).
void addDependency(const sat::SolvAttr &attr, const std::string &name, const Edition &edition, const Arch &arch)
Matches::const_iterator matches_iterator
void setMatchSubstring()
Set to substring (the default).
std::map< sat::SolvAttr, StrContainer > AttrRawStrMap
bool matchSubstring() const
StatusFilter statusFilterFlags() const
const Kinds & kinds() const
bool empty() const
Whether the result is empty.
void setEdition(const Edition &edition, const Rel &op=Rel::EQ)
Set version condition.
void setMatchExact()
Set to match exact string instead of substring.
shared_ptr< PoolQueryMatcher > _matcher
Wrapper for const correct access via Smart pointer types.
Mode mode() const
Return the mode part.
size_type size() const
Number of solvables in the query result.
shared_ptr< Matches > _matches
void addDependency(const sat::SolvAttr &attr, const Edition &edition, const Arch &arch)
void serialize(std::ostream &str, char delim= '\n') const
Writes a machine-readable string representation of the query to stream.
void setFilesMatchFullPath(bool value=true)
If set (default), look at the full path when searching in filelists.
RW_pointer< Impl > _pimpl
Pointer to implementation.
const_iterator begin() const
Query result accessers.
void addDependency(const sat::SolvAttr &attr, const Arch &arch)
const_iterator end() const
An iterator pointing to the end of the query result.
std::string asString() const
Return a human-readable description of the query.
function< bool(const sat::Solvable &)> ProcessResolvable
void addDependency(const sat::SolvAttr &attr, const Rel &op, const Edition &edition)
PoolQueryIterator()
Default ctor is also end.
void addDependency(const sat::SolvAttr &attr, const Edition &edition)
void setRequireAll(bool require_all=true)
Require that all of the values set by addString or addAttribute match the values of respective attrib...