78 _attr = std::move(attr_r);
125 {
_parent = std::move(attr_r); }
135 whichRepo =
_solv.repository().id();
137 whichRepo =
_repo.id();
141 ::dataiterator_prepend_keyname( dip.
get(),
_parent.id() );
160 {
return new Impl( *
this ); }
178 {
_pimpl->setParent( std::move(parent_r) ); }
185 {
_pimpl->setParent( std::move(parent_r) ); }
192 {
_pimpl->setParent( std::move(parent_r) ); }
198 {
return _pimpl->attr(); }
201 {
_pimpl->setAttr( std::move(attr_r) ); }
204 {
return _pimpl->strMatcher(); }
207 {
_pimpl->setStrMatcher( matcher_r ); }
212 {
return _pimpl->pool(); }
215 {
_pimpl->setPool( loc_r ); }
218 {
return _pimpl->repo(); }
221 {
_pimpl->setRepo( repo_r, loc_r ); }
224 {
return _pimpl->solvable(); }
227 {
_pimpl->setSolvable( solv_r ); }
230 {
return _pimpl->parent(); }
233 {
_pimpl->setParent( std::move(attr_r) ); }
238 {
return _pimpl->begin(); }
259 return str <<
"search nothing";
262 str <<
"search " << obj.
attr() <<
" in ";
264 str <<
"search ALL in ";
270 return str <<
"pool";
300 std::string mstring_r,
int flags_r )
301 :
_dip( new ::Dataiterator )
309 const char * mstring_r,
int flags_r )
310 :
_dip( new ::Dataiterator )
311 ,
_mstring( mstring_r ? mstring_r :
"" )
323 _dip = new ::Dataiterator;
324 ::dataiterator_init_clone( _dip, rhs._dip );
325 ::dataiterator_strdup( _dip );
333 ::dataiterator_free(
_dip );
339 {
return str << obj.
get(); }
362 {
if (
_dip ) ::dataiterator_skip_attribute(
_dip.get() ); }
365 {
if (
_dip ) ::dataiterator_skip_solvable(
_dip.get() ); }
368 {
if (
_dip ) ::dataiterator_skip_repo(
_dip.get() ); }
371 {
if (
_dip ) {
_dip.get()->repoid = -1;
_dip.get()->flags |= SEARCH_THISSOLVID; } }
374 {
if (
_dip ) {
_dip.get()->repoid = -1; } }
387 case REPOKEY_TYPE_NUM:
388 case REPOKEY_TYPE_CONSTANT:
399 case REPOKEY_TYPE_ID:
400 case REPOKEY_TYPE_IDARRAY:
401 case REPOKEY_TYPE_CONSTANTID:
402 case REPOKEY_TYPE_STR:
403 case REPOKEY_TYPE_DIRSTRARRAY:
414 case REPOKEY_TYPE_ID:
415 case REPOKEY_TYPE_IDARRAY:
416 case REPOKEY_TYPE_CONSTANTID:
427 case REPOKEY_TYPE_MD5:
428 case REPOKEY_TYPE_SHA1:
429 case REPOKEY_TYPE_SHA256:
439 enum SubType { ST_NONE,
446 if ( dip.
get()->key->type == REPOKEY_TYPE_FLEXARRAY )
448 return dip.
get()->kv.parent ? ST_SUB : ST_NONE;
454 {
return subType(
_dip ) != ST_NONE; }
473 SubType subtype( subType(
_dip ) );
474 if ( subtype == ST_NONE )
478 ::dataiterator_clonepos( dip.
get(),
_dip.get() );
484 ::dataiterator_seek( dip.
get(), DI_SEEK_CHILD|DI_SEEK_STAY );
487 ::dataiterator_seek( dip.
get(), DI_SEEK_REWIND|DI_SEEK_STAY );
511 if ( attrname_r.
empty() )
514 SubType subtype( subType(
_dip ) );
515 if ( subtype == ST_NONE )
519 if ( subtype == ST_FLEX )
523 subattr += attrname_r;
528 std::string::size_type pos( subattr.rfind(
':' ) );
529 if ( pos != std::string::npos )
531 subattr.erase( pos+1 );
532 subattr += attrname_r;
535 subattr = attrname_r;
550 case REPOKEY_TYPE_NUM:
551 case REPOKEY_TYPE_CONSTANT:
568 case REPOKEY_TYPE_NUM:
569 case REPOKEY_TYPE_CONSTANT:
570 return SOLV_KV_NUM64(&
_dip->kv);
587 case REPOKEY_TYPE_ID:
588 case REPOKEY_TYPE_IDARRAY:
589 case REPOKEY_TYPE_CONSTANTID:
590 if (
_dip->data &&
_dip->data->localpool )
591 return ::stringpool_id2str( &
_dip->data->spool,
_dip->kv.id );
596 case REPOKEY_TYPE_STR:
600 case REPOKEY_TYPE_DIRSTRARRAY:
602 return(
_dip->flags & SEARCH_FILES
604 : ::repodata_dir2str(
_dip->data,
_dip->kv.id,
_dip->kv.str ) );
617 case REPOKEY_TYPE_ID:
618 case REPOKEY_TYPE_IDARRAY:
619 case REPOKEY_TYPE_CONSTANTID:
627 case REPOKEY_TYPE_STR:
628 case REPOKEY_TYPE_DIRSTRARRAY:
630 const char * ret(
c_str() );
631 return ret ? ret :
"";
635 case REPOKEY_TYPE_NUM:
636 case REPOKEY_TYPE_CONSTANT:
640 case REPOKEY_TYPE_MD5:
641 case REPOKEY_TYPE_SHA1:
642 case REPOKEY_TYPE_SHA256:
648 case REPOKEY_TYPE_FLEXARRAY:
650 std::ostringstream
str;
654 str <<
" " << it.inSolvAttr() <<
" = " << it.asString() << endl;
662 return std::string();
671 case REPOKEY_TYPE_ID:
672 case REPOKEY_TYPE_IDARRAY:
673 case REPOKEY_TYPE_CONSTANTID:
687 case REPOKEY_TYPE_MD5:
691 case REPOKEY_TYPE_SHA1:
695 case REPOKEY_TYPE_SHA224:
699 case REPOKEY_TYPE_SHA256:
703 case REPOKEY_TYPE_SHA384:
707 case REPOKEY_TYPE_SHA512:
720 : iterator_adaptor_( 0 )
724 : iterator_adaptor_( 0 )
727 base_reference() =
_dip.get();
731 : iterator_adaptor_( 0 )
734 base_reference() =
_dip.get();
746 base_reference() =
_dip.get();
757 return( lhs.solvid == rhs.solvid && lhs.key->name == rhs.key->name );
762 return _dip ? ::repodata_globalize_id(
_dip->data,
_dip->kv.id, 1 )
770 if ( ! ::dataiterator_step(
_dip.get() ) )
773 base_reference() = 0;
777 ::dataiterator_strdup(
_dip.get() );
786 return str <<
"EndOfQuery";
810 str <<
"detail::CDataiterator(";
821 str <<
"|" << obj->repodataid;
822 str <<
"|" << obj->repoid;
Convenience char* constructible from std::string and char*, it maps (char*)0 to an empty string.
std::string asString() const
This is an overloaded member function, provided for convenience. It differs from the above function o...
static CheckSum md5(const std::string &checksum)
static CheckSum sha384(const std::string &checksum)
static CheckSum sha1(const std::string &checksum)
static CheckSum sha512(const std::string &checksum)
static CheckSum sha256(const std::string &checksum)
static CheckSum sha224(const std::string &checksum)
Access to the sat-pools string space.
const char * c_str() const
Conversion to const char *
std::string asString() const
Conversion to std::string
static const Repository noRepository
Represents no Repository.
String matching (STRING|SUBSTRING|GLOB|REGEX).
void compile() const
Compile the pattern e.g.
LookupAttr implememtation.
void setSolvable(Solvable solv_r)
void setStrMatcher(const StrMatcher &matcher_r)
void setParent(SolvAttr attr_r)
Solvable solvable() const
LookupAttr::iterator end() const
const StrMatcher & strMatcher() const
void setPool(Location loc_r)
Impl * clone() const
clone for RWCOW_pointer
Impl(const SolvAttr &attr_r, Location loc_r)
friend Impl * rwcowClone(const Impl *rhs)
LookupAttr::iterator begin() const
Impl(const SolvAttr &attr_r, Repository repo_r, Location loc_r)
Impl(const SolvAttr &attr_r, Solvable solv_r)
void setRepo(Repository repo_r, Location loc_r)
void setAttr(SolvAttr attr_r)
detail::CDataiterator * get() const
Expert backdoor.
iterator subBegin() const
Iterator to the begin of a sub-structure.
unsigned long long asUnsignedLL() const
This is an overloaded member function, provided for convenience. It differs from the above function o...
unsigned asUnsigned() const
This is an overloaded member function, provided for convenience. It differs from the above function o...
void stayInThisSolvable()
Stop after all matches in the current Solvable are processed.
Tp asType() const
Templated return type.
IdString idStr() const
As IdStr.
detail::IdType dereference() const
void nextSkipSolvable()
On the next call to operator++ advance to the next Solvable.
SolvAttr inSolvAttr() const
The current SolvAttr.
bool subEmpty() const
Whether the sub-structure is empty.
CheckSum asCheckSum() const
As CheckSum.
bool solvAttrCheckSum() const
Whether this is a CheckSum attribute.
std::string asString() const
This is an overloaded member function, provided for convenience. It differs from the above function o...
void nextSkipSolvAttr()
On the next call to operator++ advance to the next SolvAttr.
bool asBool() const
This is an overloaded member function, provided for convenience. It differs from the above function o...
iterator subEnd() const
Iterator behind the end of a sub-structure.
void stayInThisRepo()
Stop after all matches in the current Repository are processed.
bool solvAttrSubEntry() const
Whether this is the entry to a sub-structure (flexarray).
iterator subFind(const SolvAttr &attr_r) const
Iterator pointing to the first occurance of SolvAttr attr_r in sub-structure.
Solvable inSolvable() const
The current Solvable.
void nextSkipRepo()
On the next call to operator++ advance to the next Repository.
const char * c_str() const
Conversion to string types.
size_type subSize() const
Ammount of attributes in the sub-structure.
iterator & operator=(const iterator &rhs)
bool solvAttrNumeric() const
Whether this is a numeric attribute (incl.
bool solvAttrIdString() const
Whether this string attribute is available as IdString.
bool dip_equal(const detail::CDataiterator &lhs, const detail::CDataiterator &rhs) const
bool solvAttrString() const
Whether this is a string attribute.
detail::IdType solvAttrType() const
The current SolvAttr type.
int asInt() const
Conversion to numeric types.
Repository inRepo() const
The current Repository.
iterator end() const
Iterator behind the end of query results.
RWCOW_pointer< Impl > _pimpl
const StrMatcher & strMatcher() const
The pattern to match.
bool empty() const
Whether the query is empty.
Location
Specify the where to look for the attribule.
@ REPO_ATTR
Search for repository attributes.
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.
std::ostream & operator<<(std::ostream &str, const LookupAttr &obj) ZYPP_API
Stream output.
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.
static Pool instance()
Singleton ctor.
static const SolvAttr noAttr
Value representing noAttr ("")
static const SolvAttr allAttr
Value to request searching all Attributes (0).
A Solvable object within the sat Pool.
static const Solvable noSolvable
Represents no Solvable.
Wrapper around sat detail::CDataiterator.
detail::CDataiterator * get() const
DIWrap()
NULL detail::CDataiterator
detail::CDataiterator * _dip
String related utilities and Regular expression matching.
unsigned int SolvableIdType
Id type to connect Solvable and sat-solvable.
static const IdType noId(0)
static const SolvableIdType noSolvableId(0)
Id to denote Solvable::noSolvable.
int IdType
Generic Id type.
static const RepoIdType noRepoId(0)
Id to denote Repo::noRepository.
::s_Dataiterator CDataiterator
Wrapped libsolv C data type exposed as backdoor.
std::ostream & operator<<(std::ostream &str, const DIWrap &obj)
CRepo * RepoIdType
Id type to connect Repo and sat-repo.
std::ostream & operator<<(std::ostream &str, const FileConflicts &obj)
static const SolvableIdType noSolvableId(0)
Id to denote Solvable::noSolvable.
std::ostream & dumpOn(std::ostream &str, const LocaleSupport &obj)
std::string numstring(char n, int w=0)
Easy-to use interface to the ZYPP dependency resolver.
std::ostream & dumpRange(std::ostream &str, TIterator begin, TIterator end, const std::string &intro="{", const std::string &pfx="\n ", const std::string &sep="\n ", const std::string &sfx="\n", const std::string &extro="}")
Print range defined by iterators (multiline style).
std::ostream & operator<<(std::ostream &str, const SerialNumber &obj)
std::string asString(const Patch::Category &obj)
#define for_(IT, BEG, END)
Convenient for-loops using iterator.