2
#ifndef _GLIBMM_ERROR_H
3
#define _GLIBMM_ERROR_H
6
/* Copyright 2002 The gtkmm Development Team
8
* This library is free software; you can redistribute it and/or
9
* modify it under the terms of the GNU Library General Public
10
* License as published by the Free Software Foundation; either
11
* version 2 of the License, or (at your option) any later version.
13
* This library is distributed in the hope that it will be useful,
14
* but WITHOUT ANY WARRANTY; without even the implied warranty of
15
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16
* Library General Public License for more details.
18
* You should have received a copy of the GNU Library General Public
19
* License along with this library; if not, write to the Free
20
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
23
#ifndef DOXYGEN_SHOULD_SKIP_THIS
24
extern "C" { typedef struct _GError GError; }
27
#include <glib/gquark.h>
28
#include <glibmm/exception.h>
34
class Error : public Glib::Exception
38
Error(GQuark domain, int code, const Glib::ustring& message);
39
explicit Error(GError* gobject, bool take_copy = false);
41
Error(const Error& other);
42
Error& operator=(const Error& other);
44
virtual ~Error() throw();
46
GQuark domain() const;
48
virtual Glib::ustring what() const;
50
bool matches(GQuark domain, int code) const;
53
const GError* gobj() const;
55
#ifndef DOXYGEN_SHOULD_SKIP_THIS
57
void propagate(GError** dest);
59
typedef void (* ThrowFunc) (GError*);
61
static void register_init();
62
static void register_cleanup();
63
static void register_domain(GQuark domain, ThrowFunc throw_func);
65
static void throw_exception(GError* gobject) G_GNUC_NORETURN;
67
#endif /* DOXYGEN_SHOULD_SKIP_THIS */
76
#endif /* _GLIBMM_ERROR_H */