- Added package attributes Package::sourcePkgName and
[platform/upstream/libzypp.git] / zypp / Package.h
1 /*---------------------------------------------------------------------\
2 |                          ____ _   __ __ ___                          |
3 |                         |__  / \ / / . \ . \                         |
4 |                           / / \ V /|  _/  _/                         |
5 |                          / /__ | | | | | |                           |
6 |                         /_____||_| |_| |_|                           |
7 |                                                                      |
8 \---------------------------------------------------------------------*/
9 /** \file       zypp/Package.h
10  *
11 */
12 #ifndef ZYPP_PACKAGE_H
13 #define ZYPP_PACKAGE_H
14
15 #include "zypp/ResObject.h"
16 #include "zypp/detail/PackageImplIf.h"
17
18 ///////////////////////////////////////////////////////////////////
19 namespace zypp
20 { /////////////////////////////////////////////////////////////////
21
22   DEFINE_PTR_TYPE(Package);
23
24   ///////////////////////////////////////////////////////////////////
25   //
26   //    CLASS NAME : Package
27   //
28   /** Package interface.
29   */
30   class Package : public ResObject
31   {
32   public:
33     typedef detail::PackageImplIf    Impl;
34     typedef Package                  Self;
35     typedef ResTraits<Self>          TraitsType;
36     typedef TraitsType::PtrType      Ptr;
37     typedef TraitsType::constPtrType constPtr;
38
39   public:
40     typedef std::set<PackageKeyword> Keywords;
41
42   public:
43
44     /** Get the package change log */
45     Changelog changelog() const;
46     /** */
47     std::string buildhost() const;
48     /** */
49     std::string distribution() const;
50     /** */
51     Label license() const;
52     /** */
53     std::string packager() const;
54     /** */
55     PackageGroup group() const;
56     /** */
57     Keywords keywords() const;
58     /** Don't ship it as class Url, because it might be
59      * in fact anything but a legal Url. */
60     std::string url() const;
61     /** */
62     std::string os() const;
63     /** */
64     Text prein() const;
65     /** */
66     Text postin() const;
67     /** */
68     Text preun() const;
69     /** */
70     Text postun() const;
71     /** */
72     ByteCount sourcesize() const;
73     /** */
74     std::list<std::string> authors() const;
75     /** */
76     std::list<std::string> filenames() const;
77
78     /** Disk usage per directory */
79     DiskUsage diskusage() const;
80
81     /** Name of the source rpm this package was built from.
82      * Empty if unknown.
83      */
84     std::string sourcePkgName() const;
85
86     /** Edition of the source rpm this package was built from.
87      * Empty if unknown.
88      */
89     Edition sourcePkgEdition() const;
90
91     /**
92      * Checksum the source says this package should have
93      * \deprecated Use location().checksum()
94      */
95     ZYPP_DEPRECATED CheckSum checksum() const
96     { return location().checksum(); }
97
98     /**
99      * \short Location of the resolvable in the repository
100      */
101     OnMediaLocation location() const;
102
103   protected:
104     Package( const NVRAD & nvrad_r );
105     /** Dtor */
106     virtual ~Package();
107
108   private:
109     /** Access implementation */
110     virtual Impl & pimpl() = 0;
111     /** Access implementation */
112     virtual const Impl & pimpl() const = 0;
113   };
114   ///////////////////////////////////////////////////////////////////
115
116   /////////////////////////////////////////////////////////////////
117 } // namespace zypp
118 ///////////////////////////////////////////////////////////////////
119 #endif // ZYPP_PACKAGE_H