libzypp  11.13.5
RpmHeader.h
Go to the documentation of this file.
1 /*---------------------------------------------------------------------\
2 | ____ _ __ __ ___ |
3 | |__ / \ / / . \ . \ |
4 | / / \ V /| _/ _/ |
5 | / /__ | | | | | | |
6 | /_____||_| |_| |_| |
7 | |
8 \---------------------------------------------------------------------*/
12 #ifndef ZYPP_TARGET_RPM_RPMHEADER_H
13 #define ZYPP_TARGET_RPM_RPMHEADER_H
14 
15 #include <iosfwd>
16 #include <list>
17 
19 
20 #include "zypp/Package.h"
21 #include "zypp/Changelog.h"
22 #include "zypp/Pathname.h"
23 #include "zypp/DiskUsage.h"
24 
25 
26 namespace zypp
27 {
28 namespace target
29 {
30 namespace rpm
31 {
32 
33 struct FileInfo
34 {
35  Pathname filename;
37  std::string md5sum;
38  uid_t uid;
39  gid_t gid;
40  mode_t mode;
41  time_t mtime;
42  bool ghost;
43  Pathname link_target;
44 };
45 
47 //
48 // CLASS NAME : RpmHeader
61 class RpmHeader : public BinHeader
62 {
63 public:
64  typedef intrusive_ptr<RpmHeader> Ptr;
65  typedef intrusive_ptr<const RpmHeader> constPtr;
66 
67 private:
68 
69  CapabilitySet PkgRelList_val( tag tag_r, bool pre, std::set<std::string> * freq_r = 0 ) const;
70 
71 public:
72 
76  RpmHeader( Header h_r = 0 );
77 
82  RpmHeader( BinHeader::Ptr & rhs );
83 
84  virtual ~RpmHeader();
85 
86  bool isSrc() const;
87 
88 public:
89 
90  std::string tag_name() const;
92  std::string tag_version() const;
93  std::string tag_release() const;
94  Edition tag_edition() const;
95  Arch tag_arch() const;
96 
97  Date tag_installtime() const;
98  Date tag_buildtime() const;
99 
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;
131  CapabilitySet tag_supplements( std::set<std::string> * freq_r = 0 ) const
132  { return CapabilitySet(); }
133 
134  ByteCount tag_size() const;
135  ByteCount tag_archivesize() const;
136 
137  std::string tag_summary() const;
138  std::string tag_description() const;
139  std::string tag_group() const;
140  std::string tag_vendor() const;
141  std::string tag_distribution() const;
142  std::string tag_license() const;
143  std::string tag_buildhost() const;
144  std::string tag_packager() const;
145  std::string tag_url() const;
146  std::string tag_os() const;
147  std::string tag_prein() const;
148  std::string tag_postin() const;
149  std::string tag_preun() const;
150  std::string tag_postun() const;
151  std::string tag_sourcerpm() const;
152 
154  std::list<std::string> tag_filenames() const;
155 
160  std::list<FileInfo> tag_fileinfos() const;
161 
162  Changelog tag_changelog() const;
163 
167  DiskUsage & tag_du( DiskUsage & dudata_r ) const;
168 
169 public:
170 
171  virtual std::ostream & dumpOn( std::ostream & str ) const;
172 
173 public:
174 
179  {
180  VERIFY = 0x0000,
181  NODIGEST = (1<<0),
182  NOSIGNATURE = (1<<1),
183  NOVERIFY = 0xffff
184  };
185 
190  static RpmHeader::constPtr readPackage( const Pathname & path,
191  VERIFICATION verification = VERIFY );
192 };
193 
195 } // namespace rpm
196 } // namespace target
197 } // namespace zypp
198 
199 #endif // ZYPP_TARGET_RPM_RPMHEADER_H
200