some fixes
[platform/upstream/libzypp.git] / zypp / Patch.cc
1 /*---------------------------------------------------------------------\
2 |                          ____ _   __ __ ___                          |
3 |                         |__  / \ / / . \ . \                         |
4 |                           / / \ V /|  _/  _/                         |
5 |                          / /__ | | | | | |                           |
6 |                         /_____||_| |_| |_|                           |
7 |                                                                      |
8 \---------------------------------------------------------------------*/
9 /** \file zypp/Patch.cc
10  *
11 */
12 #include <iostream>
13
14 #include "zypp/base/Logger.h"
15 #include "zypp/Patch.h"
16 #include "zypp/detail/PatchImpl.h"
17
18 using namespace std;
19
20 ///////////////////////////////////////////////////////////////////
21 namespace zypp
22 { /////////////////////////////////////////////////////////////////
23
24   ///////////////////////////////////////////////////////////////////
25   //
26   //    METHOD NAME : Patch::Patch
27   //    METHOD TYPE : Ctor
28   //
29   Patch::Patch( detail::PatchImplPtr impl_r )
30   : Resolvable (impl_r)
31   , _pimpl( impl_r )
32   {
33   }
34
35
36   ///////////////////////////////////////////////////////////////////
37   //
38   //    METHOD NAME : Patch::~Patch
39   //    METHOD TYPE : Dtor
40   //
41   Patch::~Patch()
42   {}
43
44   ///////////////////////////////////////////////////////////////////
45   //
46   //    METHOD NAME : Patch::interactive
47   //    Check whether patch can be applied only interactivly
48   //
49   bool Patch::interactive ()
50   {
51     return _pimpl->interactive ();
52   }
53
54   ///////////////////////////////////////////////////////////////////
55   //
56   //    METHOD NAME : Patch::category
57   //    Get the category of the patch
58   //
59   std::string Patch::category ()
60   {
61     return _pimpl->_category;
62   }
63
64   ///////////////////////////////////////////////////////////////////
65   //
66   //    METHOD NAME : Patch::summary
67   //    Get the patch summary
68   //
69   std::string Patch::summary ()
70   {
71     return _pimpl->_summary["en"];
72   }
73
74   ///////////////////////////////////////////////////////////////////
75   //
76   //    METHOD NAME : Patch::description
77   //    Get the patch description
78   //
79   std::string Patch::description ()
80   {
81     return _pimpl->_description["en"];
82   }
83
84   void Patch::mark_atoms_to_freshen (bool freshen)
85   {
86     _pimpl->mark_atoms_to_freshen (freshen);
87   }
88   ///////////////////////////////////////////////////////////////////
89   //
90   //    METHOD NAME : Patch::any_atom_selected
91   //    Check whether there is at least one atom of the solution selected
92   //
93   bool Patch::any_atom_selected ()
94   {
95     return _pimpl->any_atom_selected ();
96   }
97
98   ///////////////////////////////////////////////////////////////////
99   //
100   //    METHOD NAME : Patch::select
101   //    Mark all atoms to be updated (set them as freshen) and mark
102   //    the patch itself as selected for being installed/updated
103   //
104   // FIXME to be changed to inherit Resolvable's method
105   void Patch::select ()
106 //  : Resolvable::select ()
107   {
108     mark_atoms_to_freshen (true); // FIXME
109   }
110
111   /////////////////////////////////////////////////////////////////
112 } // namespace zypp
113 ///////////////////////////////////////////////////////////////////