libzypp
17.24.2
UserRequestException.cc
Go to the documentation of this file.
1
/*---------------------------------------------------------------------\
2
| ____ _ __ __ ___ |
3
| |__ / \ / / . \ . \ |
4
| / / \ V /| _/ _/ |
5
| / /__ | | | | | | |
6
| /_____||_| |_| |_| |
7
| |
8
\---------------------------------------------------------------------*/
12
#include <iostream>
13
//#include <zypp/base/Logger.h>
14
15
#include <
zypp/base/UserRequestException.h
>
16
17
using
std::endl;
18
20
namespace
zypp
21
{
22
24
//
25
// METHOD NAME : UserRequestException::UserRequestException
26
// METHOD TYPE : Ctor
27
//
28
UserRequestException::UserRequestException
(
const
std::string & msg_r )
29
:
Exception
( msg_r ), _kind( UNSPECIFIED )
30
{}
31
32
UserRequestException::UserRequestException
(
const
std::string & msg_r,
const
Exception
& history_r )
33
:
Exception
( msg_r, history_r ), _kind( UNSPECIFIED )
34
{}
35
36
UserRequestException::UserRequestException
(
Kind
kind_r,
const
std::string & msg_r )
37
:
Exception
( msg_r ), _kind( kind_r )
38
{}
39
40
UserRequestException::UserRequestException
(
Kind
kind_r,
const
std::string & msg_r,
const
Exception
& history_r )
41
:
Exception
( msg_r, history_r ), _kind( kind_r )
42
{}
43
45
//
46
// METHOD NAME : UserRequestException::dumpOn
47
// METHOD TYPE : std::ostream &
48
//
49
std::ostream &
UserRequestException::dumpOn
( std::ostream &
str
)
const
50
{
51
switch
(
_kind
)
52
{
53
case
UNSPECIFIED
:
str
<<
"UNSPECIFIED"
;
break
;
54
case
IGNORE
:
str
<<
"IGNORE"
;
break
;
55
case
SKIP
:
str
<<
"SKIP"
;
break
;
56
case
RETRY
:
str
<<
"RETRY"
;
break
;
57
case
ABORT
:
str
<<
"ABORT"
;
break
;
58
// no default !
59
}
60
return
str
<<
" request: "
<<
msg
();
61
}
62
64
}
// namespace zypp
zypp::Exception
Base class for Exception.
Definition:
Exception.h:146
zypp::UserRequestException::ABORT
@ ABORT
Definition:
UserRequestException.h:67
zypp::UserRequestException::UserRequestException
UserRequestException(const std::string &msg_r=std::string())
Definition:
UserRequestException.cc:28
zypp::UserRequestException::Kind
Kind
Definition:
UserRequestException.h:67
zypp::UserRequestException::RETRY
@ RETRY
Definition:
UserRequestException.h:67
zypp::UserRequestException::_kind
Kind _kind
Definition:
UserRequestException.h:81
zypp::UserRequestException::dumpOn
virtual std::ostream & dumpOn(std::ostream &str) const
Overload this to print a proper error message.
Definition:
UserRequestException.cc:49
zypp
Easy-to use interface to the ZYPP dependency resolver.
Definition:
CodePitfalls.doc:2
zypp::UserRequestException::IGNORE
@ IGNORE
Definition:
UserRequestException.h:67
UserRequestException.h
zypp::UserRequestException::UNSPECIFIED
@ UNSPECIFIED
Definition:
UserRequestException.h:67
zypp::UserRequestException::SKIP
@ SKIP
Definition:
UserRequestException.h:67
str
String related utilities and Regular expression matching.
zypp::Exception::msg
const std::string & msg() const
Return the message string provided to the ctor.
Definition:
Exception.h:195
zypp
base
UserRequestException.cc
Generated by
1.8.18