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"
33 ///////////////////////////////////////////////////////////////////
35 // CLASS NAME : RpmHeader
37 * @short Wrapper class for rpm header struct.
39 * <code>RpmHeader</code> provides methods to query the content
40 * of a rpm header struct retrieved from the RPM database or by reading
41 * the rpm header of a package on disk.
43 * The rpm header contains all data associated with a package. So you
44 * probabely do not want to permanently store too many of them.
46 * <B>NEVER create <code>RpmHeader</code> from a NULL <code>Header</code>! </B>
48 class RpmHeader : public BinHeader {
50 typedef intrusive_ptr<RpmHeader> Ptr;
51 typedef intrusive_ptr<const RpmHeader> constPtr;
55 CapSet PkgRelList_val( tag tag_r, bool pre, std::set<std::string> * freq_r = 0 ) const;
62 RpmHeader( Header h_r = 0 );
65 * <B>Dangerous!<\B> This one takes the header out of rhs
66 * and leaves rhs empty.
68 RpmHeader( BinHeader::Ptr & rhs );
76 std::string tag_name() const;
77 Edition tag_edition() const;
78 Arch tag_arch() const;
80 Date tag_installtime() const;
81 Date tag_buildtime() const;
84 * If <code>freq_r</code> is not NULL, file dependencies found are inserted.
86 CapSet tag_provides ( std::set<std::string> * freq_r = 0 ) const;
90 CapSet tag_requires ( std::set<std::string> * freq_r = 0 ) const;
94 CapSet tag_prerequires ( std::set<std::string> * freq_r = 0 ) const;
98 CapSet tag_conflicts( std::set<std::string> * freq_r = 0 ) const;
102 CapSet tag_obsoletes( std::set<std::string> * freq_r = 0 ) const;
104 ByteCount tag_size() const;
105 ByteCount tag_archivesize() const;
107 std::string tag_summary() const;
108 std::string tag_description() const;
109 std::string tag_group() const;
110 std::string tag_vendor() const;
111 std::string tag_distribution() const;
112 std::string tag_license() const;
113 std::string tag_buildhost() const;
114 std::string tag_packager() const;
115 std::string tag_url() const;
116 std::string tag_os() const;
117 std::string tag_prein() const;
118 std::string tag_postin() const;
119 std::string tag_preun() const;
120 std::string tag_postun() const;
121 std::string tag_sourcerpm() const;
123 std::list<std::string> tag_filenames() const;
125 Changelog tag_changelog() const;
127 #warning FIXME disk usage data
130 * Returns reference to arg <code>dudata_r</code>.
132 PkgDu & tag_du( PkgDu & dudata_r ) const;
137 virtual std::ostream & dumpOn( std::ostream & str ) const;
142 * Digest and signature verification flags
147 NOSIGNATURE = (1<<1),
152 * Get an accessible packages data from disk.
153 * Returns NULL on any error.
155 static RpmHeader::constPtr readPackage( const Pathname & path,
156 VERIFICATION verification = VERIFY );
159 ///////////////////////////////////////////////////////////////////
161 } // namespace target
164 #endif // ZYPP_TARGET_RPM_RPMHEADER_H