QtGStreamer  1.2.0
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Pages
error.h
1 /*
2  Copyright (C) 2010 George Kiagiadakis <kiagiadakis.george@gmail.com>
3 
4  This library is free software; you can redistribute it and/or modify
5  it under the terms of the GNU Lesser General Public License as published
6  by the Free Software Foundation; either version 2.1 of the License, or
7  (at your option) any later version.
8 
9  This program is distributed in the hope that it will be useful,
10  but WITHOUT ANY WARRANTY; without even the implied warranty of
11  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  GNU Lesser General Public License for more details.
13 
14  You should have received a copy of the GNU Lesser General Public License
15  along with this program. If not, see <http://www.gnu.org/licenses/>.
16 */
17 #ifndef QGLIB_ERROR_H
18 #define QGLIB_ERROR_H
19 
20 #include "global.h"
21 #include "type.h"
22 #include "quark.h"
23 #include <exception>
24 
25 namespace QGlib {
26 
30 class QTGLIB_EXPORT Error : public std::exception
31 {
32 public:
35  Error(GError *error = NULL);
36 
38  Error(Quark domain, int code, const QString & message);
39 
40  static Error copy(GError *error);
41 
42  Error(const Error & other);
43  Error & operator=(const Error & other);
44  virtual ~Error() throw();
45 
48  virtual const char* what() const throw();
49 
52  Quark domain() const;
53 
55  int code() const;
56 
58  QString message() const;
59 
62  operator GError *();
63 
66  operator const GError *() const;
67 
68 private:
69  GError *m_error;
70 };
71 
73 QTGLIB_EXPORT QDebug operator<<(QDebug dbg, const Error & error);
74 
75 } //namespace QGlib
76 
77 QGLIB_REGISTER_TYPE(QGlib::Error)
78 
79 #endif // QGLIB_ERROR_H
Wrapper class for GQuark.
Definition: quark.h:42
Wrapper class for GError.
Definition: error.h:30