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);
432 bool recover( std::istream &str,
char delim =
'\n' );
443 void serialize( std::ostream &str,
char delim =
'\n' )
const;
485 std::ostream & operator<<( std::ostream & str, const
PoolQuery & obj );
494 class PoolQueryMatcher;
509 , sat::LookupAttr::iterator
510 , const sat::Solvable
511 , boost::forward_traversal_tag
512 , const sat::Solvable
515 typedef std::vector<sat::LookupAttr::iterator>
Matches;
526 : _matcher( matcher_r )
585 friend class boost::iterator_core_access;
588 {
return base_reference().inSolvable(); }
593 const Matches & matches()
const;
603 {
return str << obj.base(); }
619 #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)
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.
bool requireAll() const ZYPP_DEPRECATED
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.
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
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.
void setRequireAll(bool require_all=true) ZYPP_DEPRECATED
std::set< std::string > StrContainer
void setStatusFilterFlags(StatusFilter flags)
Set status filter directly.
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 substring to match words.
std::ostream & dumpOn(std::ostream &str, const PoolQuery &obj)
Match flags() const
Free function to get libsolv repo search flags.
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.
bool operator<(const PoolQuery &b) const
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.
#define ZYPP_DEPRECATED
The ZYPP_DEPRECATED macro can be used to trigger compile-time warnings with gcc >= 3...
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)