28 #undef ZYPP_BASE_LOGGER_LOGGROUP 29 #define ZYPP_BASE_LOGGER_LOGGROUP "PoolQuery" 46 bool isDependencyAttribute( sat::SolvAttr attr_r )
48 static sat::SolvAttr deps[] = {
55 SolvAttr::supplements,
68 struct EditionRangePredicate
70 EditionRangePredicate(
const Rel & op,
const Edition & edition )
74 EditionRangePredicate(
const Rel & op,
const Edition & edition,
const Arch & arch )
79 bool operator()( sat::LookupAttr::iterator iter_r )
81 if ( !
_arch.empty() && iter_r.inSolvable().arch() !=
_arch )
84 CapDetail cap( iter_r.id() );
85 if ( ! cap.isSimple() )
89 return overlaps( Edition::MatchRange( cap.op(), cap.ed() ),
_range );
92 std::string serialize()
const 94 std::string ret(
"EditionRange" );
106 struct SolvableRangePredicate
108 SolvableRangePredicate(
const Rel & op,
const Edition & edition )
113 SolvableRangePredicate(
const Rel & op,
const Edition & edition,
const Arch & arch )
118 bool operator()( sat::LookupAttr::iterator iter_r )
120 if ( !
_arch.empty() && iter_r.inSolvable().arch() !=
_arch )
122 return overlaps( Edition::MatchRange( Rel::EQ, iter_r.inSolvable().edition() ),
_range );
125 std::string serialize()
const 127 std::string ret(
"SolvableRange" );
134 Edition::MatchRange
_range;
142 struct CapabilityMatchPredicate
144 CapabilityMatchPredicate( Capability cap_r )
148 bool operator()( sat::LookupAttr::iterator iter_r )
const 150 return _cap.matches( iter_r.asType<Capability>() ) == CapMatch::yes;
153 std::string serialize()
const 155 std::string ret(
"CapabilityMatch" );
186 typedef function<bool(sat::LookupAttr::iterator)> Predicate;
188 static bool always( sat::LookupAttr::iterator ) {
return true; }
189 static bool never( sat::LookupAttr::iterator ) {
return false; }
194 AttrMatchData( sat::SolvAttr attr_r,
const StrMatcher & strMatcher_r )
199 AttrMatchData( sat::SolvAttr attr_r,
const StrMatcher & strMatcher_r,
200 const Predicate & predicate_r,
const std::string & predicateStr_r )
212 template<
class TPredicate>
213 void addPredicate(
const TPredicate & predicate_r )
224 std::string serialize()
const 226 std::string ret(
"AttrMatchData" );
240 static AttrMatchData
deserialize(
const std::string & str_r )
242 std::vector<std::string> words;
244 if ( words.empty() || words[0] !=
"AttrMatchData" )
245 ZYPP_THROW( Exception( str::Str() <<
"Expecting AttrMatchData: " << str_r ) );
246 if ( words.size() != 5 )
247 ZYPP_THROW( Exception( str::Str() <<
"Wrong number of words: " << str_r ) );
250 ret.attr = sat::SolvAttr( words[1] );
251 ret.strMatcher = StrMatcher( words[2] );
252 if ( words[3] ==
"C" )
253 ret.strMatcher.setFlags( Match::OTHER );
254 ret.predicateStr = words[4];
259 if ( ! words.empty() )
261 if ( words[0] ==
"EditionRange" )
263 switch( words.size() )
266 ret.predicate = EditionRangePredicate( Rel(words[1]), Edition(words[2]) );
269 ret.predicate = EditionRangePredicate( Rel(words[1]), Edition(words[2]), Arch(words[3]) );
272 ZYPP_THROW( Exception( str::Str() <<
"Wrong number of words: " << str_r ) );
276 else if ( words[0] ==
"SolvableRange" )
278 switch( words.size() )
281 ret.predicate = SolvableRangePredicate( Rel(words[1]), Edition(words[2]) );
284 ret.predicate = SolvableRangePredicate( Rel(words[1]), Edition(words[2]), Arch(words[3]) );
287 ZYPP_THROW( Exception( str::Str() <<
"Wrong number of words: " << str_r ) );
291 else if ( words[0] ==
"CapabilityMatch" )
293 if ( words.size() != 2 )
294 ZYPP_THROW( Exception( str::Str() <<
"Wrong number of words: " << str_r ) );
295 ret.predicate = CapabilityMatchPredicate( Capability(words[1]) );
298 ZYPP_THROW( Exception( str::Str() <<
"Unknown predicate: " << str_r ) );
310 inline std::ostream &
operator<<( std::ostream &
str,
const AttrMatchData & obj )
312 str << obj.attr <<
": " << obj.strMatcher;
314 str <<
" +(" << obj.predicateStr <<
")";
319 inline bool operator==(
const AttrMatchData & lhs,
const AttrMatchData & rhs )
321 return ( lhs.attr == rhs.attr
322 && lhs.strMatcher == rhs.strMatcher
323 && lhs.predicateStr == rhs.predicateStr );
327 inline bool operator!=(
const AttrMatchData & lhs,
const AttrMatchData & rhs )
328 {
return !( lhs == rhs ); }
331 inline bool operator<(
const AttrMatchData & lhs,
const AttrMatchData & rhs )
333 if ( lhs.attr != rhs.attr )
334 return ( lhs.attr < rhs.attr );
335 if ( lhs.strMatcher != rhs.strMatcher )
336 return ( lhs.strMatcher < rhs.strMatcher );
337 if ( lhs.predicateStr != rhs.predicateStr )
338 return ( lhs.predicateStr < rhs.predicateStr );
342 typedef std::list<AttrMatchData> AttrMatchList;
360 , _require_all(false)
413 && _attrs.size() == 1
414 && _attrs.begin()->first == sat::SolvAttr::name ) )
425 && _kinds == rhs.
_kinds );
438 void compile()
const;
448 friend Impl * rwcowClone<Impl>(
const Impl * rhs );
451 {
return new Impl( *
this ); }
478 void PoolQuery::Impl::compile()
const 480 _attrMatchList.clear();
482 Match cflags( _flags );
483 if ( cflags.
mode() == Match::OTHER )
508 else if (_attrs.size() == 1)
513 rcstrings = createRegex(joined, cflags);
514 if (joined.size() > 1)
516 _attrMatchList.push_back( AttrMatchData( _attrs.begin()->first,
524 bool attrvals_empty =
true;
525 for (AttrRawStrMap::const_iterator ai = _attrs.begin(); ai != _attrs.end(); ++ai)
526 if (!ai->second.empty())
527 for(StrContainer::const_iterator it = ai->second.begin();
528 it != ai->second.end(); it++)
531 attrvals_empty =
false;
532 goto attremptycheckend;
537 bool attrvals_thesame =
true;
538 AttrRawStrMap::const_iterator ai = _attrs.begin();
541 for (; ai != _attrs.end(); ++ai)
545 set1.begin(), set1.end(),
546 ai->second.begin(), ai->second.end(),
547 inserter(result, result.begin()));
550 attrvals_thesame =
false;
559 if (attrvals_empty || attrvals_thesame)
565 rcstrings = createRegex(joined, cflags);
571 rcstrings = createRegex(joined, cflags);
573 if (joined.size() > 1)
577 for_( ai, _attrs.begin(), _attrs.end() )
579 _attrMatchList.push_back( AttrMatchData( ai->first, matcher ) );
589 for_(ai, _attrs.begin(), _attrs.end())
594 string s = createRegex(joined, cflags);
595 if (joined.size() > 1)
597 _attrMatchList.push_back( AttrMatchData( ai->first,
604 if ( ! _uncompiledPredicated.empty() )
608 for_( it, _uncompiledPredicated.begin(), _uncompiledPredicated.end() )
610 if ( it->strMatcher.flags().mode() == Match::OTHER )
614 const std::string & mstr( it->strMatcher.searchstring() );
615 if ( ! mstr.empty() )
616 joined.insert( mstr );
619 rcstrings = createRegex( joined, cflags );
620 if ( joined.size() > 1 )
623 _attrMatchList.push_back( AttrMatchData( it->attr,
625 it->predicate, it->predicateStr ) );
630 _attrMatchList.push_back( *it );
636 if ( _attrMatchList.empty() )
639 rcstrings = createRegex( _strings, cflags );
640 if ( _strings.size() > 1 )
642 _attrMatchList.push_back( AttrMatchData( sat::SolvAttr::allAttr,
647 for_( it, _attrMatchList.begin(), _attrMatchList.end() )
649 it->strMatcher.compile();
660 string regexed = str;
667 for (pos = 0; (pos = regexed.find(
"*", pos)) != std::string::npos; pos+=2)
668 regexed = regexed.replace(pos, 1, r_all);
671 for (pos = 0; (pos = regexed.find(
'?', pos)) != std::string::npos; ++pos)
672 regexed = regexed.replace(pos, 1, r_one);
677 string PoolQuery::Impl::createRegex(
const StrContainer & container,
const Match & flags )
const 680 #define WB (_match_word ? string("\\b") : string()) 683 if (container.empty())
686 if (container.size() == 1)
688 return WB + *container.begin() +
WB;
694 StrContainer::const_iterator it = container.begin();
705 tmp +=
".*" +
WB + tmp;
706 rstr =
"(?=" + tmp +
")";
712 rstr +=
WB +
"(" + tmp;
717 for (; it != container.end(); ++it)
727 tmp +=
".*" +
WB + tmp;
728 rstr +=
"(?=" + tmp +
")";
757 if ( _kinds.empty() )
761 for(Kinds::const_iterator it = _kinds.begin();
762 it != _kinds.end(); ++it)
768 if ( _repos.empty() )
772 for(StrContainer::const_iterator it = _repos.begin();
773 it != _repos.end(); ++it)
778 o <<
"version: "<< _op <<
" " << _edition.asString() << endl;
779 o <<
"status: " << ( _status_flags ? ( _status_flags == INSTALLED_ONLY ?
"INSTALLED_ONLY" :
"UNINSTALLED_ONLY" )
782 o <<
"string match flags: " <<
Match(_flags) << endl;
786 for(StrContainer::const_iterator it = _strings.begin();
787 it != _strings.end(); ++it)
791 o <<
"attributes: " << endl;
792 for(AttrRawStrMap::const_iterator ai = _attrs.begin(); ai != _attrs.end(); ++ai)
794 o <<
"* " << ai->first <<
": ";
795 for(StrContainer::const_iterator vi = ai->second.begin();
796 vi != ai->second.end(); ++vi)
801 o <<
"predicated: " << endl;
802 for_( it, _uncompiledPredicated.begin(), _uncompiledPredicated.end() )
804 o <<
"* " << *it << endl;
808 o <<
"last attribute matcher compiled: " << endl;
809 if ( _attrMatchList.empty() )
811 o <<
"not yet compiled" << endl;
815 for_( it, _attrMatchList.begin(), _attrMatchList.end() )
817 o <<
"* " << *it << endl;
831 PoolQuery::PoolQuery()
840 if (repoalias.empty())
842 WAR <<
"ignoring an empty repository alias" << endl;
883 if ( isDependencyAttribute( attr ) )
884 attrMatchData.addPredicate( EditionRangePredicate( op, edition, arch ) );
886 attrMatchData.addPredicate( SolvableRangePredicate( op, edition, arch ) );
900 if ( isDependencyAttribute( attr ) )
901 attrMatchData.addPredicate( CapabilityMatchPredicate( cap_r ) );
903 attrMatchData.addPredicate( SolvableRangePredicate( cap.
op(), cap.
ed() ) );
954 AttrRawStrMap::const_iterator it =
_pimpl->
_attrs.find(attr);
955 return it !=
_pimpl->
_attrs.end() ? it->second : nocontainer;
1110 bool finded_something =
false;
1118 if ((!s.empty()) && s[0]==
'#')
1124 if (s.empty() || pos == s.npos)
1126 if (finded_something)
1136 finded_something =
true;
1138 string attrName(
str::trim(
string(s,0,pos)));
1139 string attrValue(
str::trim(
string(s,pos+1,s.npos)));
1153 || attribute==
"global_string")
1158 || attribute==
"string_type" )
1181 else if ( s == StringTypeAttr::noAttr )
1183 WAR <<
"unknown string type " << attrValue << endl;
1187 WAR <<
"forget recover some attribute defined as String type attribute: " << attrValue << endl;
1202 WAR <<
"unknown boolean value " << attrValue << endl;
1217 WAR <<
"unknown boolean value " << attrValue << endl;
1222 if( attrValue ==
"all" )
1226 else if( attrValue ==
"installed" )
1230 else if( attrValue ==
"not-installed" )
1236 WAR <<
"Unknown value for install status " << attrValue << endl;
1243 if (attrValue.find_first_of(
"=<>!") == 0)
1245 pos = attrValue.find_last_of(
"=<>");
1246 rel =
Rel(attrValue.substr(0, pos+1));
1247 attrValue =
str::trim(attrValue.substr(pos+1, attrValue.npos));
1264 else if ( attribute==PoolQueryAttr::noAttr )
1266 WAR <<
"empty attribute name" << endl;
1270 string s = attrName;
1273 if ( a == SolvAttr::name || isDependencyAttribute( a ) )
1288 return finded_something;
1300 str <<
"repo: " << *it << delim ;
1306 << it->idStr() << delim ;
1321 <<
": substring" << delim;
1336 str <<
"case_sensitive: ";
1339 str <<
"on" << delim;
1343 str <<
"off" << delim;
1349 str <<
"require_all: ";
1352 str <<
"on" << delim;
1356 str <<
"off" << delim;
1365 str <<
"install_status: all" << delim;
1368 str <<
"install_status: installed" << delim;
1371 str <<
"install_status: not-installed" << delim;
1383 string s = it->first.asString();
1385 for_( it2,it->second.begin(),it->second.end() )
1387 str << s <<
": "<< *it2 << delim;
1391 for_( it,
_pimpl->_uncompiledPredicated.begin(),
_pimpl->_uncompiledPredicated.end() )
1393 str <<
"complex: "<< it->serialize() << delim;
1401 {
return _pimpl->asString(); }
1442 const base_iterator &
end()
const 1444 static base_iterator _end;
1450 if ( base_r ==
end() )
1451 base_r = startNewQyery();
1458 while ( base_r !=
end() )
1460 if ( isAMatch( base_r ) )
1471 void matchDetail(
const base_iterator & base_r, std::vector<base_iterator> & return_r )
const 1473 if ( base_r ==
end() )
1478 if ( _attrMatchList.size() == 1 )
1483 base_iterator base( base_r );
1485 return_r.push_back( base );
1487 const AttrMatchData::Predicate &
predicate( _attrMatchList.front().predicate );
1488 for ( ++base; base.
inSolvable() == inSolvable; ++base )
1491 return_r.push_back( base );
1497 for_( mi, _attrMatchList.begin(), _attrMatchList.end() )
1499 const AttrMatchData & matchData( *mi );
1501 if ( matchData.strMatcher )
1507 const AttrMatchData::Predicate &
predicate( matchData.predicate );
1511 return_r.push_back( it );
1529 for_( it, query_r->_repos.begin(), query_r->_repos.end() )
1535 _neverMatchRepo =
true;
1539 if ( _neverMatchRepo && ! _repos.empty() )
1540 _neverMatchRepo =
false;
1543 _kinds = query_r->_kinds;
1546 _edition = query_r->_edition;
1548 _status_flags = query_r->_status_flags;
1550 _attrMatchList = query_r->_attrMatchList;
1562 if ( _neverMatchRepo )
1566 if ( _repos.size() == 1 )
1571 if ( _attrMatchList.size() == 1 )
1573 const AttrMatchData & matchData( _attrMatchList.front() );
1575 if ( matchData.strMatcher )
1610 if ( _repos.size() > 1 && _repos.find( inRepo ) == _repos.end() )
1618 if ( ! _kinds.empty() && ! inSolvable.isKind( _kinds.begin(), _kinds.end() ) )
1633 if ( _attrMatchList.size() == 1 )
1637 const AttrMatchData::Predicate &
predicate( _attrMatchList.front().predicate );
1645 for_( mi, _attrMatchList.begin(), _attrMatchList.end() )
1647 const AttrMatchData & matchData( *mi );
1649 if ( matchData.strMatcher )
1655 const AttrMatchData::Predicate &
predicate( matchData.predicate );
1688 void PoolQueryIterator::increment()
1697 if ( ! _matcher->advance( base_reference() ) )
1713 _matches.reset(
new Matches );
1714 _matcher->matchDetail( base_reference(), *_matches );
1721 if ( ! obj.matchesEmpty() )
1723 for_( it, obj.matchesBegin(), obj.matchesEnd() )
1725 str << endl <<
" " << it->inSolvAttr() <<
"\t" << it->asString();
int _status_flags
Installed status filter flags.
static const PoolQueryAttr installStatusAttr
Rel _op
Operator for edition condition.
A Solvable object within the sat Pool.
void setUninstalledOnly()
Return only packages from repos other than .
StatusFilter
Installed status filter setters.
static const StringTypeAttr substringAttr
const AttrRawStrMap & attributes() const
Map (map<SolvAttr, StrContainer>) of attribute values added via addAttribute(), addDep in string form...
bool compareByRel(Rel op, const Tp &lhs, const Tp &rhs, TCompare compare)
Comparison of two elements using relational operator op.
void addAttribute(const sat::SolvAttr &attr, const std::string &value="")
Filter by the value of the specified attr attribute.
void setAttr(SolvAttr attr_r)
Set the SolvAttr to search.
unsigned splitEscaped(const C_Str &line_r, TOutputIterator result_r, const C_Str &sepchars_r=" \, bool withEmpty=false)
Split line_r into words with respect to escape delimeters.
std::set< ResKind > Kinds
std::string asString(const DefaultIntegral< Tp, TInitial > &obj)
#define ZYPP_THROW(EXCPT)
Drops a logline and throws the Exception.
String matching option flags as used e.g.
static const SolvAttr allAttr
Value to request searching all Attributes (0).
std::set< ResKind > _kinds
Resolvable kinds to include.
Helper providing more detailed information about a Capability.
PoolQuery::StrContainer & _cont
static const StringTypeAttr noAttr
PoolQuery iterator as returned by PoolQuery::begin.
void setFlags(const Match &flags)
Free function to set libsolv repo search flags.
String matching (STRING|SUBSTRING|GLOB|REGEX).
bool empty() const
Test for an empty Arch (this is Arch_epmty, not Arch_noarch ).
static const PoolQueryAttr caseSensitiveAttr
void execute(ProcessResolvable fnc)
Executes the query with the current settings.
void addString(const std::string &value)
Add a global query string.
Lightweight attribute value lookup.
const StrContainer & strings() const
Search strings added via addString()
constPtrType getPtr() const
std::ostream & operator<<(std::ostream &str, const PoolQuery &obj)
bool operator()(const string &str)
Match::Mode matchMode() const
Returns string matching mode as enum.
std::ostream & dumpRange(std::ostream &str, TIterator begin, TIterator end, const std::string &intro="{", const std::string &pfx="\ ", const std::string &sep="\ ", const std::string &sfx="\, const std::string &extro="}")
Print range defined by iterators (multiline style).
void setMatchGlob()
Set to match globs.
void setMatchRegex()
Set to use the query strings as regexes.
const Arch Arch_empty(IdString::Empty)
String related utilities and Regular expression matching.
PoolQueryMatcher(const shared_ptr< const PoolQuery::Impl > &query_r)
Ctor stores the PoolQuery settings.
void addDependency(const sat::SolvAttr &attr, const std::string &name, const Rel &op, const Edition &edition)
Query "name|global op edition".
void setModeGlob()
Set the mode GLOB.
Access to the sat-pools string space.
void setCaseSensitive(bool value=true)
Turn case sentitivity on or off (unsets or sets SEARCH_NOCASE flag).
Match _flags
Sat solver search flags.
void addKind(const ResKind &kind)
Filter by selectable kind.
#define for_(IT, BEG, END)
Convenient for-loops using iterator.
Edition represents [epoch:]version[-release]
Store PoolQuery settings and assist PoolQueryIterator.
Edition _edition
Edition condition operand.
bool operator==(const SetRelation::Enum &lhs, const SetCompare &rhs)
Mode mode() const
Return the mode part.
void setModeSubstring()
Set the mode SUBSTRING.
const Kinds & kinds() const
Base class for creating IdString based types.
PoolQueryAttr(const std::string &str_r)
size_type size() const
Number of solvables in the query result.
std::string & replaceAll(std::string &str_r, const std::string &from_r, const std::string &to_r)
Replace all occurrences of from_r with to_r in str_r (inplace).
static const PoolQueryAttr noAttr
bool overlaps(Rel lhs, Rel rhs, int cmp)
Compute Range overlaps.
static const PoolQueryAttr repoAttr
bool operator==(const PoolQuery &b) const
void serialize(std::ostream &str, char delim='\n') const
Writes a machine-readable string representation of the query to stream.
bool operator!=(const PoolQuery::Impl &rhs) const
const StrContainer & attribute(const sat::SolvAttr &attr) const
std::vector< sat::LookupAttr::iterator > Matches
AttrMatchList _attrMatchList
StrMatcher per attribtue.
iterator end() const
Iterator behind the end of query results.
void turn(const Match &rhs, bool onoff)
Depending on the value of onoff, set or unset flags.
Edition::MatchRange _range
bool caseSensitive() const
returns true if search is case sensitive
std::string getline(std::istream &str)
Read one line from stream.
StringTypeAttr(const char *cstr_r)
static Pool instance()
Singleton ctor.
bool filesMatchFullPath() const
Whether searching in filelists looks at the full path or just at the basenames.
std::set< std::string > StrContainer
std::string asString() const
void setRepo(Repository repo_r, Location=SOLV_ATTR)
Set search in one Repository.
void setStatusFilterFlags(StatusFilter flags)
Set status filter directly.
std::string trim(const std::string &s, const Trim trim_r)
const StrContainer & repos() const
void addRepo(const std::string &repoalias)
Filter by repo.
static string wildcards2regex(const string &str)
Converts '*' and '?' wildcards within str into their regex equivalents.
void setModeRegex()
Set the mode REGEX.
std::string asUserHistory() const
A single (multiline) string composed of asUserString and historyAsString.
void setMatchWord()
Set to match words (uses regex)
const_iterator begin() const
Query result accessers.
void stayInThisSolvable()
Stop after all matches in the current Solvable are processed.
std::ostream & dumpOn(std::ostream &str, const PoolQuery &obj)
void setStrMatcher(const StrMatcher &matcher_r)
Set the pattern to match.
MyInserter(PoolQuery::StrContainer &cont)
base_iterator startNewQyery() const
Initialize a new base query.
sat::LookupAttr::iterator base_iterator
void nextSkipSolvable()
On the next call to operator++ advance to the next Solvable.
const Rel editionRel() const
StringTypeAttr(const std::string &str_r)
bool strToFalse(const C_Str &str)
Return false if str is 0, false, no, off.
Kinds _kinds
Kinds to search.
for_use_in_switch inSwitch() const
Enumarator provided for use in switch statement.
void setInstalledOnly()
Return only repo packages.
static const StringTypeAttr exactAttr
bool recover(std::istream &str, char delim='\n')
Reads from stream query.
const base_iterator & end() const
void matchDetail(const base_iterator &base_r, std::vector< base_iterator > &return_r) const
Provide all matching attributes within this solvable.
bool advance(base_iterator &base_r) const
const_iterator end() const
An iterator pointing to the end of the query result.
static const PoolQueryAttr stringTypeAttr
static const StringTypeAttr wordAttr
std::ostream & operator<<(std::ostream &str, const zypp::shared_ptr< void > &obj)
const Edition edition() const
bool operator!=(const SetRelation::Enum &lhs, const SetCompare &rhs)
void setMatchSubstring()
Set to substring (the default).
represents all atributes in PoolQuery except SolvAtributes, which are used as is (not needed extend a...
#define arrayBegin(A)
Simple C-array iterator.
bool strToTrue(const C_Str &str)
Parsing boolean from string.
std::set< Repository > _repos
Repositories include in the search.
static const PoolQueryAttr stringAttr
bool deserialize(const std::string &str_r, DownloadMode &result_r)
std::map< sat::SolvAttr, StrContainer > AttrRawStrMap
std::set< AttrMatchData > _uncompiledPredicated
Uncompiled attributes with predicate.
Repository reposFind(const std::string &alias_r) const
Find a Repository named alias_r.
void setModeString()
Set the mode STRING.
static const Match NOCASE
If set, match case insensitive.
Base class for Exception.
Solvable inSolvable() const
The current Solvable.
static const PoolQueryAttr complexAttr
bool isModeGlob() const
Whether this has mode GLOB.
void setEdition(const Edition &edition, const Rel &op=Rel::EQ)
Set version condition.
void setMatchExact()
Set to match exact string instead of substring.
StatusFilter statusFilterFlags() const
void nextSkipRepo()
On the next call to operator++ advance to the next Repository.
bool matchSubstring() const
StrContainer _repos
Repos to search.
bool operator()(const string &str)
bool empty() const
Whether the result is empty.
DefaultIntegral< bool, false > _neverMatchRepo
static const PoolQueryAttr requireAllAttr
Match flags() const
Free function to get libsolv repo search flags.
static const PoolQueryAttr editionAttr
bool isModeRegex() const
Whether this has mode REGEX.
void setFilesMatchFullPath(bool value=true)
If set (default), look at the full path when searching in filelists.
std::string asString() const
Conversion to std::string
bool test(const Match &rhs) const
Test whether all of the rhs bits are set (same mode if rhs has one).
RW_pointer< Impl > _pimpl
Pointer to implementation.
AttrMatchList _attrMatchList
StrMatcher per attribtue.
StatusFilter _status_flags
Sat solver status flags.
Impl * clone() const
clone for RWCOW_pointer
PoolQueryAttr(const char *cstr_r)
bool isAMatch(base_iterator &base_r) const
Check whether we are on a match.
int invokeOnEach(TIterator begin_r, TIterator end_r, TFilter filter_r, TFunction fnc_r)
Iterate through [begin_r,end_r) and invoke fnc_r on each item that passes filter_r.
bool operator<(const StrMatcher &lhs, const StrMatcher &rhs)
std::string asString() const
Return a human-readable description of the query.
Easy-to use interface to the ZYPP dependency resolver.
static const PoolQueryAttr kindAttr
function< bool(const sat::Solvable &)> ProcessResolvable
Repository inRepo() const
The current Repository.
static const Match FILES
LookupAttr: match full path when matching in filelists, otherwise just the basenames.
bool requireAll() const
Whether all values added via addString() or addAttribute() are required to match the values of the re...
StrContainer _strings
Raw search strings.
bool isModeString() const
Whether this has mode STRING.
void appendEscaped(std::string &str_r, const C_Str &next_r, const char sep_r=' ')
Escape next_r and append it to str_r using separator sep_r.
bool empty() const
Whether the query is empty.
static const StringTypeAttr globAttr
iterator begin() const
Iterator to the begin of query results.
AttrRawStrMap _attrs
Raw attributes.
static const Edition noedition
Value representing noedition ("") This is in fact a valid Edition.
bool operator==(const PoolQuery::Impl &rhs) const
static const StringTypeAttr regexAttr
void setRequireAll(bool require_all=true)
Require that all of the values set by addString or addAttribute match the values of respective attrib...
bool isModeSubstring() const
Whether this has mode SUBSTRING.