libzypp 17.37.10

zypp::target::rpm::RpmHeader Class Reference

Wrapper class for rpm header struct. More...

`#include <zypp/target/rpm/RpmHeader.h>`

Inheritance diagram for zypp::target::rpm::RpmHeader:

## Public Types
enum | VERIFICATION { VERIFY = 0x0000 , NODIGEST = (1<<0) , NOSIGNATURE = (1<<1) , NOVERIFY = 0xffff }
| Digest and signature verification flags. More...
using | Ptr = intrusive_ptr<RpmHeader>
using | constPtr = intrusive_ptr<const RpmHeader>
Public Types inherited from zypp::target::rpm::BinHeader
using | Ptr = intrusive_ptr<BinHeader>
using | constPtr = intrusive_ptr<const BinHeader>
using | tag = rpmTag

## Public Member Functions
| RpmHeader (Header h_r=0)
| RpmHeader (BinHeader::Ptr &rhs)
| Dangerous!<\B> This one takes the header out of rhs and leaves rhs empty.
| ~RpmHeader () override
bool | isSrc () const
| Either 'src' or 'nosrc'.
bool | isNosrc () const
| Only 'nosrc'.
std::string | ident () const
| N-V-R.A or empty.
std::string | tag_name () const
Edition::epoch_t | tag_epoch () const
std::string | tag_version () const
std::string | tag_release () const
Edition | tag_edition () const
Arch | tag_arch () const
Date | tag_installtime () const
Date | tag_buildtime () const
CapabilitySet | tag_provides (std::set< std::string > *freq_r=0) const
| If `freq_r` is not NULL, file dependencies found are inserted.
CapabilitySet | tag_requires (std::set< std::string > *freq_r=0) const
CapabilitySet | tag_prerequires (std::set< std::string > *freq_r=0) const
CapabilitySet | tag_conflicts (std::set< std::string > *freq_r=0) const
CapabilitySet | tag_obsoletes (std::set< std::string > *freq_r=0) const
CapabilitySet | tag_enhances (std::set< std::string > *freq_r=0) const
CapabilitySet | tag_suggests (std::set< std::string > *freq_r=0) const
CapabilitySet | tag_supplements (std::set< std::string > *freq_r=0) const
CapabilitySet | tag_recommends (std::set< std::string > *freq_r=0) const
ByteCount | tag_size () const
ByteCount | tag_archivesize () const
std::string | tag_summary () const
std::string | tag_description () const
std::string | tag_group () const
std::string | tag_vendor () const
std::string | tag_distribution () const
std::string | tag_license () const
std::string | tag_buildhost () const
std::string | tag_packager () const
std::string | tag_url () const
std::string | tag_os () const
std::string | tag_prein () const
std::string | tag_preinprog () const
std::string | tag_postin () const
std::string | tag_postinprog () const
std::string | tag_preun () const
std::string | tag_preunprog () const
std::string | tag_postun () const
std::string | tag_postunprog () const
std::string | tag_pretrans () const
std::string | tag_pretransprog () const
std::string | tag_posttrans () const
std::string | tag_posttransprog () const
std::string | tag_sourcerpm () const
std::string | signatureKeyID () const
| Uses headerFormat to query the signature info from the header.
std::list< std::string > | tag_filenames () const
| just the list of names
std::list< FileInfo > | tag_fileinfos () const
| complete information about the files (extended version of tag_filenames())
Changelog | tag_changelog () const
std::ostream & | dumpOn (std::ostream &str) const override
| Overload to realize std::ostream & operator<<.
Public Member Functions inherited from zypp::target::rpm::BinHeader
| BinHeader (Header h_r=0)
| BinHeader (BinHeader::Ptr &rhs)
| Dangerous!<\B> This one takes the header out of rhs and leaves rhs empty.
| ~BinHeader () override
bool | empty () const
bool | has_tag (tag tag_r) const
unsigned | int_list (tag tag_r, intList &lst_r) const
unsigned | string_list (tag tag_r, stringList &lst_r) const
int | int_val (tag tag_r) const
ByteArray | blob_val (tag tag_r) const
std::string | string_val (tag tag_r) const
std::string | format (const char *fmt) const
Header | get () const
std::list< std::string > | stringList_val (tag tag_r) const
Public Member Functions inherited from zypp::base::ReferenceCounted
| ReferenceCounted ()
| Default ctor.
| ReferenceCounted (const ReferenceCounted &rhs)
| Copy ctor.
virtual | ~ReferenceCounted ()
| Dtor.
ReferenceCounted & | operator= (const ReferenceCounted &)
| Assignment.
unsigned | refCount () const
| Return reference counter value.
void | ref () const
| Add a reference.
void | unref () const
| Release a reference.

## Static Public Member Functions
static RpmHeader::constPtr | readPackage (const Pathname &path, VERIFICATION verification=VERIFY)
| Get an accessible packages data from disk.
static std::pair< RpmHeader::Ptr, int > | readPackage (rpmts ts_r, const Pathname &path_r)
| Get an accessible packages data from disk using a existing transaction.
Static Public Member Functions inherited from zypp::base::ReferenceCounted
static void | add_ref (const ReferenceCounted *ptr_r)
| Called by zypp::intrusive_ptr to add a reference.
static void | release (const ReferenceCounted *ptr_r)
| Called by zypp::intrusive_ptr to add a reference.

## Private Member Functions
CapabilitySet | PkgRelList_val (tag tag_r, bool pre, std::set< std::string > *freq_r=0) const

## Additional Inherited Members
Protected Member Functions inherited from zypp::base::ReferenceCounted
virtual void | ref_to (unsigned) const
| Trigger derived classes after refCount was increased.
virtual void | unref_to (unsigned) const
| Trigger derived classes after refCount was decreased.
Related Symbols inherited from zypp::base::ReferenceCounted
void | intrusive_ptr_add_ref (const ReferenceCounted *ptr_r)
| intrusive_ptr hook to add_ref.
void | intrusive_ptr_release (const ReferenceCounted *ptr_r)
| intrusive_ptr hook to release.
std::ostream & | operator<< (std::ostream &str, const ReferenceCounted &obj)
| Stream output.

## Detailed Description

Wrapper class for rpm header struct.

`RpmHeader` provides methods to query the content of a rpm header struct retrieved from the RPM database or by reading the rpm header of a package on disk.

The rpm header contains all data associated with a package. So you probabely do not want to permanently store too many of them.

NEVER create `RpmHeader` from a NULL `Header`!

Definition at line 61 of file RpmHeader.h.

## Member Typedef Documentation

## ◆ Ptr

using zypp::target::rpm::RpmHeader::Ptr = intrusive_ptr<RpmHeader>

Definition at line 64 of file RpmHeader.h.

## ◆ constPtr

using zypp::target::rpm::RpmHeader::constPtr = intrusive_ptr<const RpmHeader>

Definition at line 65 of file RpmHeader.h.

## Member Enumeration Documentation

## ◆ VERIFICATION

enum zypp::target::rpm::RpmHeader::VERIFICATION

Digest and signature verification flags.

Enumerator
VERIFY |
NODIGEST |
NOSIGNATURE |
NOVERIFY |

Definition at line 193 of file RpmHeader.h.

## Constructor & Destructor Documentation

## ◆ RpmHeader() [1/2]

zypp::target::rpm::RpmHeader::RpmHeader | ( | Header | h_r = 0 | ) |

Definition at line 181 of file RpmHeader.cc.

## ◆ RpmHeader() [2/2]

zypp::target::rpm::RpmHeader::RpmHeader | ( | BinHeader::Ptr & | rhs | ) |

Dangerous!<\B> This one takes the header out of rhs and leaves rhs empty.

Definition at line 191 of file RpmHeader.cc.

## ◆ ~RpmHeader()

zypp::target::rpm::RpmHeader::~RpmHeader | ( |  | ) |
| override

Definition at line 203 of file RpmHeader.cc.

## Member Function Documentation

## ◆ PkgRelList_val()

CapabilitySet zypp::target::rpm::RpmHeader::PkgRelList_val | ( | tag | tag_r,
|  | bool | pre,
|  | std::set< std::string > * | freq_r = 0 ) const
| private

Definition at line 420 of file RpmHeader.cc.

## ◆ isSrc()

bool zypp::target::rpm::RpmHeader::isSrc | ( |  | ) | const

Either 'src' or 'nosrc'.

Definition at line 289 of file RpmHeader.cc.

## ◆ isNosrc()

bool zypp::target::rpm::RpmHeader::isNosrc | ( |  | ) | const

Only 'nosrc'.

Definition at line 294 of file RpmHeader.cc.

## ◆ ident()

std::string zypp::target::rpm::RpmHeader::ident | ( |  | ) | const

N-V-R.A or empty.

Definition at line 299 of file RpmHeader.cc.

## ◆ tag_name()

std::string zypp::target::rpm::RpmHeader::tag_name | ( |  | ) | const

Definition at line 316 of file RpmHeader.cc.

## ◆ tag_epoch()

Edition::epoch_t zypp::target::rpm::RpmHeader::tag_epoch | ( |  | ) | const

Definition at line 329 of file RpmHeader.cc.

## ◆ tag_version()

std::string zypp::target::rpm::RpmHeader::tag_version | ( |  | ) | const

Definition at line 342 of file RpmHeader.cc.

## ◆ tag_release()

std::string zypp::target::rpm::RpmHeader::tag_release | ( |  | ) | const

Definition at line 355 of file RpmHeader.cc.

## ◆ tag_edition()

Edition zypp::target::rpm::RpmHeader::tag_edition | ( |  | ) | const

Definition at line 368 of file RpmHeader.cc.

## ◆ tag_arch()

Arch zypp::target::rpm::RpmHeader::tag_arch | ( |  | ) | const

Definition at line 381 of file RpmHeader.cc.

## ◆ tag_installtime()

Date zypp::target::rpm::RpmHeader::tag_installtime | ( |  | ) | const

Definition at line 394 of file RpmHeader.cc.

## ◆ tag_buildtime()

Date zypp::target::rpm::RpmHeader::tag_buildtime | ( |  | ) | const

Definition at line 407 of file RpmHeader.cc.

## ◆ tag_provides()

CapabilitySet zypp::target::rpm::RpmHeader::tag_provides | ( | std::set< std::string > * | freq_r = 0 | ) | const

If `freq_r` is not NULL, file dependencies found are inserted.

Definition at line 564 of file RpmHeader.cc.

## ◆ tag_requires()

CapabilitySet zypp::target::rpm::RpmHeader::tag_requires | ( | std::set< std::string > * | freq_r = 0 | ) | const

See also
  tag_provides

Definition at line 577 of file RpmHeader.cc.

## ◆ tag_prerequires()

CapabilitySet zypp::target::rpm::RpmHeader::tag_prerequires | ( | std::set< std::string > * | freq_r = 0 | ) | const

See also
  tag_provides

Definition at line 590 of file RpmHeader.cc.

## ◆ tag_conflicts()

CapabilitySet zypp::target::rpm::RpmHeader::tag_conflicts | ( | std::set< std::string > * | freq_r = 0 | ) | const

See also
  tag_provides

Definition at line 603 of file RpmHeader.cc.

## ◆ tag_obsoletes()

CapabilitySet zypp::target::rpm::RpmHeader::tag_obsoletes | ( | std::set< std::string > * | freq_r = 0 | ) | const

See also
  tag_provides

Definition at line 616 of file RpmHeader.cc.

## ◆ tag_enhances()

CapabilitySet zypp::target::rpm::RpmHeader::tag_enhances | ( | std::set< std::string > * | freq_r = 0 | ) | const

See also
  tag_provides

Definition at line 629 of file RpmHeader.cc.

## ◆ tag_suggests()

CapabilitySet zypp::target::rpm::RpmHeader::tag_suggests | ( | std::set< std::string > * | freq_r = 0 | ) | const

See also
  tag_provides

Definition at line 646 of file RpmHeader.cc.

## ◆ tag_supplements()

CapabilitySet zypp::target::rpm::RpmHeader::tag_supplements | ( | std::set< std::string > * | freq_r = 0 | ) | const

See also
  tag_provides

Definition at line 663 of file RpmHeader.cc.

## ◆ tag_recommends()

CapabilitySet zypp::target::rpm::RpmHeader::tag_recommends | ( | std::set< std::string > * | freq_r = 0 | ) | const

See also
  tag_provides

Definition at line 680 of file RpmHeader.cc.

## ◆ tag_size()

ByteCount zypp::target::rpm::RpmHeader::tag_size | ( |  | ) | const

Definition at line 697 of file RpmHeader.cc.

## ◆ tag_archivesize()

ByteCount zypp::target::rpm::RpmHeader::tag_archivesize | ( |  | ) | const

Definition at line 710 of file RpmHeader.cc.

## ◆ tag_summary()

std::string zypp::target::rpm::RpmHeader::tag_summary | ( |  | ) | const

Definition at line 723 of file RpmHeader.cc.

## ◆ tag_description()

std::string zypp::target::rpm::RpmHeader::tag_description | ( |  | ) | const

Definition at line 736 of file RpmHeader.cc.

## ◆ tag_group()

std::string zypp::target::rpm::RpmHeader::tag_group | ( |  | ) | const

Definition at line 749 of file RpmHeader.cc.

## ◆ tag_vendor()

std::string zypp::target::rpm::RpmHeader::tag_vendor | ( |  | ) | const

Definition at line 762 of file RpmHeader.cc.

## ◆ tag_distribution()

std::string zypp::target::rpm::RpmHeader::tag_distribution | ( |  | ) | const

Definition at line 775 of file RpmHeader.cc.

## ◆ tag_license()

std::string zypp::target::rpm::RpmHeader::tag_license | ( |  | ) | const

Definition at line 788 of file RpmHeader.cc.

## ◆ tag_buildhost()

std::string zypp::target::rpm::RpmHeader::tag_buildhost | ( |  | ) | const

Definition at line 801 of file RpmHeader.cc.

## ◆ tag_packager()

std::string zypp::target::rpm::RpmHeader::tag_packager | ( |  | ) | const

Definition at line 814 of file RpmHeader.cc.

## ◆ tag_url()

std::string zypp::target::rpm::RpmHeader::tag_url | ( |  | ) | const

Definition at line 827 of file RpmHeader.cc.

## ◆ tag_os()

std::string zypp::target::rpm::RpmHeader::tag_os | ( |  | ) | const

Definition at line 840 of file RpmHeader.cc.

## ◆ tag_prein()

std::string zypp::target::rpm::RpmHeader::tag_prein | ( |  | ) | const

Definition at line 846 of file RpmHeader.cc.

## ◆ tag_preinprog()

std::string zypp::target::rpm::RpmHeader::tag_preinprog | ( |  | ) | const

Definition at line 849 of file RpmHeader.cc.

## ◆ tag_postin()

std::string zypp::target::rpm::RpmHeader::tag_postin | ( |  | ) | const

Definition at line 852 of file RpmHeader.cc.

## ◆ tag_postinprog()

std::string zypp::target::rpm::RpmHeader::tag_postinprog | ( |  | ) | const

Definition at line 855 of file RpmHeader.cc.

## ◆ tag_preun()

std::string zypp::target::rpm::RpmHeader::tag_preun | ( |  | ) | const

Definition at line 858 of file RpmHeader.cc.

## ◆ tag_preunprog()

std::string zypp::target::rpm::RpmHeader::tag_preunprog | ( |  | ) | const

Definition at line 861 of file RpmHeader.cc.

## ◆ tag_postun()

std::string zypp::target::rpm::RpmHeader::tag_postun | ( |  | ) | const

Definition at line 864 of file RpmHeader.cc.

## ◆ tag_postunprog()

std::string zypp::target::rpm::RpmHeader::tag_postunprog | ( |  | ) | const

Definition at line 867 of file RpmHeader.cc.

## ◆ tag_pretrans()

std::string zypp::target::rpm::RpmHeader::tag_pretrans | ( |  | ) | const

Definition at line 870 of file RpmHeader.cc.

## ◆ tag_pretransprog()

std::string zypp::target::rpm::RpmHeader::tag_pretransprog | ( |  | ) | const

Definition at line 873 of file RpmHeader.cc.

## ◆ tag_posttrans()

std::string zypp::target::rpm::RpmHeader::tag_posttrans | ( |  | ) | const

Definition at line 876 of file RpmHeader.cc.

## ◆ tag_posttransprog()

std::string zypp::target::rpm::RpmHeader::tag_posttransprog | ( |  | ) | const

Definition at line 879 of file RpmHeader.cc.

## ◆ tag_sourcerpm()

std::string zypp::target::rpm::RpmHeader::tag_sourcerpm | ( |  | ) | const

Definition at line 890 of file RpmHeader.cc.

## ◆ signatureKeyID()

std::string zypp::target::rpm::RpmHeader::signatureKeyID | ( |  | ) | const

Uses headerFormat to query the signature info from the header.

Note
  Query copied from Yum misc/checksig.py

Definition at line 895 of file RpmHeader.cc.

## ◆ tag_filenames()

std::list< std::string > zypp::target::rpm::RpmHeader::tag_filenames | ( |  | ) | const

just the list of names

Definition at line 923 of file RpmHeader.cc.

## ◆ tag_fileinfos()

std::list< FileInfo > zypp::target::rpm::RpmHeader::tag_fileinfos | ( |  | ) | const

complete information about the files (extended version of tag_filenames())

Definition at line 951 of file RpmHeader.cc.

## ◆ tag_changelog()

Changelog zypp::target::rpm::RpmHeader::tag_changelog | ( |  | ) | const

Definition at line 1032 of file RpmHeader.cc.

## ◆ dumpOn()

std::ostream & zypp::target::rpm::RpmHeader::dumpOn | ( | std::ostream & | str | ) | const
| override virtual

Overload to realize std::ostream & operator<<.

Reimplemented from zypp::target::rpm::BinHeader.

Definition at line 271 of file RpmHeader.cc.

## ◆ readPackage() [1/2]

RpmHeader::constPtr zypp::target::rpm::RpmHeader::readPackage | ( | const Pathname & | path,
|  | VERIFICATION | verification = VERIFY )
| static

Get an accessible packages data from disk.

Returns NULL on any error.

Definition at line 212 of file RpmHeader.cc.

## ◆ readPackage() [2/2]

std::pair< RpmHeader::Ptr, int > zypp::target::rpm::RpmHeader::readPackage | ( | rpmts | ts_r,
|  | const Pathname & | path_r )
| static

Get an accessible packages data from disk using a existing transaction.

Returns a std::pair container the header and resultcode from reading it

Definition at line 228 of file RpmHeader.cc.

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

- zypp/target/rpm/RpmHeader.h
- zypp/target/rpm/RpmHeader.cc