backup while cleaning up
[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/PackageKeyword.h"
17 #include "zypp/Changelog.h"
18
19 ///////////////////////////////////////////////////////////////////
20 namespace zypp
21 { /////////////////////////////////////////////////////////////////
22
23   DEFINE_PTR_TYPE(Package);
24
25   ///////////////////////////////////////////////////////////////////
26   //
27   //    CLASS NAME : Package
28   //
29   /** Package interface.
30   */
31   class Package : public ResObject
32   {
33   public:
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     std::string license() const;
52     /** */
53     std::string packager() const;
54     /** */
55     std::string 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     /** Size of corresponding the source package. */
62     ByteCount sourcesize() const;
63     /** */
64     std::list<std::string> authors() const;
65     /** */
66     std::list<std::string> filenames() const;
67
68     /** Name of the source rpm this package was built from.
69      * Empty if unknown.
70      */
71     std::string sourcePkgName() const;
72
73     /** Edition of the source rpm this package was built from.
74      * Empty if unknown.
75      */
76     Edition sourcePkgEdition() const;
77
78     /**
79      * Checksum the source says this package should have.
80      * \see \ref location
81      */
82     CheckSum checksum() const
83     { return location().checksum(); }
84
85     /** Location of the resolvable in the repository.
86      * \ref OnMediaLocation conatins all information required to
87      * retrieve the packge (url, checksum, etc.).
88      */
89     OnMediaLocation location() const;
90
91
92     /** \deprecated no metadata always empty */
93     ZYPP_DEPRECATED std::string os() const { return std::string(); }
94     /** \deprecated no metadata always empty */
95     ZYPP_DEPRECATED std::string prein() const { return std::string(); }
96     /** \deprecated no metadata always empty */
97     ZYPP_DEPRECATED std::string postin() const { return std::string(); }
98     /** \deprecated no metadata always empty */
99     ZYPP_DEPRECATED std::string preun() const { return std::string(); }
100     /** \deprecated no metadata always empty */
101     ZYPP_DEPRECATED std::string postun() const { return std::string(); }
102
103   protected:
104     friend Ptr make<Self>( const sat::Solvable & solvable_r );
105     /** Ctor */
106     Package( const sat::Solvable & solvable_r );
107     /** Dtor */
108     virtual ~Package();
109   };
110   ///////////////////////////////////////////////////////////////////
111
112   /////////////////////////////////////////////////////////////////
113 } // namespace zypp
114 ///////////////////////////////////////////////////////////////////
115 #endif // ZYPP_PACKAGE_H