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"
24 #include "zypp/DiskUsage.h"
31 ///////////////////////////////////////////////////////////////////
33 // CLASS NAME : RpmHeader
35 * @short Wrapper class for rpm header struct.
37 * <code>RpmHeader</code> provides methods to query the content
38 * of a rpm header struct retrieved from the RPM database or by reading
39 * the rpm header of a package on disk.
41 * The rpm header contains all data associated with a package. So you
42 * probabely do not want to permanently store too many of them.
44 * <B>NEVER create <code>RpmHeader</code> from a NULL <code>Header</code>! </B>
46 class RpmHeader : public BinHeader {
48 typedef intrusive_ptr<RpmHeader> Ptr;
49 typedef intrusive_ptr<const RpmHeader> constPtr;
53 CapSet PkgRelList_val( tag tag_r, bool pre, std::set<std::string> * freq_r = 0 ) const;
60 RpmHeader( Header h_r = 0 );
63 * <B>Dangerous!<\B> This one takes the header out of rhs
64 * and leaves rhs empty.
66 RpmHeader( BinHeader::Ptr & rhs );
74 std::string tag_name() const;
75 Edition tag_edition() const;
76 Arch tag_arch() const;
78 Date tag_installtime() const;
79 Date tag_buildtime() const;
82 * If <code>freq_r</code> is not NULL, file dependencies found are inserted.
84 CapSet tag_provides ( std::set<std::string> * freq_r = 0 ) const;
88 CapSet tag_requires ( std::set<std::string> * freq_r = 0 ) const;
92 CapSet tag_prerequires ( std::set<std::string> * freq_r = 0 ) const;
96 CapSet tag_conflicts( std::set<std::string> * freq_r = 0 ) const;
100 CapSet tag_obsoletes( std::set<std::string> * freq_r = 0 ) const;
102 ByteCount tag_size() const;
103 ByteCount tag_archivesize() const;
105 std::string tag_summary() const;
106 std::string tag_description() const;
107 std::string tag_group() const;
108 std::string tag_vendor() const;
109 std::string tag_distribution() const;
110 std::string tag_license() const;
111 std::string tag_buildhost() const;
112 std::string tag_packager() const;
113 std::string tag_url() const;
114 std::string tag_os() const;
115 std::string tag_prein() const;
116 std::string tag_postin() const;
117 std::string tag_preun() const;
118 std::string tag_postun() const;
119 std::string tag_sourcerpm() const;
121 std::list<std::string> tag_filenames() const;
123 Changelog tag_changelog() const;
126 * Returns reference to arg <code>dudata_r</code>.
128 DiskUsage & tag_du( DiskUsage & dudata_r ) const;
132 virtual std::ostream & dumpOn( std::ostream & str ) const;
137 * Digest and signature verification flags
142 NOSIGNATURE = (1<<1),
147 * Get an accessible packages data from disk.
148 * Returns NULL on any error.
150 static RpmHeader::constPtr readPackage( const Pathname & path,
151 VERIFICATION verification = VERIFY );
154 ///////////////////////////////////////////////////////////////////
156 } // namespace target
159 #endif // ZYPP_TARGET_RPM_RPMHEADER_H