libzypp 17.38.8
lookupattr.cc
Go to the documentation of this file.
1/*---------------------------------------------------------------------\
2| ____ _ __ __ ___ |
3| |__ / \ / / . \ . \ |
4| / / \ V /| _/ _/ |
5| / /__ | | | | | | |
6| /_____||_| |_| |_| |
7| |
8\---------------------------------------------------------------------*/
12#include <iostream>
13#include <sstream>
14#include <utility>
15
18
19#include <zypp/ng/sat/pool.h>
24
25#include <zypp-core/CheckSum.h>
26
27using std::endl;
28
29namespace zyppng::sat
30{
32
47 {
48 public:
50 : _pool( nullptr )
51 , _parent( SolvAttr::noAttr )
52 {}
53 Impl( detail::CPool * pool_r, const SolvAttr& attr_r, Location loc_r )
54 : _pool( pool_r ), _attr( attr_r ), _parent( attr_r.parent() ), _solv( loc_r == REPO_ATTR ? SOLVID_META : noSolvableId )
55 {}
56 Impl( detail::CPool * pool_r, const SolvAttr& attr_r, Repository repo_r, Location loc_r )
57 : _pool( pool_r ), _attr( attr_r ), _parent( attr_r.parent() ), _repo( repo_r ), _solv( loc_r == REPO_ATTR ? SOLVID_META : noSolvableId )
58 {}
59 Impl( detail::CPool * pool_r, const SolvAttr& attr_r, Solvable solv_r )
60 : _pool( pool_r ), _attr( attr_r ), _parent( attr_r.parent() ), _solv( solv_r )
61 {}
62
63 public:
64 SolvAttr attr() const
65 { return _attr; }
66
67 void setAttr( SolvAttr attr_r )
68 {
69 _attr = std::move(attr_r);
70 SolvAttr p( _attr.parent() );
71 if ( p != SolvAttr::noAttr )
72 _parent = p;
73 }
74
75 const StrMatcher & strMatcher() const
76 { return _strMatcher; }
77
78 void setStrMatcher( const StrMatcher & matcher_r )
79 {
80 matcher_r.compile();
81 _strMatcher = matcher_r;
82 }
83
84 public:
85 bool pool() const
86 { return ! (_repo || _solv); }
87
88 void setPool( Location loc_r )
89 {
91 _solv = Solvable( loc_r == REPO_ATTR ? SOLVID_META : noSolvableId );
92 }
93
95 { return _repo; }
96
97 void setRepo( Repository repo_r, Location loc_r )
98 {
99 _repo = repo_r;
100 _solv = Solvable( loc_r == REPO_ATTR ? SOLVID_META : noSolvableId );
101 // Extract pool from repo
102 if ( _repo )
103 _pool = _repo.pool().get();
104 }
105
107 { return _solv; }
108
109 void setSolvable( Solvable solv_r )
110 {
112 _solv = solv_r;
113 // Extract pool from solvable
114 if ( _solv )
115 _pool = _solv.pool().get();
116 }
117
119 { return _parent; }
120
121 void setParent( SolvAttr attr_r )
122 { _parent = std::move(attr_r); }
123
124 public:
126 {
127 if ( _attr == SolvAttr::noAttr || ! _pool || ! _pool->nrepos )
128 return end();
129
130 detail::RepoIdType whichRepo = detail::noRepoId; // all repos
131 if ( _solv )
132 whichRepo = _solv.repository();
133 else if ( _repo )
134 whichRepo = _repo.id();
135
136 detail::DIWrap dip( _pool, whichRepo, _solv.id(), _attr.id(), _strMatcher.searchstring(), _strMatcher.flags().get() );
137 if ( _parent != SolvAttr::noAttr )
138 ::dataiterator_prepend_keyname( dip.get(), _parent.id() );
139
140 return iterator( dip ); // iterator takes over ownership!
141 }
142
144 { return iterator(); }
145
146 private:
153
154 private:
155 friend Impl * zypp::rwcowClone<Impl>( const Impl * rhs );
157 Impl * clone() const
158 { return new Impl( *this ); }
159 };
160
164
166 : _pimpl( new Impl )
167 {}
168
170 : _pimpl( new Impl( pool.get(), std::move(attr_r), std::move(loc_r) ) )
171 {}
172
174 : _pimpl( new Impl( pool.get(), std::move(attr_r), std::move(loc_r) ) )
175 { _pimpl->setParent( std::move(parent_r) ); }
176
178 {
179 detail::CPool * cp = repo_r.pool().get();
180 _pimpl.reset( new Impl( cp, std::move(attr_r), std::move(repo_r), std::move(loc_r) ) );
181 }
182
183 LookupAttr::LookupAttr( SolvAttr attr_r, SolvAttr parent_r, Repository repo_r, Location loc_r )
184 {
185 detail::CPool * cp = repo_r.pool().get();
186 _pimpl.reset( new Impl( cp, std::move(attr_r), std::move(repo_r), std::move(loc_r) ) );
187 _pimpl->setParent( std::move(parent_r) );
188 }
189
191 {
192 detail::CPool * cp = solv_r.pool().get();
193 _pimpl.reset( new Impl( cp, std::move(attr_r), std::move(solv_r) ) );
194 }
195
197 {
198 detail::CPool * cp = solv_r.pool().get();
199 _pimpl.reset( new Impl( cp, std::move(attr_r), std::move(solv_r) ) );
200 _pimpl->setParent( std::move(parent_r) );
201 }
202
203
205 { return _pimpl->attr(); }
206
208 { _pimpl->setAttr( std::move(attr_r) ); }
209
211 { return _pimpl->strMatcher(); }
212
213 void LookupAttr::setStrMatcher( const StrMatcher & matcher_r )
214 { _pimpl->setStrMatcher( matcher_r ); }
215
216 bool LookupAttr::pool() const
217 { return _pimpl->pool(); }
218
220 { _pimpl->setPool( loc_r ); }
221
223 { return _pimpl->repo(); }
226 { _pimpl->setRepo( repo_r, loc_r ); }
229 { return _pimpl->solvable(); }
230
232 { _pimpl->setSolvable( solv_r ); }
233
235 { return _pimpl->parent(); }
236
238 { _pimpl->setParent( std::move(attr_r) ); }
239
241 { return _pimpl->begin(); }
242
244 { return _pimpl->end(); }
245
246 bool LookupAttr::empty() const
247 { return begin() == end(); }
248
250 {
251 size_type c = 0;
252 for ( auto it = begin(); it != end(); ++it )
253 ++c;
254 return c;
255 }
256
260
262 : LookupAttr( std::move(attr_r), repo_r, REPO_ATTR )
263 {}
264
267
271
272 namespace detail
273 {
275 std::string mstring_r, int flags_r )
276 : _dip( new ::Dataiterator )
277 , _pool( pool )
278 , _mstring(std::move( mstring_r ))
279 {
280 ::dataiterator_init( _dip, _pool, repoId_r, solvId_r, attrId_r,
281 _mstring.empty() ? 0 : _mstring.c_str(), flags_r );
282 }
283
285 const char * mstring_r, int flags_r )
286 : _dip( new ::Dataiterator )
287 , _pool( pool )
288 , _mstring( mstring_r ? mstring_r : "" )
289 {
290 ::dataiterator_init( _dip, _pool, repoId_r, solvId_r, attrId_r,
291 _mstring.empty() ? 0 : _mstring.c_str(), flags_r );
292 }
293
294 DIWrap::DIWrap( const DIWrap & rhs )
295 : _dip( 0 )
296 , _pool( rhs._pool )
297 , _mstring( rhs._mstring )
298 {
299 if ( rhs._dip )
300 {
301 _dip = new ::Dataiterator;
302 ::dataiterator_init_clone( _dip, rhs._dip );
303 ::dataiterator_strdup( _dip );
304 }
305 }
306
308 {
309 if ( _dip )
310 {
311 ::dataiterator_free( _dip );
312 delete _dip;
313 }
314 }
315 }
316
320
323
326
328 { return _dip ? SolvAttr( _dip->key->name ) : SolvAttr::noAttr; }
329
331 { if ( _dip ) ::dataiterator_skip_attribute( _dip.get() ); }
332
334 { if ( _dip ) ::dataiterator_skip_solvable( _dip.get() ); }
335
337 { if ( _dip ) ::dataiterator_skip_repo( _dip.get() ); }
338
340 { if ( _dip ) { _dip.get()->repoid = -1; _dip.get()->flags |= SEARCH_THISSOLVID; } }
341
343 { if ( _dip ) { _dip.get()->repoid = -1; } }
344
346 { return _dip ? _dip->key->type : detail::noId; }
347
349 {
350 switch ( solvAttrType() )
351 {
352 case REPOKEY_TYPE_NUM:
353 case REPOKEY_TYPE_CONSTANT:
354 return true;
355 break;
356 }
357 return false;
358 }
359
361 {
362 switch ( solvAttrType() )
363 {
364 case REPOKEY_TYPE_ID:
365 case REPOKEY_TYPE_IDARRAY:
366 case REPOKEY_TYPE_CONSTANTID:
367 case REPOKEY_TYPE_STR:
368 case REPOKEY_TYPE_DIRSTRARRAY:
369 return true;
370 break;
371 }
372 return false;
373 }
374
376 {
377 switch ( solvAttrType() )
378 {
379 case REPOKEY_TYPE_ID:
380 case REPOKEY_TYPE_IDARRAY:
381 case REPOKEY_TYPE_CONSTANTID:
382 return true;
383 break;
384 }
385 return false;
386 }
387
389 {
390 switch ( solvAttrType() )
391 {
392 case REPOKEY_TYPE_MD5:
393 case REPOKEY_TYPE_SHA1:
394 case REPOKEY_TYPE_SHA256:
395 return true;
396 break;
397 }
398 return false;
399 }
400
401 namespace
402 {
403 enum SubType { ST_NONE, // no sub-structure
404 ST_FLEX, // flexarray
405 ST_SUB }; // inside sub-structure
406 SubType subType( const detail::DIWrap & dip )
407 {
408 if ( ! dip )
409 return ST_NONE;
410 if ( dip.get()->key->type == REPOKEY_TYPE_FLEXARRAY )
411 return ST_FLEX;
412 return dip.get()->kv.parent ? ST_SUB : ST_NONE;
413 }
415 SubType subType( const detail::CDataiterator * dip )
416 {
417 if ( ! dip )
418 return ST_NONE;
419 if ( dip->key->type == REPOKEY_TYPE_FLEXARRAY )
420 return ST_FLEX;
421 return dip->kv.parent ? ST_SUB : ST_NONE;
422 }
423 }
424
426 { return subType( _dip ) != ST_NONE; }
427
429 { return subBegin() == subEnd(); }
430
432 {
433 size_type c = 0;
434 for ( auto it = subBegin(); it != subEnd(); ++it )
435 ++c;
436 return c;
437 }
438
440 {
441 SubType subtype( subType( _dip ) );
442 if ( subtype == ST_NONE )
443 return subEnd();
444 // Clone the current position into a new DIWrap using the pool stored on us.
445 detail::DIWrap dip( _pool, 0, 0, 0 );
446 ::dataiterator_clonepos( dip.get(), _dip );
447 switch ( subtype )
448 {
449 case ST_NONE: // not reached
450 break;
451 case ST_FLEX:
452 ::dataiterator_seek( dip.get(), DI_SEEK_CHILD|DI_SEEK_STAY );
453 break;
454 case ST_SUB:
455 ::dataiterator_seek( dip.get(), DI_SEEK_REWIND|DI_SEEK_STAY );
456 break;
457 }
458 return LookupAttr::iterator( dip ); // iterator takes over ownership!
459 }
460
465
467 {
469 if ( attr_r != SolvAttr::allAttr )
470 {
471 while ( it != subEnd() && (*it).inSolvAttr() != attr_r )
472 ++it;
473 }
474 return it;
475 }
476
478 {
479 if ( attrname_r.empty() )
480 return subBegin();
481
482 SubType subtype( subType( _dip ) );
483 if ( subtype == ST_NONE )
484 return subBegin();
485
486 std::string subattr( inSolvAttr().asString() );
487 if ( subtype == ST_FLEX )
488 {
489 // append ":attrname"
490 subattr += ":";
491 subattr += attrname_r;
492 }
493 else
494 {
495 // replace "oldname" after ':' with "attrname"
496 std::string::size_type pos( subattr.rfind( ':' ) );
497 if ( pos != std::string::npos )
498 {
499 subattr.erase( pos+1 );
500 subattr += attrname_r;
501 }
502 else
503 subattr = attrname_r; // no ':' so replace all.
504 }
505 return subFind( SolvAttr( subattr ) );
506 }
507
509 {
510 if ( _dip )
511 {
512 switch ( solvAttrType() )
513 {
514 case REPOKEY_TYPE_NUM:
515 case REPOKEY_TYPE_CONSTANT:
516 return _dip->kv.num;
517 break;
518 }
519 }
520 return 0;
521 }
522
524 { return asInt(); }
525
526 unsigned long long LookupAttrValue::asUnsignedLL() const
527 {
528 if ( _dip )
529 {
530 switch ( solvAttrType() )
531 {
532 case REPOKEY_TYPE_NUM:
533 case REPOKEY_TYPE_CONSTANT:
534 return SOLV_KV_NUM64(&_dip->kv);
535 break;
536 }
537 }
538 return 0;
539 }
540
542 { return asInt(); }
543
544
545 const char * LookupAttrValue::c_str() const
546 {
547 if ( _dip )
548 {
549 switch ( solvAttrType() )
550 {
551 case REPOKEY_TYPE_ID:
552 case REPOKEY_TYPE_IDARRAY:
553 case REPOKEY_TYPE_CONSTANTID:
554 if ( _dip->data && _dip->data->localpool )
555 return ::stringpool_id2str( &_dip->data->spool, _dip->kv.id ); // in local pool
556 else
557 return IdString( _dip->kv.id ).c_str(); // in global pool
558 break;
559
560 case REPOKEY_TYPE_STR:
561 return _dip->kv.str;
562 break;
563
564 case REPOKEY_TYPE_DIRSTRARRAY:
565 // may or may not be stringified depending on SEARCH_FILES flag
566 return( _dip->flags & SEARCH_FILES
567 ? _dip->kv.str
568 : ::repodata_dir2str( _dip->data, _dip->kv.id, _dip->kv.str ) );
569 break;
570 }
571 }
572 return 0;
573 }
574
575 std::string LookupAttrValue::asString() const
576 {
577 if ( _dip )
578 {
579 switch ( solvAttrType() )
580 {
581 case REPOKEY_TYPE_ID:
582 case REPOKEY_TYPE_IDARRAY:
583 case REPOKEY_TYPE_CONSTANTID:
584 {
585 detail::IdType id = ::repodata_globalize_id( _dip->data, _dip->kv.id, 1 );
586 return ISRELDEP(id) ? Capability( id ).asString()
587 : IdString( id ).asString();
588 }
589 break;
590
591 case REPOKEY_TYPE_STR:
592 case REPOKEY_TYPE_DIRSTRARRAY:
593 {
594 const char * ret( c_str() );
595 return ret ? ret : "";
596 }
597 break;
598
599 case REPOKEY_TYPE_NUM:
600 case REPOKEY_TYPE_CONSTANT:
601 return zypp::str::numstring( asInt() );
602 break;
603
604 case REPOKEY_TYPE_MD5:
605 case REPOKEY_TYPE_SHA1:
606 case REPOKEY_TYPE_SHA256:
607 {
608 return asCheckSum().asString();
609 }
610 break;
611
612 case REPOKEY_TYPE_FLEXARRAY:
613 {
614 std::ostringstream str;
615 str << "{" << endl;
616 for ( auto it = subBegin(); it != subEnd(); ++it )
617 {
618 str << " " << (*it).inSolvAttr() << " = " << (*it).asString() << endl;
619 }
620 str << "}";
621 return str.str();
622 }
623 break;
624 }
625 }
626 return std::string();
627 }
628
630 {
631 if ( _dip )
632 {
633 switch ( solvAttrType() )
634 {
635 case REPOKEY_TYPE_ID:
636 case REPOKEY_TYPE_IDARRAY:
637 case REPOKEY_TYPE_CONSTANTID:
638 return IdString( ::repodata_globalize_id( _dip->data, _dip->kv.id, 1 ) );
639 break;
640 }
641 }
642 return IdString();
643 }
644
646 {
647 if ( _dip )
648 {
649 switch ( solvAttrType() )
650 {
651 case REPOKEY_TYPE_MD5:
652 return CheckSum::md5( ::repodata_chk2str( _dip->data, solvAttrType(), (unsigned char *)_dip->kv.str ) );
653 break;
654
655 case REPOKEY_TYPE_SHA1:
656 return CheckSum::sha1( ::repodata_chk2str( _dip->data, solvAttrType(), (unsigned char *)_dip->kv.str ) );
657 break;
658
659 case REPOKEY_TYPE_SHA224:
660 return CheckSum::sha224( ::repodata_chk2str( _dip->data, solvAttrType(), (unsigned char *)_dip->kv.str ) );
661 break;
662
663 case REPOKEY_TYPE_SHA256:
664 return CheckSum::sha256( ::repodata_chk2str( _dip->data, solvAttrType(), (unsigned char *)_dip->kv.str ) );
665 break;
666
667 case REPOKEY_TYPE_SHA384:
668 return CheckSum::sha384( ::repodata_chk2str( _dip->data, solvAttrType(), (unsigned char *)_dip->kv.str ) );
669 break;
670
671 case REPOKEY_TYPE_SHA512:
672 return CheckSum::sha512( ::repodata_chk2str( _dip->data, solvAttrType(), (unsigned char *)_dip->kv.str ) );
673 break;
674 }
675 }
676 return CheckSum();
677 }
678
681
683 : _dip( rhs._dip )
684 {}
685
687 {
688 _dip.swap( dip_r ); // take ownership!
689 increment();
690 }
691
694
696 {
697 if ( &rhs != this )
698 {
699 _dip = rhs._dip;
700 }
701 return *this;
702 }
703
705 {
706 // Iterator equal is same position in same container.
707 // Here: same attribute in same solvable.
708 return( lhs.solvid == rhs.solvid && lhs.key->name == rhs.key->name );
709 }
710
712 {
713 return LookupAttrValue( _dip.get(), _dip.pool() );
714 }
715
717 {
718 increment();
719 return *this;
720 }
721
723 {
724 iterator tmp = *this;
725 increment();
726 return tmp;
727 }
728
730 {
731 return ( bool(_dip) == bool(rhs._dip) )
732 && ( ! _dip || dip_equal( *_dip.get(), *rhs._dip.get() ) );
733 }
734
736 {
737 if ( _dip )
738 {
739 if ( ! ::dataiterator_step( _dip.get() ) )
740 {
741 _dip.reset();
742 }
743 else
744 {
745 ::dataiterator_strdup( _dip.get() );
746 }
747 }
748 }
749
751 { return asCheckSum(); }
752
753} // namespace zyppng::sat
Convenience char* constructible from std::string and char*, it maps (char*)0 to an empty string.
Definition String.h:92
bool empty() const
Definition String.h:108
Access to the sat-pools string space.
Definition IdString.h:55
const char * c_str() const
Conversion to const char *.
Definition IdString.cc:51
std::string asString() const
Conversion to std::string.
Definition IdString.h:110
String matching (STRING|SUBSTRING|GLOB|REGEX).
Definition StrMatcher.h:298
void compile() const
Compile the pattern e.g.
void nextSkipSolvAttr()
On the next call to operator++ advance to the next SolvAttr.
iterator end() const
Iterator behind the end of query results.
const StrMatcher & strMatcher() const
The pattern to match.
bool empty() const
Whether the query is empty.
void setStrMatcher(const StrMatcher &matcher_r)
Set the pattern to match.
Repository repo() const
Whether to search in one Repository.
SolvAttr attr() const
The SolvAttr to search.
SolvAttr parent() const
Whether to search within a sub-structure (SolvAttr::noAttr if not).
void setAttr(SolvAttr attr_r)
Set the SolvAttr to search.
void setRepo(Repository repo_r, Location=SOLV_ATTR)
Set search in one Repository.
bool pool() const
Whether to search in Pool.
size_type size() const
Ammount of results.
iterator begin() const
Iterator to the begin of query results.
void setSolvable(Solvable solv_r)
Set search in one Solvable.
Solvable solvable() const
Whether to search in one Solvable.
LookupAttr()
Default ctor finds nothing.
void setPool(Location=SOLV_ATTR)
Set search in Pool (all repositories).
void setParent(SolvAttr attr_r)
Set search within a sub-structure (SolvAttr::noAttr for none).
void setRepo(Repository repo_r)
Set search in one Repository.
LookupRepoAttr()
Default ctor finds nothing.
Definition LookupAttr.h:268
Solvable attribute keys.
Definition SolvAttr.h:41
A sat capability.
Definition capability.h:74
std::string asString() const
This is an overloaded member function, provided for convenience. It differs from the above function o...
Definition capability.h:203
static CheckSum md5(const std::string &checksum)
Definition CheckSum.h:73
static CheckSum sha384(const std::string &checksum)
Definition CheckSum.h:78
static CheckSum sha1(const std::string &checksum)
Definition CheckSum.h:75
static CheckSum sha512(const std::string &checksum)
Definition CheckSum.h:79
static CheckSum sha256(const std::string &checksum)
Definition CheckSum.h:77
static CheckSum sha224(const std::string &checksum)
Definition CheckSum.h:76
Value proxy returned by LookupAttr::iterator::operator*().
Definition lookupattr.h:454
std::string asString() const
This is an overloaded member function, provided for convenience. It differs from the above function o...
SolvAttr inSolvAttr() const
The current SolvAttr.
LookupAttr::iterator subEnd() const
Iterator behind the end of a sub-structure.
LookupAttr::iterator subFind(const SolvAttr &attr_r) const
Iterator pointing to the first occurrence of SolvAttr attr_r in the sub-structure.
bool subEmpty() const
Whether the sub-structure is empty.
unsigned asUnsigned() const
This is an overloaded member function, provided for convenience. It differs from the above function o...
bool solvAttrString() const
Whether this is a string attribute.
bool solvAttrNumeric() const
Whether this is a numeric attribute (incl.
int asInt() const
Conversion to numeric types.
LookupAttr::size_type size_type
Definition lookupattr.h:456
detail::IdType solvAttrType() const
The current SolvAttr type.
detail::CDataiterator * _dip
non-owning — current iterator position
Definition lookupattr.h:591
IdString idStr() const
As IdString.
Tp asType() const
Templated return type.
Definition lookupattr.h:587
LookupAttr::iterator subBegin() const
Iterator to the begin of a sub-structure.
bool solvAttrIdString() const
Whether this string attribute is available as IdString.
bool solvAttrCheckSum() const
Whether this is a CheckSum attribute.
bool solvAttrSubEntry() const
Whether this is the entry to a sub-structure (flexarray).
Solvable inSolvable() const
The current Solvable.
bool asBool() const
This is an overloaded member function, provided for convenience. It differs from the above function o...
unsigned long long asUnsignedLL() const
This is an overloaded member function, provided for convenience. It differs from the above function o...
detail::CPool * _pool
non-owning — needed for sub-structure DIWrap construction
Definition lookupattr.h:592
CheckSum asCheckSum() const
As CheckSum.
Repository inRepo() const
The current Repository.
const char * c_str() const
Conversion to string types.
size_type subSize() const
Amount of attributes in the sub-structure.
LookupAttr implementation.
Definition lookupattr.cc:47
Impl(detail::CPool *pool_r, const SolvAttr &attr_r, Location loc_r)
Definition lookupattr.cc:53
void setSolvable(Solvable solv_r)
LookupAttr::iterator begin() const
Repository repo() const
Definition lookupattr.cc:94
const StrMatcher & strMatcher() const
Definition lookupattr.cc:75
void setStrMatcher(const StrMatcher &matcher_r)
Definition lookupattr.cc:78
Impl(detail::CPool *pool_r, const SolvAttr &attr_r, Solvable solv_r)
Definition lookupattr.cc:59
Impl(detail::CPool *pool_r, const SolvAttr &attr_r, Repository repo_r, Location loc_r)
Definition lookupattr.cc:56
void setAttr(SolvAttr attr_r)
Definition lookupattr.cc:67
LookupAttr::iterator end() const
void setRepo(Repository repo_r, Location loc_r)
Definition lookupattr.cc:97
void setPool(Location loc_r)
Definition lookupattr.cc:88
Impl * clone() const
clone for RWCOW_pointer
void setParent(SolvAttr attr_r)
void nextSkipRepo()
On the next call to operator++ advance to the next Repository.
bool operator==(const iterator &rhs) const
bool dip_equal(const detail::CDataiterator &lhs, const detail::CDataiterator &rhs) const
iterator & operator=(const iterator &rhs)
void stayInThisRepo()
Stop after all matches in the current Repository are processed.
void stayInThisSolvable()
Stop after all matches in the current Solvable are processed.
void nextSkipSolvable()
On the next call to operator++ advance to the next Solvable.
iterator end() const
Iterator behind the end of query results.
bool pool() const
Whether to search in Pool.
iterator begin() const
Iterator to the begin of query results.
Location
Specify the where to look for the attribule.
Definition lookupattr.h:122
@ REPO_ATTR
Search for repository attributes.
Definition lookupattr.h:124
LookupAttr()
Default ctor finds nothing.
void setRepo(Repository repo_r, Location=SOLV_ATTR)
Set search in one Repository.
zypp::RWCOW_pointer< Impl > _pimpl
Definition lookupattr.h:238
Orchestrator for a libsolv pool instance.
Definition pool.h:37
detail::CPool * get() const
Expert backdoor.
Definition pool.h:59
static const Repository noRepository
Represents no Repository.
Definition repository.h:79
static const SolvAttr noAttr
Value representing noAttr ("").
Definition SolvAttr.h:48
static const SolvAttr allAttr
Value to request searching all Attributes (0).
Definition SolvAttr.h:46
A Solvable object within the sat Pool.
Definition solvable.h:66
static const Solvable noSolvable
Represents no Solvable.
Definition solvable.h:95
Wrapper around sat detail::CDataiterator.
Definition lookupattr.h:294
detail::CDataiterator * get() const
Definition lookupattr.h:334
detail::CPool * pool() const
Definition lookupattr.h:335
DIWrap()
NULL detail::CDataiterator
Definition lookupattr.h:297
detail::CDataiterator * _dip
Definition lookupattr.h:339
Definition ansi.h:855
String related utilities and Regular expression matching.
std::string numstring(char n, int w=0)
Definition String.h:290
D * rwcowClone(const D *rhs)
relates: RWCOW_pointer Clone the underlying object.
Definition PtrTypes.h:453
std::string asString(const Patch::Category &obj)
relates: Patch::Category string representation.
Definition Patch.cc:122
CLASS NAME : detail::DIWrap.
Definition cap2str.cc:14
zypp::sat::detail::CDataiterator CDataiterator
zypp::sat::detail::RepoIdType RepoIdType
zypp::sat::detail::CPool CPool
zypp::sat::detail::SolvableIdType SolvableIdType
static const IdType noId(0)
static const SolvableIdType noSolvableId(0)
Id to denote Solvable::noSolvable.
static const RepoIdType noRepoId(0)
Id to denote Repo::noRepository.
zypp::sat::detail::IdType IdType
This file contains private API, this might break at any time between releases.
zypp::IdString IdString
Definition idstring.h:16