libzypp  12.16.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; //< Either 'src' or 'nosrc'
87  bool isNosrc() const; //< Only 'nosrc'
88 
89 public:
90 
91  std::string tag_name() const;
93  std::string tag_version() const;
94  std::string tag_release() const;
95  Edition tag_edition() const;
96  Arch tag_arch() const;
97 
98  Date tag_installtime() const;
99  Date tag_buildtime() const;
100 
104  CapabilitySet tag_provides ( std::set<std::string> * freq_r = 0 ) const;
108  CapabilitySet tag_requires ( std::set<std::string> * freq_r = 0 ) const;
112  CapabilitySet tag_prerequires ( std::set<std::string> * freq_r = 0 ) const;
116  CapabilitySet tag_conflicts( std::set<std::string> * freq_r = 0 ) const;
120  CapabilitySet tag_obsoletes( std::set<std::string> * freq_r = 0 ) const;
124  CapabilitySet tag_enhances( std::set<std::string> * freq_r = 0 ) const;
128  CapabilitySet tag_suggests( std::set<std::string> * freq_r = 0 ) const;
132  CapabilitySet tag_supplements( std::set<std::string> * freq_r = 0 ) const
133  { return CapabilitySet(); }
134 
135  ByteCount tag_size() const;
136  ByteCount tag_archivesize() const;
137 
138  std::string tag_summary() const;
139  std::string tag_description() const;
140  std::string tag_group() const;
141  std::string tag_vendor() const;
142  std::string tag_distribution() const;
143  std::string tag_license() const;
144  std::string tag_buildhost() const;
145  std::string tag_packager() const;
146  std::string tag_url() const;
147  std::string tag_os() const;
148  std::string tag_prein() const;
149  std::string tag_postin() const;
150  std::string tag_preun() const;
151  std::string tag_postun() const;
152  std::string tag_sourcerpm() const;
153 
155  std::list<std::string> tag_filenames() const;
156 
161  std::list<FileInfo> tag_fileinfos() const;
162 
163  Changelog tag_changelog() const;
164 
168  DiskUsage & tag_du( DiskUsage & dudata_r ) const;
169 
170 public:
171 
172  virtual std::ostream & dumpOn( std::ostream & str ) const;
173 
174 public:
175 
180  {
181  VERIFY = 0x0000,
182  NODIGEST = (1<<0),
183  NOSIGNATURE = (1<<1),
184  NOVERIFY = 0xffff
185  };
186 
191  static RpmHeader::constPtr readPackage( const Pathname & path,
192  VERIFICATION verification = VERIFY );
193 };
194 
196 } // namespace rpm
197 } // namespace target
198 } // namespace zypp
199 
200 #endif // ZYPP_TARGET_RPM_RPMHEADER_H
201