QtGStreamer  0.10.2
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator
error.h
00001 /*
00002     Copyright (C) 2010  George Kiagiadakis <kiagiadakis.george@gmail.com>
00003 
00004     This library is free software; you can redistribute it and/or modify
00005     it under the terms of the GNU Lesser General Public License as published
00006     by the Free Software Foundation; either version 2.1 of the License, or
00007     (at your option) any later version.
00008 
00009     This program is distributed in the hope that it will be useful,
00010     but WITHOUT ANY WARRANTY; without even the implied warranty of
00011     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00012     GNU Lesser General Public License for more details.
00013 
00014     You should have received a copy of the GNU Lesser General Public License
00015     along with this program.  If not, see <http://www.gnu.org/licenses/>.
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 } //namespace QGlib
00073 
00074 #endif // QGLIB_ERROR_H