done LookupAttr, added ArrayAttr container to retrieve list attributes.
[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 sat::ArrayAttr<PackageKeyword,IdString> 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      */
70     std::string sourcePkgName() const;
71
72     /** Edition of the source rpm this package was built from.
73      */
74     Edition sourcePkgEdition() const;
75
76     /**
77      * Checksum the source says this package should have.
78      * \see \ref location
79      */
80     CheckSum checksum() const;
81
82     /** Location of the resolvable in the repository.
83      * \ref OnMediaLocation conatins all information required to
84      * retrieve the packge (url, checksum, etc.).
85      */
86     OnMediaLocation location() const;
87
88
89     /** \deprecated no metadata always empty */
90     ZYPP_DEPRECATED std::string os() const { return std::string(); }
91     /** \deprecated no metadata always empty */
92     ZYPP_DEPRECATED std::string prein() const { return std::string(); }
93     /** \deprecated no metadata always empty */
94     ZYPP_DEPRECATED std::string postin() const { return std::string(); }
95     /** \deprecated no metadata always empty */
96     ZYPP_DEPRECATED std::string preun() const { return std::string(); }
97     /** \deprecated no metadata always empty */
98     ZYPP_DEPRECATED std::string postun() const { return std::string(); }
99
100   protected:
101     friend Ptr make<Self>( const sat::Solvable & solvable_r );
102     /** Ctor */
103     Package( const sat::Solvable & solvable_r );
104     /** Dtor */
105     virtual ~Package();
106   };
107   ///////////////////////////////////////////////////////////////////
108
109   /////////////////////////////////////////////////////////////////
110 } // namespace zypp
111 ///////////////////////////////////////////////////////////////////
112 #endif // ZYPP_PACKAGE_H