1 /*---------------------------------------------------------------------\
3 | |__ / \ / / . \ . \ |
8 \---------------------------------------------------------------------*/
9 /** \file zypp/target/rpm/RpmHeader.h
12 #ifndef ZYPP_TARGET_RPM_RPMHEADER_H
13 #define ZYPP_TARGET_RPM_RPMHEADER_H
18 #include "zypp/target/rpm/BinHeader.h"
20 #include "zypp/Package.h"
21 #include "zypp/Changelog.h"
22 #include "zypp/CapSetFwd.h"
23 #include "zypp/Pathname.h"
30 ///////////////////////////////////////////////////////////////////
32 // CLASS NAME : RpmHeader
34 * @short Wrapper class for rpm header struct.
36 * <code>RpmHeader</code> provides methods to query the content
37 * of a rpm header struct retrieved from the RPM database or by reading
38 * the rpm header of a package on disk.
40 * The rpm header contains all data associated with a package. So you
41 * probabely do not want to permanently store too many of them.
43 * <B>NEVER create <code>RpmHeader</code> from a NULL <code>Header</code>! </B>
45 class RpmHeader : public BinHeader {
47 typedef intrusive_ptr<RpmHeader> Ptr;
48 typedef intrusive_ptr<const RpmHeader> constPtr;
52 CapSet PkgRelList_val( tag tag_r, bool pre, std::set<std::string> * freq_r = 0 ) const;
59 RpmHeader( Header h_r = 0 );
62 * <B>Dangerous!<\B> This one takes the header out of rhs
63 * and leaves rhs empty.
65 RpmHeader( BinHeader::Ptr & rhs );
73 std::string tag_name() const;
74 Edition tag_edition() const;
75 Arch tag_arch() const;
77 Date tag_installtime() const;
78 Date tag_buildtime() const;
81 * If <code>freq_r</code> is not NULL, file dependencies found are inserted.
83 CapSet tag_provides ( std::set<std::string> * freq_r = 0 ) const;
87 CapSet tag_requires ( std::set<std::string> * freq_r = 0 ) const;
91 CapSet tag_prerequires ( std::set<std::string> * freq_r = 0 ) const;
95 CapSet tag_conflicts( std::set<std::string> * freq_r = 0 ) const;
99 CapSet tag_obsoletes( std::set<std::string> * freq_r = 0 ) const;
101 ByteCount tag_size() const;
102 ByteCount tag_archivesize() const;
104 std::string tag_summary() const;
105 std::string tag_description() const;
106 std::string tag_group() const;
107 std::string tag_vendor() const;
108 std::string tag_distribution() const;
109 std::string tag_license() const;
110 std::string tag_buildhost() const;
111 std::string tag_packager() const;
112 std::string tag_url() const;
113 std::string tag_os() const;
114 std::string tag_prein() const;
115 std::string tag_postin() const;
116 std::string tag_preun() const;
117 std::string tag_postun() const;
118 std::string tag_sourcerpm() const;
120 std::list<std::string> tag_filenames() const;
122 Changelog tag_changelog() const;
125 * Returns reference to arg <code>dudata_r</code>.
127 Package::DiskUsage & tag_du( Package::DiskUsage & dudata_r ) const;
131 virtual std::ostream & dumpOn( std::ostream & str ) const;
136 * Digest and signature verification flags
141 NOSIGNATURE = (1<<1),
146 * Get an accessible packages data from disk.
147 * Returns NULL on any error.
149 static RpmHeader::constPtr readPackage( const Pathname & path,
150 VERIFICATION verification = VERIFY );
153 ///////////////////////////////////////////////////////////////////
155 } // namespace target
158 #endif // ZYPP_TARGET_RPM_RPMHEADER_H