141 ::dataiterator_prepend_keyname(
dip.get(),
_parent.
id() );
160 {
return new Impl( *
this ); }
198 {
return _pimpl->attr(); }
204 {
return _pimpl->strMatcher(); }
212 {
return _pimpl->pool(); }
218 {
return _pimpl->repo(); }
224 {
return _pimpl->solvable(); }
230 {
return _pimpl->parent(); }
238 {
return _pimpl->begin(); }
259 return str <<
"search nothing";
262 str <<
"search " <<
obj.attr() <<
" in ";
264 str <<
"search ALL in ";
266 if (
obj.solvable() )
267 return str <<
obj.solvable();
270 return str <<
"pool";
319 , _mstring( rhs._mstring )
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; } }
385 switch ( solvAttrType() )
397 switch ( solvAttrType() )
412 switch ( solvAttrType() )
425 switch ( solvAttrType() )
461 {
return( subBegin() == subEnd() ); }
466 for_(
it, subBegin(), subEnd() )
473 SubType subtype(
subType( _dip ) );
478 ::dataiterator_clonepos(
dip.get(), _dip.get() );
503 while (
it != subEnd() &&
it.inSolvAttr() !=
attr_r )
514 SubType subtype(
subType( _dip ) );
528 std::string::size_type pos(
subattr.rfind(
':' ) );
529 if ( pos != std::string::npos )
548 switch ( solvAttrType() )
566 switch ( solvAttrType() )
585 switch ( solvAttrType() )
590 if ( _dip->data && _dip->data->localpool )
591 return ::stringpool_id2str( &_dip->data->spool, _dip->kv.id );
604 : ::repodata_dir2str( _dip->data, _dip->kv.id, _dip->kv.str ) );
615 switch ( solvAttrType() )
621 detail::IdType id = ::repodata_globalize_id( _dip->data, _dip->kv.id, 1 );
630 const char *
ret( c_str() );
644 return asCheckSum().asString();
650 std::ostringstream
str;
652 for_(
it, subBegin(), subEnd() )
654 str <<
" " <<
it.inSolvAttr() <<
" = " <<
it.asString() << endl;
662 return std::string();
669 switch ( solvAttrType() )
674 return IdString( ::repodata_globalize_id( _dip->data, _dip->kv.id, 1 ) );
685 switch ( solvAttrType() )
688 return CheckSum::md5( ::repodata_chk2str( _dip->data, solvAttrType(), (
unsigned char *)_dip->kv.str ) );
692 return CheckSum::sha1( ::repodata_chk2str( _dip->data, solvAttrType(), (
unsigned char *)_dip->kv.str ) );
696 return CheckSum::sha224( ::repodata_chk2str( _dip->data, solvAttrType(), (
unsigned char *)_dip->kv.str ) );
700 return CheckSum::sha256( ::repodata_chk2str( _dip->data, solvAttrType(), (
unsigned char *)_dip->kv.str ) );
704 return CheckSum::sha384( ::repodata_chk2str( _dip->data, solvAttrType(), (
unsigned char *)_dip->kv.str ) );
708 return CheckSum::sha512( ::repodata_chk2str( _dip->data, solvAttrType(), (
unsigned char *)_dip->kv.str ) );
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() ) )
777 ::dataiterator_strdup( _dip.get() );
786 return str <<
"EndOfQuery";
788 if (
obj.inSolvable() )
790 else if (
obj.inRepo() )
793 str <<
'<' <<
obj.inSolvAttr() << (
obj.solvAttrSubEntry() ?
">(*" :
">(")
798 template<>
CheckSum LookupAttr::iterator::asType<CheckSum>()
const
799 {
return asCheckSum(); }
810 str <<
"detail::CDataiterator(";
821 str <<
"|" << obj->repodataid;
822 str <<
"|" << obj->repoid;
Reference counted access to a Tp object calling a custom Dispose function when the last AutoDispose h...
void reset()
Reset to default Ctor values.
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
int get() const
Return the integer representation.
static const Repository noRepository
Represents no Repository.
IdType id() const
Expert backdoor.
String matching (STRING|SUBSTRING|GLOB|REGEX).
const std::string & searchstring() const
The current searchstring.
const Match & flags() const
The current search flags.
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)
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)
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.
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.
Lightweight attribute value lookup.
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)
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 ("")
SolvAttr parent() const
Return the parent of well know sub-structure attributes (SolvAttr::noAttr if none).
static const SolvAttr allAttr
Value to request searching all Attributes (0).
A Solvable object within the sat Pool.
IdType id() const
Expert backdoor.
static const Solvable noSolvable
Represents no Solvable.
Repository repository() const
The Repository this Solvable belongs to.
Wrapper around sat detail::CDataiterator.
void swap(DIWrap &rhs) noexcept
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)
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.