summaryrefslogtreecommitdiff
path: root/glib/glibmm/error.cc
diff options
context:
space:
mode:
Diffstat (limited to 'glib/glibmm/error.cc')
-rw-r--r--glib/glibmm/error.cc21
1 files changed, 21 insertions, 0 deletions
diff --git a/glib/glibmm/error.cc b/glib/glibmm/error.cc
index e3afe5bc..68c20e18 100644
--- a/glib/glibmm/error.cc
+++ b/glib/glibmm/error.cc
@@ -78,6 +78,11 @@ Error::~Error() noexcept
g_error_free(gobject_);
}
+Error::operator bool() const
+{
+ return gobject_ != nullptr;
+}
+
GQuark
Error::domain() const
{
@@ -184,4 +189,20 @@ Error::throw_exception(GError* gobject)
throw Glib::Error(gobject);
}
+// Glib::Value<Glib::Error>
+GType Value<Error>::value_type()
+{
+ return g_error_get_type();
+}
+
+void Value<Error>::set(const CppType& data)
+{
+ set_boxed(data.gobj());
+}
+
+Value<Error>::CppType Value<Error>::get() const
+{
+ return Glib::Error(static_cast<CType>(get_boxed()), true);
+}
+
} // namespace Glib