libzypp: zyppng::sat::LookupAttrValue Class Reference

libzypp 17.38.9

zyppng::sat::LookupAttrValue Class Reference

Value proxy returned by LookupAttr::iterator::operator*(). More...

`#include <zypp/ng/sat/lookupattr.h>`

## Public Types
using | size_type = LookupAttr::size_type

## Public Member Functions
| LookupAttrValue (detail::CDataiterator *dip, detail::CPool *pool)
template<>
CheckSum | asType () const
Current position info.
Repository | inRepo () const
| The current Repository.
Solvable | inSolvable () const
| The current Solvable.
SolvAttr | inSolvAttr () const
| The current SolvAttr.
Test attribute value type.
detail::IdType | solvAttrType () const
| The current SolvAttr type.
bool | solvAttrNumeric () const
| Whether this is a numeric attribute (incl.
bool | solvAttrString () const
| Whether this is a string attribute.
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).
Iterate sub-structures.
These are usable iff solvAttrSubEntry is `true`. Note Unfortunately the underlying libsolv dataiterator as returned by subBegin and subFind loses some context when being created. Thus, it's not possible to invoke subBegin and subFind on an iterator that was previously returned by one of those methods. The result will be an `end` iterator. For the same reason, it is not possible for an iterator to leave the sub-structure again.
bool | subEmpty () const
| Whether the sub-structure is empty.
size_type | subSize () const
| Amount of attributes in the sub-structure.
LookupAttr::iterator | subBegin () const
| Iterator to the begin of a sub-structure.
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.
LookupAttr::iterator | subFind (const zypp::C_Str &attrname_r) const
Helpers and forward declarations from LookupAttrTools.h
template<>
int | asType () const
template<>
unsigned | asType () const
template<>
unsigned long long | asType () const
template<>
bool | asType () const
template<>
const char * | asType () const
template<>
IdString | asType () const
template<>
CheckSum | asType () const

## Retrieving attribute values.
detail::CDataiterator * | _dip
| non-owning — current iterator position
detail::CPool * | _pool
| non-owning — needed for sub-structure DIWrap construction
int | asInt () const
| Conversion to numeric types.
unsigned | asUnsigned () const
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
bool | asBool () const
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
unsigned long long | asUnsignedLL () const
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
const char * | c_str () const
| Conversion to string types.
std::string | asString () const
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. If used with non-string types, this method tries to create some appropriate string representation.
IdString | idStr () const
| As IdString.
detail::IdType | id () const
CheckSum | asCheckSum () const
| As CheckSum.
template<class Tp>
Tp | asType () const
| Templated return type.

## Detailed Description

Value proxy returned by LookupAttr::iterator::operator*().

Carries a non-owning pointer to the iterator's current `detail::CDataiterator` position plus the owning `detail::CPool*`. Valid only as long as the originating iterator has not been incremented or destroyed — the same lifetime rules as `std::string_view`.

All position info, type tests, value accessors and sub-structure iteration that formerly lived on LookupAttr::iterator are exposed here, so that `zyppng::ranges:`: algorithms receive a meaningful value type instead of a raw `detail::IdType` integer.

Definition at line 453 of file lookupattr.h.

## Member Typedef Documentation

## ◆ size_type

using zyppng::sat::LookupAttrValue::size_type = LookupAttr::size_type

Definition at line 456 of file lookupattr.h.

## Constructor & Destructor Documentation

## ◆ LookupAttrValue()

zyppng::sat::LookupAttrValue::LookupAttrValue | ( | detail::CDataiterator * | dip,
|  | detail::CPool * | pool )
| inline

Definition at line 459 of file lookupattr.h.

## Member Function Documentation

## ◆ inRepo()

Repository zyppng::sat::LookupAttrValue::inRepo | ( |  | ) | const

The current Repository.

CLASS NAME : LookupAttr::iterator.

Definition at line 321 of file lookupattr.cc.

## ◆ inSolvable()

Solvable zyppng::sat::LookupAttrValue::inSolvable | ( |  | ) | const

The current Solvable.

Definition at line 324 of file lookupattr.cc.

## ◆ inSolvAttr()

SolvAttr zyppng::sat::LookupAttrValue::inSolvAttr | ( |  | ) | const

The current SolvAttr.

Definition at line 327 of file lookupattr.cc.

## ◆ solvAttrType()

detail::IdType zyppng::sat::LookupAttrValue::solvAttrType | ( |  | ) | const

The current SolvAttr type.

Definition at line 345 of file lookupattr.cc.

## ◆ solvAttrNumeric()

bool zyppng::sat::LookupAttrValue::solvAttrNumeric | ( |  | ) | const

Whether this is a numeric attribute (incl.

boolean).

Definition at line 348 of file lookupattr.cc.

## ◆ solvAttrString()

bool zyppng::sat::LookupAttrValue::solvAttrString | ( |  | ) | const

Whether this is a string attribute.

Definition at line 360 of file lookupattr.cc.

## ◆ solvAttrIdString()

bool zyppng::sat::LookupAttrValue::solvAttrIdString | ( |  | ) | const

Whether this string attribute is available as IdString.

Definition at line 375 of file lookupattr.cc.

## ◆ solvAttrCheckSum()

bool zyppng::sat::LookupAttrValue::solvAttrCheckSum | ( |  | ) | const

Whether this is a CheckSum attribute.

Definition at line 388 of file lookupattr.cc.

## ◆ solvAttrSubEntry()

bool zyppng::sat::LookupAttrValue::solvAttrSubEntry | ( |  | ) | const

Whether this is the entry to a sub-structure (flexarray).

This is the entry to a sequence of attributes. To access them use subBegin and subEnd.

Definition at line 425 of file lookupattr.cc.

## ◆ subEmpty()

bool zyppng::sat::LookupAttrValue::subEmpty | ( |  | ) | const

Whether the sub-structure is empty.

Definition at line 428 of file lookupattr.cc.

## ◆ subSize()

LookupAttr::size_type zyppng::sat::LookupAttrValue::subSize | ( |  | ) | const

Amount of attributes in the sub-structure.

Note
  This is not a cheap call. It runs the query.

Definition at line 431 of file lookupattr.cc.

## ◆ subBegin()

LookupAttr::iterator zyppng::sat::LookupAttrValue::subBegin | ( |  | ) | const

Iterator to the begin of a sub-structure.

See also
  solvAttrSubEntry

Definition at line 439 of file lookupattr.cc.

## ◆ subEnd()

LookupAttr::iterator zyppng::sat::LookupAttrValue::subEnd | ( |  | ) | const

Iterator behind the end of a sub-structure.

See also
  solvAttrSubEntry

Definition at line 461 of file lookupattr.cc.

## ◆ subFind() [1/2]

LookupAttr::iterator zyppng::sat::LookupAttrValue::subFind | ( | const SolvAttr & | attr_r | ) | const

Iterator pointing to the first occurrence of SolvAttr attr_r in the sub-structure.

If sat::SolvAttr::allAttr is passed, subBegin is returned.

See also
  solvAttrSubEntry

Definition at line 466 of file lookupattr.cc.

## ◆ subFind() [2/2]

LookupAttr::iterator zyppng::sat::LookupAttrValue::subFind | ( | const zypp::C_Str & | attrname_r | ) | const

Definition at line 477 of file lookupattr.cc.

## ◆ asInt()

int zyppng::sat::LookupAttrValue::asInt | ( |  | ) | const

Conversion to numeric types.

Definition at line 508 of file lookupattr.cc.

## ◆ asUnsigned()

unsigned zyppng::sat::LookupAttrValue::asUnsigned | ( |  | ) | const

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Definition at line 523 of file lookupattr.cc.

## ◆ asBool()

bool zyppng::sat::LookupAttrValue::asBool | ( |  | ) | const

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Definition at line 541 of file lookupattr.cc.

## ◆ asUnsignedLL()

unsigned long long zyppng::sat::LookupAttrValue::asUnsignedLL | ( |  | ) | const

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Definition at line 526 of file lookupattr.cc.

## ◆ c_str()

const char * zyppng::sat::LookupAttrValue::c_str | ( |  | ) | const

Conversion to string types.

Definition at line 545 of file lookupattr.cc.

## ◆ asString()

std::string zyppng::sat::LookupAttrValue::asString | ( |  | ) | const

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. If used with non-string types, this method tries to create some appropriate string representation.

Definition at line 575 of file lookupattr.cc.

## ◆ idStr()

IdString zyppng::sat::LookupAttrValue::idStr | ( |  | ) | const

As IdString.

This is only done for poolized string types. Large strings like summary or descriptions are not available via IdString, only via c_str and asString.

Definition at line 629 of file lookupattr.cc.

## ◆ id()

detail::IdType zyppng::sat::LookupAttrValue::id | ( |  | ) | const
| inline

Definition at line 575 of file lookupattr.h.

## ◆ asCheckSum()

CheckSum zyppng::sat::LookupAttrValue::asCheckSum | ( |  | ) | const

As CheckSum.

Definition at line 645 of file lookupattr.cc.

## ◆ asType() [1/9]

template<class Tp>

Tp zyppng::sat::LookupAttrValue::asType | ( |  | ) | const
| inline

Templated return type.

Per default assumes an Id based type, so try to construct it from the Id.

Should be specialized for supported types above.

Definition at line 587 of file lookupattr.h.

## ◆ asType() [2/9]

template<>

CheckSum zyppng::sat::LookupAttrValue::asType | ( |  | ) | const

Definition at line 750 of file lookupattr.cc.

## ◆ asType() [3/9]

template<>

int zyppng::sat::LookupAttrValue::asType | ( |  | ) | const
| inline

Definition at line 596 of file lookupattr.h.

## ◆ asType() [4/9]

template<>

unsigned zyppng::sat::LookupAttrValue::asType | ( |  | ) | const
| inline

Definition at line 597 of file lookupattr.h.

## ◆ asType() [5/9]

template<>

unsigned long long zyppng::sat::LookupAttrValue::asType | ( |  | ) | const
| inline

Definition at line 598 of file lookupattr.h.

## ◆ asType() [6/9]

template<>

bool zyppng::sat::LookupAttrValue::asType | ( |  | ) | const
| inline

Definition at line 599 of file lookupattr.h.

## ◆ asType() [7/9]

template<>

const char * zyppng::sat::LookupAttrValue::asType | ( |  | ) | const
| inline

Definition at line 600 of file lookupattr.h.

## ◆ asType() [8/9]

template<>

IdString zyppng::sat::LookupAttrValue::asType | ( |  | ) | const
| inline

Definition at line 602 of file lookupattr.h.

## ◆ asType() [9/9]

template<>

CheckSum zyppng::sat::LookupAttrValue::asType | ( |  | ) | const

## Member Data Documentation

## ◆ _dip

detail::CDataiterator* zyppng::sat::LookupAttrValue::_dip
| private

non-owning — current iterator position

Definition at line 591 of file lookupattr.h.

## ◆ _pool

detail::CPool* zyppng::sat::LookupAttrValue::_pool
| private

non-owning — needed for sub-structure DIWrap construction

Definition at line 592 of file lookupattr.h.

The documentation for this class was generated from the following files:

- zypp/ng/sat/lookupattr.h
- zypp/ng/sat/lookupattr.cc