Imported Upstream version 17.11.2
[platform/upstream/libzypp.git] / zypp / target / TargetException.h
1 /*---------------------------------------------------------------------\
2 |                          ____ _   __ __ ___                          |
3 |                         |__  / \ / / . \ . \                         |
4 |                           / / \ V /|  _/  _/                         |
5 |                          / /__ | | | | | |                           |
6 |                         /_____||_| |_| |_|                           |
7 |                                                                      |
8 \---------------------------------------------------------------------*/
9 /** \file zypp/target/TargetException.h
10  *
11 */
12 #ifndef ZYPP_TARGET_TARGETEXCEPTION_H
13 #define ZYPP_TARGET_TARGETEXCEPTION_H
14
15 #include <iosfwd>
16
17 #include <string>
18
19 #include "zypp/base/Exception.h"
20 #include "zypp/Pathname.h"
21
22 ///////////////////////////////////////////////////////////////////
23 namespace zypp
24 { /////////////////////////////////////////////////////////////////
25   namespace target {
26     ///////////////////////////////////////////////////////////////
27     //
28     //  CLASS NAME : TargetException
29     /** Just inherits Exception to separate target exceptions
30      *
31      **/
32     class TargetException : public Exception
33     {
34     public:
35       /** Ctor taking message.
36        * Use \ref ZYPP_THROW to throw exceptions.
37       */
38       TargetException()
39       : Exception( "Target Exception" )
40       {}
41       /** Ctor taking message.
42        * Use \ref ZYPP_THROW to throw exceptions.
43       */
44       TargetException( const std::string & msg_r )
45       : Exception( msg_r )
46       {}
47       /** Dtor. */
48       virtual ~TargetException() throw() {};
49     };
50
51     class TargetAbortedException : public TargetException
52     {
53     public:
54       TargetAbortedException( );
55
56       /** Ctor taking message.
57        * Use \ref ZYPP_THROW to throw exceptions.
58       */
59       TargetAbortedException( const std::string & msg_r )
60       : TargetException( msg_r )
61       {}
62       /** Dtor. */
63       virtual ~TargetAbortedException() throw() {};
64     protected:
65       virtual std::ostream & dumpOn( std::ostream & str ) const;
66     private:
67     };
68
69
70   /////////////////////////////////////////////////////////////////
71   } // namespace target
72 } // namespace zypp
73 ///////////////////////////////////////////////////////////////////
74 #endif // ZYPP_TARGET_TARGETEXCEPTION_H