libzypp  17.25.2
RpmCallbacks.h
Go to the documentation of this file.
1 /*---------------------------------------------------------------------\
2 | ____ _ __ __ ___ |
3 | |__ / \ / / . \ . \ |
4 | / / \ V /| _/ _/ |
5 | / /__ | | | | | | |
6 | /_____||_| |_| |_| |
7 | |
8 \---------------------------------------------------------------------*/
13 #ifndef ZYPP_TARGET_RPM_RPMCALLBACKS_H
14 #define ZYPP_TARGET_RPM_RPMCALLBACKS_H
15 
16 #include <iosfwd>
17 
18 #include <zypp/Url.h>
19 #include <zypp/Callback.h>
20 #include <zypp/base/Exception.h>
21 #include <zypp/Pathname.h>
22 
23 namespace zypp
24 {
25 namespace target
26 {
27 namespace rpm
28 {
29 
31 // Reporting progress of package removing
34 {
35 
36  enum Action {
37  ABORT, // abort and return error
38  RETRY, // retry
39  IGNORE // ignore
40  };
41 
43  virtual void start( const std::string & name )
44  {}
49  virtual bool progress( unsigned percent )
50  { return false; }
51 
52  virtual Action problem( Exception & excpt_r )
53  { return ABORT; }
54 
56  virtual void finishInfo( const std::string & info_r )
57  {}
58 
60  virtual void finish()
61  {}
63  virtual void finish( Exception & excpt_r )
64  {}
65 };
66 
68 // Reporting progress of package installation
71 {
72 
73  enum Action {
74  ABORT, // abort and return error
75  RETRY, // retry
76  IGNORE // ignore
77  };
78 
80  virtual void start( const Pathname & name )
81  {}
86  virtual bool progress( unsigned percent )
87  { return true; }
88 
90  virtual void finishInfo( const std::string & info_r )
91  {}
92 
94  virtual void finish()
95  {}
96 
97  virtual Action problem( Exception & excpt_r )
98  { return ABORT; }
99 
101  virtual void finish( Exception & excpt_r )
102  {}
103 };
104 
105 } // namespace rpm
106 } // namespace target
107 } // namespace zypp
108 
109 #endif // ZYPP_TARGET_RPM_RPMCALLBACKS_H
zypp::target::rpm::RpmRemoveReport::finish
virtual void finish()
Finish operation in case of success.
Definition: RpmCallbacks.h:60
zypp::target::rpm::RpmInstallReport::finish
virtual void finish(Exception &excpt_r)
Finish operation in case of fail, report fail exception.
Definition: RpmCallbacks.h:101
zypp::Exception
Base class for Exception.
Definition: Exception.h:146
zypp::target::rpm::RpmInstallReport::progress
virtual bool progress(unsigned percent)
Inform about progress Return false on abort.
Definition: RpmCallbacks.h:86
zypp::target::rpm::RpmRemoveReport::IGNORE
@ IGNORE
Definition: RpmCallbacks.h:39
zypp::callback::ReportBase
Definition: Callback.h:150
zypp::target::rpm::RpmInstallReport
Definition: RpmCallbacks.h:71
zypp::target::rpm::RpmRemoveReport::start
virtual void start(const std::string &name)
Start the operation.
Definition: RpmCallbacks.h:43
Pathname.h
zypp::target::rpm::RpmRemoveReport::RETRY
@ RETRY
Definition: RpmCallbacks.h:38
zypp::target::rpm::RpmRemoveReport::problem
virtual Action problem(Exception &excpt_r)
Definition: RpmCallbacks.h:52
Callback.h
zypp::target::rpm::RpmInstallReport::IGNORE
@ IGNORE
Definition: RpmCallbacks.h:76
Exception.h
Url.h
zypp::target::rpm::RpmInstallReport::RETRY
@ RETRY
Definition: RpmCallbacks.h:75
zypp::target::rpm::RpmRemoveReport::finish
virtual void finish(Exception &excpt_r)
Finish operation in case of fail, report fail exception.
Definition: RpmCallbacks.h:63
zypp::target::rpm::RpmInstallReport::finishInfo
virtual void finishInfo(const std::string &info_r)
Additional rpm output to be reported in finish in case of success.
Definition: RpmCallbacks.h:90
zypp::target::rpm::RpmRemoveReport::progress
virtual bool progress(unsigned percent)
Inform about progress Return true on abort.
Definition: RpmCallbacks.h:49
zypp::target::rpm::RpmInstallReport::ABORT
@ ABORT
Definition: RpmCallbacks.h:74
zypp
Easy-to use interface to the ZYPP dependency resolver.
Definition: CodePitfalls.doc:2
zypp::target::rpm::RpmInstallReport::finish
virtual void finish()
Finish operation in case of success.
Definition: RpmCallbacks.h:94
zypp::target::rpm::RpmInstallReport::Action
Action
Definition: RpmCallbacks.h:73
zypp::target::rpm::RpmRemoveReport::Action
Action
Definition: RpmCallbacks.h:36
zypp::target::rpm::RpmInstallReport::start
virtual void start(const Pathname &name)
Start the operation.
Definition: RpmCallbacks.h:80
zypp::filesystem::Pathname
Pathname.
Definition: Pathname.h:45
zypp::target::rpm::RpmInstallReport::problem
virtual Action problem(Exception &excpt_r)
Definition: RpmCallbacks.h:97
zypp::target::rpm::RpmRemoveReport
Definition: RpmCallbacks.h:34
zypp::target::rpm::RpmRemoveReport::finishInfo
virtual void finishInfo(const std::string &info_r)
Additional rpm output to be reported in finish in case of success.
Definition: RpmCallbacks.h:56
zypp::target::rpm::RpmRemoveReport::ABORT
@ ABORT
Definition: RpmCallbacks.h:37