libzypp 17.31.23
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
23namespace zypp
24{
25namespace target
26{
27namespace 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
Base class for Exception.
Definition: Exception.h:146
Easy-to use interface to the ZYPP dependency resolver.
Definition: CodePitfalls.doc:2
virtual void finish(Exception &excpt_r)
Finish operation in case of fail, report fail exception.
Definition: RpmCallbacks.h:101
virtual void finishInfo(const std::string &info_r)
Additional rpm output to be reported in finish in case of success.
Definition: RpmCallbacks.h:90
virtual bool progress(unsigned percent)
Inform about progress Return false on abort.
Definition: RpmCallbacks.h:86
virtual Action problem(Exception &excpt_r)
Definition: RpmCallbacks.h:97
virtual void start(const Pathname &name)
Start the operation.
Definition: RpmCallbacks.h:80
virtual void finish()
Finish operation in case of success.
Definition: RpmCallbacks.h:94
virtual void finishInfo(const std::string &info_r)
Additional rpm output to be reported in finish in case of success.
Definition: RpmCallbacks.h:56
virtual void start(const std::string &name)
Start the operation.
Definition: RpmCallbacks.h:43
virtual void finish(Exception &excpt_r)
Finish operation in case of fail, report fail exception.
Definition: RpmCallbacks.h:63
virtual Action problem(Exception &excpt_r)
Definition: RpmCallbacks.h:52
virtual bool progress(unsigned percent)
Inform about progress Return true on abort.
Definition: RpmCallbacks.h:49
virtual void finish()
Finish operation in case of success.
Definition: RpmCallbacks.h:60