00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025 #ifndef __DBUSXX_INTERNALERROR_H
00026 #define __DBUSXX_INTERNALERROR_H
00027
00028 #ifdef HAVE_CONFIG_H
00029 #include <config.h>
00030 #endif
00031
00032 #include <dbus-c++/error.h>
00033
00034 #include <dbus/dbus.h>
00035
00036 namespace DBus {
00037
00038 struct DXXAPI InternalError
00039 {
00040 DBusError error;
00041
00042 InternalError()
00043 {
00044 dbus_error_init(&error);
00045 }
00046
00047 explicit InternalError(DBusError *e)
00048 {
00049 dbus_error_init(&error);
00050 dbus_move_error(e, &error);
00051 }
00052
00053 InternalError(const InternalError &ie)
00054 {
00055 dbus_error_init(&error);
00056 dbus_move_error(const_cast<DBusError *>(&(ie.error)), &error);
00057 }
00058
00059 ~InternalError()
00060 {
00061 dbus_error_free(&error);
00062 }
00063
00064 operator DBusError *()
00065 {
00066 return &error;
00067 }
00068
00069 operator bool()
00070 {
00071 return dbus_error_is_set(&error);
00072 }
00073 };
00074
00075 }
00076
00077 #endif//__DBUSXX_INTERNALERROR_H