- Parse and provide package keywords. (Fate 120368)
[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      * Checksum the source says this package should have
45      */
46     CheckSum checksum() const;
47     /** Get the package change log */
48     Changelog changelog() const;
49     /** */
50     std::string buildhost() const;
51     /** */
52     std::string distribution() const;
53     /** */
54     Label license() const;
55     /** */
56     std::string packager() const;
57     /** */
58     PackageGroup group() const;
59     /** */
60     Keywords keywords() const;
61     /** Don't ship it as class Url, because it might be
62      * in fact anything but a legal Url. */
63     std::string url() const;
64     /** */
65     std::string os() const;
66     /** */
67     Text prein() const;
68     /** */
69     Text postin() const;
70     /** */
71     Text preun() const;
72     /** */
73     Text postun() const;
74     /** */
75     ByteCount sourcesize() const;
76     /** */
77     std::list<std::string> authors() const;
78     /** */
79     std::list<std::string> filenames() const;
80
81     /** Disk usage per directory */
82     DiskUsage diskusage() const;
83
84     /** location in source */
85     Pathname location() const;
86
87   protected:
88     Package( const NVRAD & nvrad_r );
89     /** Dtor */
90     virtual ~Package();
91
92   private:
93     /** Access implementation */
94     virtual Impl & pimpl() = 0;
95     /** Access implementation */
96     virtual const Impl & pimpl() const = 0;
97   };
98   ///////////////////////////////////////////////////////////////////
99
100   /////////////////////////////////////////////////////////////////
101 } // namespace zypp
102 ///////////////////////////////////////////////////////////////////
103 #endif // ZYPP_PACKAGE_H