12#ifndef ZYPP_POOLQUERY_H
13#define ZYPP_POOLQUERY_H
93 using Kinds = std::set<ResKind>;
161 void addRepo(
const std::string &repoalias);
181 void setInstalledOnly();
183 void setUninstalledOnly();
185 void setStatusFilterFlags( StatusFilter flags );
199 void addString(
const std::string & value);
226 void addAttribute(
const sat::SolvAttr & attr,
const std::string & value =
"" );
289 void addDependency(
const sat::SolvAttr & attr,
const std::string & name,
const Rel & op,
const Edition & edition );
291 void addDependency(
const sat::SolvAttr & attr,
const std::string & name,
const Rel & op,
const Edition & edition,
const Arch & arch );
359 void setCaseSensitive(
bool value =
true );
366 void setFilesMatchFullPath(
bool value =
true );
372 void setMatchExact();
374 void setMatchSubstring();
378 void setMatchRegex();
388 const StrContainer & strings()
const;
392 const AttrRawStrMap & attributes()
const;
394 const StrContainer & attribute(
const sat::SolvAttr & attr)
const;
396 const Kinds & kinds()
const;
398 const StrContainer & repos()
const;
400 const std::string & comment()
const;
403 const Rel editionRel()
const;
408 bool caseSensitive()
const;
411 bool filesMatchFullPath()
const;
416 bool matchExact()
const;
417 bool matchSubstring()
const;
418 bool matchGlob()
const;
419 bool matchRegex()
const;
420 bool matchWord()
const;
426 {
return flags().mode(); }
428 StatusFilter statusFilterFlags()
const;
441 bool recover( std::istream &
str,
char delim =
'\n' );
452 void serialize( std::ostream &
str,
char delim =
'\n' )
const;
477 void setFlags(
const Match & flags );
503 class PoolQueryMatcher;
518 , sat::LookupAttr::iterator
519 , const sat::Solvable
520 , boost::forward_traversal_tag
521 , const sat::Solvable
524 using Matches = std::vector<sat::LookupAttr::iterator>;
594 friend class boost::iterator_core_access;
597 {
return base_reference().inSolvable(); }
602 const Matches & matches()
const;
612 {
return str << obj.base(); }
Edition represents [epoch:]version[-release]
String matching option flags as used e.g.
Mode
Mode flags (mutual exclusive).
Match flags() const
Free function to get libsolv repo search flags.
void addDependency(const sat::SolvAttr &attr, const Arch &arch)
RW_pointer< Impl > _pimpl
Pointer to implementation.
std::ostream & dumpOn(std::ostream &str, const PoolQuery &obj) ZYPP_API
Detailed stream output.
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.
bool empty() const
Whether the result is empty.
void addKind(const ResKind &kind)
Filter by selectable kind.
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...
bool operator!=(const PoolQuery &b) const
function< bool(const sat::Solvable &)> ProcessResolvable
std::map< sat::SolvAttr, StrContainer > AttrRawStrMap
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.
Match::Mode matchMode() const
Returns string matching mode as enum.
const Edition edition() const
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.
void addDependency(const sat::SolvAttr &attr, const std::string &name, const Arch &arch)
void addDependency(const sat::SolvAttr &attr, const Edition &edition)
std::set< std::string > StrContainer
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)
void addDependency(const sat::SolvAttr &attr, const std::string &name, const Rel &op, const Edition &edition)
Query "name|global op edition".
detail::PoolQueryIterator const_iterator
StatusFilter
Installed status filter setters.
void addDependency(const sat::SolvAttr &attr)
void setFilesMatchFullPath(bool value=true)
If set (default), look at the full path when searching in filelists.
std::set< ResKind > Kinds
void addDependency(const sat::SolvAttr &attr, const std::string &name, const Edition &edition)
void addDependency(const sat::SolvAttr &attr, const std::string &name)
PoolQuery iterator as returned by PoolQuery::begin.
const Matches & matches() const
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.
bool operator<(const StrMatcher &lhs, const StrMatcher &rhs)
bool operator==(const SetRelation::Enum &lhs, const SetCompare &rhs)
This is an overloaded member function, provided for convenience. It differs from the above function o...
std::ostream & dumpOn(std::ostream &str, const Capability &obj)
const ResKind ResTraits< Package >::kind(ResKind::package)
const Arch Arch_armv7hnl Arch_armv7nhl ZYPP_API
std::string asString(const Patch::Category &obj)
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....