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/Pathname.h"
23 #include "zypp/DiskUsage.h"
46 ///////////////////////////////////////////////////////////////////
48 // CLASS NAME : RpmHeader
50 * @short Wrapper class for rpm header struct.
52 * <code>RpmHeader</code> provides methods to query the content
53 * of a rpm header struct retrieved from the RPM database or by reading
54 * the rpm header of a package on disk.
56 * The rpm header contains all data associated with a package. So you
57 * probabely do not want to permanently store too many of them.
59 * <B>NEVER create <code>RpmHeader</code> from a NULL <code>Header</code>! </B>
61 class RpmHeader : public BinHeader
64 typedef intrusive_ptr<RpmHeader> Ptr;
65 typedef intrusive_ptr<const RpmHeader> constPtr;
69 CapabilitySet PkgRelList_val( tag tag_r, bool pre, std::set<std::string> * freq_r = 0 ) const;
76 RpmHeader( Header h_r = 0 );
79 * <B>Dangerous!<\B> This one takes the header out of rhs
80 * and leaves rhs empty.
82 RpmHeader( BinHeader::Ptr & rhs );
90 std::string tag_name() const;
91 Edition::epoch_t tag_epoch() const;
92 std::string tag_version() const;
93 std::string tag_release() const;
94 Edition tag_edition() const;
95 Arch tag_arch() const;
97 Date tag_installtime() const;
98 Date tag_buildtime() const;
101 * If <code>freq_r</code> is not NULL, file dependencies found are inserted.
103 CapabilitySet tag_provides ( std::set<std::string> * freq_r = 0 ) const;
107 CapabilitySet tag_requires ( std::set<std::string> * freq_r = 0 ) const;
111 CapabilitySet tag_prerequires ( std::set<std::string> * freq_r = 0 ) const;
115 CapabilitySet tag_conflicts( std::set<std::string> * freq_r = 0 ) const;
119 CapabilitySet tag_obsoletes( std::set<std::string> * freq_r = 0 ) const;
123 CapabilitySet tag_enhances( std::set<std::string> * freq_r = 0 ) const;
127 CapabilitySet tag_suggests( std::set<std::string> * freq_r = 0 ) const;
128 /** Unsupported by rpm.
131 CapabilitySet tag_supplements( std::set<std::string> * freq_r = 0 ) const
132 { return CapabilitySet(); }
133 /** Unsupported by rpm.
136 CapabilitySet tag_freshens( std::set<std::string> * freq_r = 0 ) const
137 { return CapabilitySet(); }
139 ByteCount tag_size() const;
140 ByteCount tag_archivesize() const;
142 std::string tag_summary() const;
143 std::string tag_description() const;
144 std::string tag_group() const;
145 std::string tag_vendor() const;
146 std::string tag_distribution() const;
147 std::string tag_license() const;
148 std::string tag_buildhost() const;
149 std::string tag_packager() const;
150 std::string tag_url() const;
151 std::string tag_os() const;
152 std::string tag_prein() const;
153 std::string tag_postin() const;
154 std::string tag_preun() const;
155 std::string tag_postun() const;
156 std::string tag_sourcerpm() const;
158 /** just the list of names */
159 std::list<std::string> tag_filenames() const;
162 * complete information about the files
163 * (extended version of tag_filenames())
165 std::list<FileInfo> tag_fileinfos() const;
167 Changelog tag_changelog() const;
170 * Returns reference to arg <code>dudata_r</code>.
172 DiskUsage & tag_du( DiskUsage & dudata_r ) const;
176 virtual std::ostream & dumpOn( std::ostream & str ) const;
181 * Digest and signature verification flags
187 NOSIGNATURE = (1<<1),
192 * Get an accessible packages data from disk.
193 * Returns NULL on any error.
195 static RpmHeader::constPtr readPackage( const Pathname & path,
196 VERIFICATION verification = VERIFY );
199 ///////////////////////////////////////////////////////////////////
201 } // namespace target
204 #endif // ZYPP_TARGET_RPM_RPMHEADER_H