Added methods to provide package to local filesystem to Package
[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   ///////////////////////////////////////////////////////////////////
23   //
24   //    CLASS NAME : Package
25   //
26   /** Package interface.
27   */
28   class Package : public ResObject
29   {
30   public:
31     typedef detail::PackageImplIf    Impl;
32     typedef Package                  Self;
33     typedef ResTraits<Self>          TraitsType;
34     typedef TraitsType::PtrType      Ptr;
35     typedef TraitsType::constPtrType constPtr;
36
37   public:
38     /** Time of package installation */
39     Date installtime() const;
40     /** Get the package change log */
41     Changelog changelog() const;
42     /** */
43     Date buildtime() const;
44     /** */
45     std::string buildhost() const;
46     /** */
47     std::string distribution() const;
48     /** */
49     Vendor vendor() const;
50     /** */
51     Label license() const;
52     /** */
53     std::string packager() const;
54     /** */
55     PackageGroup group() const;
56     /** Don't ship it as class Url, because it might be
57      * in fact anything but a legal Url. */
58     std::string url() const;
59     /** */
60     std::string os() const;
61     /** */
62     Text prein() const;
63     /** */
64     Text postin() const;
65     /** */
66     Text preun() const;
67     /** */
68     Text postun() const;
69     /** */
70     ByteCount sourcesize() const;
71     /** */
72     ByteCount archivesize() const;
73     /** */
74     Text authors() const;
75     /** */
76     Text filenames() const;
77     /** */
78     License licenseToConfirm() const;
79     /** */
80     Pathname plainRpm() const;
81     /** */
82     std::list<PatchRpm> patchRpms() const;
83     /** */
84     std::list<DeltaRpm> deltaRpms() const;
85     /**
86      * \throws Exception
87      */
88     Pathname getPlainRpm() const;
89     /**
90      * \throws Exception
91      */
92     Pathname getDeltaRpm(BaseVersion & base_r) const;
93     /**
94      * \throws Exception
95      */
96     Pathname getPatchRpm(BaseVersion & base_r) const;
97
98     // data here:
99  
100
101   protected:
102     Package( const NVRAD & nvrad_r );
103     /** Dtor */
104     virtual ~Package();
105
106   private:
107     /** Access implementation */
108     virtual Impl & pimpl() = 0;
109     /** Access implementation */
110     virtual const Impl & pimpl() const = 0;
111   };
112   ///////////////////////////////////////////////////////////////////
113
114   /////////////////////////////////////////////////////////////////
115 } // namespace zypp
116 ///////////////////////////////////////////////////////////////////
117 #endif // ZYPP_PACKAGE_H