libzypp  17.23.8
RpmException.h
Go to the documentation of this file.
1 /*---------------------------------------------------------------------\
2 | ____ _ __ __ ___ |
3 | |__ / \ / / . \ . \ |
4 | / / \ V /| _/ _/ |
5 | / /__ | | | | | | |
6 | /_____||_| |_| |_| |
7 | |
8 \---------------------------------------------------------------------*/
12 #ifndef ZYPP_TARGET_RPM_RPMEXCEPTION_H
13 #define ZYPP_TARGET_RPM_RPMEXCEPTION_H
14 
15 #include <iosfwd>
16 
17 #include <string>
18 
19 #include <zypp/base/Exception.h>
20 #include <zypp/Pathname.h>
21 #include <zypp/Url.h>
22 
24 namespace zypp
25 {
26 namespace target
27 {
29 namespace rpm
30 {
32 //
33 // CLASS NAME : RpmException
37 class RpmException : public Exception
38 {
39 public:
44  : Exception( "Rpm Exception" )
45  {}
49  RpmException( const std::string & msg_r )
50  : Exception( msg_r )
51  {}
53  virtual ~RpmException() throw()
54  {};
55 };
56 
58 {
59 public:
64  : RpmException("Global RPM initialization failed")
65  {}
67  virtual ~GlobalRpmInitException() throw()
68  {};
69 private:
70 };
71 
73 {
74 public:
79  const Pathname & dbpath_r )
80  : RpmException()
81  , _root(root_r.asString())
82  , _dbpath(dbpath_r.asString())
83  {}
85  virtual ~RpmInvalidRootException() throw()
86  {};
87  std::string root() const
88  {
89  return _root;
90  }
91  std::string dbpath() const
92  {
93  return _dbpath;
94  }
95 protected:
96  virtual std::ostream & dumpOn( std::ostream & str ) const;
97 private:
98  std::string _root;
99  std::string _dbpath;
100 };
101 
103 {
104 public:
106  const Pathname & dbpath_r )
107  : RpmException()
108  , _root(root_r.asString())
109  , _dbpath(dbpath_r.asString())
110  {}
111  virtual ~RpmAccessBlockedException() throw()
112  {};
113  std::string root() const
114  {
115  return _root;
116  }
117  std::string dbpath() const
118  {
119  return _dbpath;
120  }
121 protected:
122  virtual std::ostream & dumpOn( std::ostream & str ) const;
123 private:
124  std::string _root;
125  std::string _dbpath;
126 };
127 
129 {
130 public:
131  RpmSubprocessException(const std::string & errmsg_r)
132  : RpmException()
133  , _errmsg(errmsg_r)
134  {}
135  virtual ~RpmSubprocessException() throw()
136  {};
137 protected:
138  virtual std::ostream & dumpOn( std::ostream & str ) const;
139 private:
140  std::string _errmsg;
141 };
142 
144 {
145 public:
146  RpmInitException(const Pathname & root_r,
147  const Pathname & dbpath_r)
148  : RpmException()
149  , _root(root_r.asString())
150  , _dbpath(dbpath_r.asString())
151  {}
152  virtual ~RpmInitException() throw()
153  {};
154 protected:
155  virtual std::ostream & dumpOn( std::ostream & str ) const;
156 private:
157  std::string _root;
158  std::string _dbpath;
159 };
160 
162 {
163 public:
164  RpmDbOpenException(const Pathname & root_r,
165  const Pathname & dbpath_r)
166  : RpmException()
167  , _root(root_r.asString())
168  , _dbpath(dbpath_r.asString())
169  {}
170  virtual ~RpmDbOpenException() throw()
171  {};
172 protected:
173  virtual std::ostream & dumpOn( std::ostream & str ) const;
174 private:
175  std::string _root;
176  std::string _dbpath;
177 };
178 
180 {
181 public:
183  const Pathname & old_dbpath_r,
184  const Pathname & new_root_r,
185  const Pathname & new_dbpath_r)
186  : RpmException()
187  , _old_root(old_root_r.asString())
188  , _old_dbpath(old_dbpath_r.asString())
189  , _new_root(new_root_r.asString())
190  , _new_dbpath(new_dbpath_r.asString())
191  {}
192  virtual ~RpmDbAlreadyOpenException() throw()
193  {};
194 protected:
195  virtual std::ostream & dumpOn( std::ostream & str ) const;
196 private:
197  std::string _old_root;
198  std::string _old_dbpath;
199  std::string _new_root;
200  std::string _new_dbpath;
201 };
202 
204 {
205 public:
207  : RpmException()
208  {}
209  virtual ~RpmDbNotOpenException() throw()
210  {};
211 protected:
212  virtual std::ostream & dumpOn( std::ostream & str ) const;
213 private:
214 };
215 
217 {
218 public:
220  : RpmException()
221  {}
222  virtual ~RpmDbConvertException() throw()
223  {};
224 protected:
225  virtual std::ostream & dumpOn( std::ostream & str ) const;
226 private:
227 };
228 
230 {
231 public:
233  : RpmException()
234  {}
235  virtual ~RpmNullDatabaseException() throw()
236  {};
237 protected:
238  virtual std::ostream & dumpOn( std::ostream & str ) const;
239 private:
240 };
241 
242 
243 
245 } // namespace rpm
246 } // namespace target
247 } // namespace zypp
249 #endif // ZYPP_TARGET_RPM_RPMEXCEPTION_H
zypp::target::rpm::RpmAccessBlockedException::dbpath
std::string dbpath() const
Definition: RpmException.h:117
zypp::target::rpm::RpmInitException
Definition: RpmException.h:143
zypp::target::rpm::GlobalRpmInitException::~GlobalRpmInitException
virtual ~GlobalRpmInitException()
Dtor.
Definition: RpmException.h:67
zypp::target::rpm::RpmAccessBlockedException::root
std::string root() const
Definition: RpmException.h:113
zypp::target::rpm::RpmDbNotOpenException::~RpmDbNotOpenException
virtual ~RpmDbNotOpenException()
Definition: RpmException.h:209
zypp::Exception
Base class for Exception.
Definition: Exception.h:145
zypp::target::rpm::RpmDbNotOpenException
Definition: RpmException.h:203
zypp::target::rpm::RpmSubprocessException::~RpmSubprocessException
virtual ~RpmSubprocessException()
Definition: RpmException.h:135
zypp::target::rpm::RpmNullDatabaseException
Definition: RpmException.h:229
zypp::target::rpm::RpmSubprocessException::_errmsg
std::string _errmsg
Definition: RpmException.h:140
zypp::target::rpm::RpmAccessBlockedException::~RpmAccessBlockedException
virtual ~RpmAccessBlockedException()
Definition: RpmException.h:111
zypp::target::rpm::RpmDbConvertException
Definition: RpmException.h:216
zypp::target::rpm::GlobalRpmInitException::GlobalRpmInitException
GlobalRpmInitException()
Ctor taking message.
Definition: RpmException.h:63
zypp::target::rpm::RpmAccessBlockedException::_root
std::string _root
Definition: RpmException.h:124
zypp::target::rpm::RpmNullDatabaseException::dumpOn
virtual std::ostream & dumpOn(std::ostream &str) const
Overload this to print a proper error message.
Definition: RpmException.cc:73
Pathname.h
zypp::target::rpm::RpmInitException::dumpOn
virtual std::ostream & dumpOn(std::ostream &str) const
Overload this to print a proper error message.
Definition: RpmException.cc:45
zypp::target::rpm::RpmDbAlreadyOpenException::dumpOn
virtual std::ostream & dumpOn(std::ostream &str) const
Overload this to print a proper error message.
Definition: RpmException.cc:57
zypp::target::rpm::RpmSubprocessException
Definition: RpmException.h:128
zypp::target::rpm::RpmAccessBlockedException::dumpOn
virtual std::ostream & dumpOn(std::ostream &str) const
Overload this to print a proper error message.
Definition: RpmException.cc:34
zypp::target::rpm::RpmInvalidRootException::root
std::string root() const
Definition: RpmException.h:87
Exception.h
Url.h
zypp::Exception::asString
std::string asString() const
Error message provided by dumpOn as string.
Definition: Exception.cc:75
zypp::target::rpm::RpmNullDatabaseException::~RpmNullDatabaseException
virtual ~RpmNullDatabaseException()
Definition: RpmException.h:235
zypp::target::rpm::RpmDbNotOpenException::RpmDbNotOpenException
RpmDbNotOpenException()
Definition: RpmException.h:206
zypp::target::rpm::RpmInitException::RpmInitException
RpmInitException(const Pathname &root_r, const Pathname &dbpath_r)
Definition: RpmException.h:146
zypp::target::rpm::RpmInvalidRootException
Definition: RpmException.h:72
zypp::target::rpm::RpmInitException::_root
std::string _root
Definition: RpmException.h:157
zypp::target::rpm::RpmException::RpmException
RpmException(const std::string &msg_r)
Ctor taking message.
Definition: RpmException.h:49
zypp::target::rpm::RpmInvalidRootException::dumpOn
virtual std::ostream & dumpOn(std::ostream &str) const
Overload this to print a proper error message.
Definition: RpmException.cc:28
zypp::target::rpm::RpmInvalidRootException::_root
std::string _root
Definition: RpmException.h:98
zypp::target::rpm::RpmAccessBlockedException::RpmAccessBlockedException
RpmAccessBlockedException(const Pathname &root_r, const Pathname &dbpath_r)
Definition: RpmException.h:105
zypp::target::rpm::RpmDbConvertException::dumpOn
virtual std::ostream & dumpOn(std::ostream &str) const
Overload this to print a proper error message.
Definition: RpmException.cc:68
zypp::target::rpm::RpmDbOpenException
Definition: RpmException.h:161
zypp::target::rpm::RpmInvalidRootException::~RpmInvalidRootException
virtual ~RpmInvalidRootException()
Dtor.
Definition: RpmException.h:85
zypp::target::rpm::RpmNullDatabaseException::RpmNullDatabaseException
RpmNullDatabaseException()
Definition: RpmException.h:232
zypp::target::rpm::RpmInvalidRootException::_dbpath
std::string _dbpath
Definition: RpmException.h:99
zypp::target::rpm::RpmException
Just inherits Exception to separate media exceptions.
Definition: RpmException.h:37
zypp
Easy-to use interface to the ZYPP dependency resolver.
Definition: CodePitfalls.doc:1
zypp::target::rpm::RpmInitException::_dbpath
std::string _dbpath
Definition: RpmException.h:158
zypp::target::rpm::RpmException::~RpmException
virtual ~RpmException()
Dtor.
Definition: RpmException.h:53
zypp::target::rpm::RpmAccessBlockedException::_dbpath
std::string _dbpath
Definition: RpmException.h:125
zypp::target::rpm::RpmInvalidRootException::RpmInvalidRootException
RpmInvalidRootException(const Pathname &root_r, const Pathname &dbpath_r)
Ctor taking message.
Definition: RpmException.h:78
zypp::target::rpm::RpmSubprocessException::dumpOn
virtual std::ostream & dumpOn(std::ostream &str) const
Overload this to print a proper error message.
Definition: RpmException.cc:40
zypp::target::rpm::GlobalRpmInitException
Definition: RpmException.h:57
zypp::target::rpm::RpmDbConvertException::~RpmDbConvertException
virtual ~RpmDbConvertException()
Definition: RpmException.h:222
zypp::target::rpm::RpmInvalidRootException::dbpath
std::string dbpath() const
Definition: RpmException.h:91
zypp::target::rpm::RpmDbAlreadyOpenException::_new_root
std::string _new_root
Definition: RpmException.h:199
zypp::target::rpm::RpmDbOpenException::_dbpath
std::string _dbpath
Definition: RpmException.h:176
zypp::target::rpm::RpmDbAlreadyOpenException::RpmDbAlreadyOpenException
RpmDbAlreadyOpenException(const Pathname &old_root_r, const Pathname &old_dbpath_r, const Pathname &new_root_r, const Pathname &new_dbpath_r)
Definition: RpmException.h:182
zypp::target::rpm::RpmDbNotOpenException::dumpOn
virtual std::ostream & dumpOn(std::ostream &str) const
Overload this to print a proper error message.
Definition: RpmException.cc:63
zypp::target::rpm::RpmException::RpmException
RpmException()
Ctor taking message.
Definition: RpmException.h:43
zypp::target::rpm::RpmDbAlreadyOpenException::_old_root
std::string _old_root
Definition: RpmException.h:197
zypp::filesystem::Pathname
Pathname.
Definition: Pathname.h:44
zypp::target::rpm::RpmAccessBlockedException
Definition: RpmException.h:102
str
String related utilities and Regular expression matching.
zypp::target::rpm::RpmSubprocessException::RpmSubprocessException
RpmSubprocessException(const std::string &errmsg_r)
Definition: RpmException.h:131
zypp::target::rpm::RpmDbAlreadyOpenException::~RpmDbAlreadyOpenException
virtual ~RpmDbAlreadyOpenException()
Definition: RpmException.h:192
zypp::target::rpm::RpmInitException::~RpmInitException
virtual ~RpmInitException()
Definition: RpmException.h:152
zypp::target::rpm::RpmDbOpenException::RpmDbOpenException
RpmDbOpenException(const Pathname &root_r, const Pathname &dbpath_r)
Definition: RpmException.h:164
zypp::target::rpm::RpmDbAlreadyOpenException::_old_dbpath
std::string _old_dbpath
Definition: RpmException.h:198
zypp::target::rpm::RpmDbOpenException::dumpOn
virtual std::ostream & dumpOn(std::ostream &str) const
Overload this to print a proper error message.
Definition: RpmException.cc:51
zypp::target::rpm::RpmDbOpenException::~RpmDbOpenException
virtual ~RpmDbOpenException()
Definition: RpmException.h:170
zypp::target::rpm::RpmDbConvertException::RpmDbConvertException
RpmDbConvertException()
Definition: RpmException.h:219
zypp::target::rpm::RpmDbAlreadyOpenException::_new_dbpath
std::string _new_dbpath
Definition: RpmException.h:200
zypp::target::rpm::RpmDbAlreadyOpenException
Definition: RpmException.h:179
zypp::target::rpm::RpmDbOpenException::_root
std::string _root
Definition: RpmException.h:175