00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #ifndef QGLIB_ERROR_H
00018 #define QGLIB_ERROR_H
00019
00020 #include "global.h"
00021 #include "quark.h"
00022 #include <exception>
00023
00024 namespace QGlib {
00025
00029 class QTGLIB_EXPORT Error : public std::exception
00030 {
00031 public:
00034 Error(GError *error);
00035
00037 Error(Quark domain, int code, const QString & message);
00038
00039 Error(const Error & other);
00040 Error & operator=(const Error & other);
00041 virtual ~Error() throw();
00042
00045 virtual const char* what() const throw();
00046
00049 Quark domain() const;
00050
00052 int code() const;
00053
00055 QString message() const;
00056
00059 operator GError *();
00060
00063 operator const GError *() const;
00064
00065 private:
00066 GError *m_error;
00067 };
00068
00070 QTGLIB_EXPORT QDebug operator<<(QDebug dbg, const Error & error);
00071
00072 }
00073
00074 #endif // QGLIB_ERROR_H