libzypp: zypp-core/base/userrequestexception.h Source File

libzypp 17.38.8

userrequestexception.h
Go to the documentation of this file.
1/*---------------------------------------------------------------------\
2| ____ _ __ __ ___ |
3| |__ / \ / / . \ . \ |
4| / / \ V /| _/ _/ |
5| / /__ | | | | | | |
6| /_____||_| |_| |_| |
7| |
8\---------------------------------------------------------------------*/
12#ifndef ZYPP_CORE_BASE_USERREQUESTEXCEPTION_H
13#define ZYPP_CORE_BASE_USERREQUESTEXCEPTION_H
14
15#include <iosfwd>
16
17#include <zypp-core/base/Exception.h>
18
20namespace zypp
21{
22
24 //
25 // CLASS NAME : UserRequestException
26 //
64 class ZYPP_API UserRequestException : public Exception
65 {
66 public:
67 enum Kind { UNSPECIFIED, IGNORE, SKIP, RETRY, ABORT };
68 public:
69 explicit
70 UserRequestException( const std::string & msg_r = std::string() );
71 UserRequestException( const std::string & msg_r, const Exception & history_r );
72 explicit
73 UserRequestException( Kind kind_r, const std::string & msg_r = std::string() );
74 UserRequestException( Kind kind_r, const std::string & msg_r, const Exception & history_r );
75 public:
76 Kind kind() const
77 { return _kind; }
78 protected:
79 std::ostream & dumpOn( std::ostream & str ) const override;
80 private:
81 Kind _kind;
82 };
83
84
86#define declException( EXCP, KIND ) \
87 struct ZYPP_API EXCP : public UserRequestException { \
88 explicit \
89 EXCP( const std::string & msg_r = std::string() ) \
90 : UserRequestException( KIND, msg_r ) \
91 {} \
92 EXCP( const std::string & msg_r, const Exception & history_r ) \
93 : UserRequestException( KIND, msg_r, history_r ) \
94 {} \
95 }
96
97 declException( IgnoreRequestException, IGNORE );
98 declException( SkipRequestException, SKIP );
99 declException( RetryRequestException, RETRY );
100 declException( AbortRequestException, ABORT );
101
102#undef declException
103
105} // namespace zypp
107#endif // ZYPP_CORE_BASE_USERREQUESTEXCEPTION_H
Exception.h
declException
#define declException(EXCP, BASE)
Convenience macro to declare more specific PluginScriptExceptions.
Definition PluginScriptException.h:35
zypp::Exception
Base class for Exception.
Definition Exception.h:153
zypp::Exception::Exception
Exception()
Default ctor.
Definition Exception.cc:94
zypp::UserRequestException
Base for exceptions caused by explicit user request.
Definition userrequestexception.h:65
zypp::UserRequestException::Kind
Kind
Definition userrequestexception.h:67
zypp::UserRequestException::ABORT
@ ABORT
Definition userrequestexception.h:67
zypp::UserRequestException::SKIP
@ SKIP
Definition userrequestexception.h:67
zypp::UserRequestException::UNSPECIFIED
@ UNSPECIFIED
Definition userrequestexception.h:67
zypp::UserRequestException::RETRY
@ RETRY
Definition userrequestexception.h:67
zypp::UserRequestException::IGNORE
@ IGNORE
Definition userrequestexception.h:67
zypp::UserRequestException::UserRequestException
UserRequestException(const std::string &msg_r=std::string())
Definition userrequestexception.cc:28
zypp::UserRequestException::kind
Kind kind() const
Definition userrequestexception.h:76
zypp::UserRequestException::_kind
Kind _kind
Definition userrequestexception.h:81
str
String related utilities and Regular expression matching.
zypp
Easy-to use interface to the ZYPP dependency resolver.
Definition CodePitfalls.doc:2
zypp::ZYPP_API
const Arch Arch_empty ZYPP_API
relates: Arch This is an empty Arch represented by an empty string.
Definition Arch.h:173
zypp::dumpOn
std::ostream & dumpOn(std::ostream &str, const Capability &obj)
relates: Capability Detailed stream output
Definition Capability.cc:589