QtGStreamer  0.10.2
 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 "quark.h"
22 #include <exception>
23 
24 namespace QGlib {
25 
29 class QTGLIB_EXPORT Error : public std::exception
30 {
31 public:
34  Error(GError *error);
35 
37  Error(Quark domain, int code, const QString & message);
38 
39  Error(const Error & other);
40  Error & operator=(const Error & other);
41  virtual ~Error() throw();
42 
45  virtual const char* what() const throw();
46 
49  Quark domain() const;
50 
52  int code() const;
53 
55  QString message() const;
56 
59  operator GError *();
60 
63  operator const GError *() const;
64 
65 private:
66  GError *m_error;
67 };
68 
70 QTGLIB_EXPORT QDebug operator<<(QDebug dbg, const Error & error);
71 
72 } //namespace QGlib
73 
74 #endif // QGLIB_ERROR_H