From: Arvin Schnell Date: Wed, 30 Mar 2016 13:14:40 +0000 (+0200) Subject: - added uint64_t support X-Git-Tag: v0.3.3~16^2~5 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=1918309ebef6d419dd2bf5f8b2999c0f339946b5;p=thirdparty%2Fsnapper.git - added uint64_t support --- diff --git a/dbus/DBusMessage.cc b/dbus/DBusMessage.cc index fab984f8..2daf7fb5 100644 --- a/dbus/DBusMessage.cc +++ b/dbus/DBusMessage.cc @@ -1,5 +1,6 @@ /* * Copyright (c) 2012 Novell, Inc. + * Copyright (c) 2016 SUSE LLC * * All Rights Reserved. * @@ -65,6 +66,7 @@ namespace DBus const char* TypeInfo::signature = "u"; + const char* TypeInfo::signature = "t"; const char* TypeInfo::signature = "s"; @@ -251,6 +253,29 @@ namespace DBus } + Hihi& + operator>>(Hihi& hihi, dbus_uint64_t& data) + { + if (hihi.get_type() != DBUS_TYPE_UINT64) + throw MarshallingException(); + + dbus_message_iter_get_basic(hihi.top(), &data); + dbus_message_iter_next(hihi.top()); + + return hihi; + } + + + Hoho& + operator<<(Hoho& hoho, dbus_uint64_t data) + { + if (!dbus_message_iter_append_basic(hoho.top(), DBUS_TYPE_UINT64, &data)) + throw FatalException(); + + return hoho; + } + + Hihi& operator>>(Hihi& hihi, time_t& data) { diff --git a/dbus/DBusMessage.h b/dbus/DBusMessage.h index cb0e319d..09190d05 100644 --- a/dbus/DBusMessage.h +++ b/dbus/DBusMessage.h @@ -1,5 +1,6 @@ /* * Copyright (c) 2012 Novell, Inc. + * Copyright (c) 2016 SUSE LLC * * All Rights Reserved. * @@ -164,6 +165,7 @@ namespace DBus template struct TypeInfo {}; template <> struct TypeInfo { static const char* signature; }; + template <> struct TypeInfo { static const char* signature; }; template <> struct TypeInfo { static const char* signature; }; @@ -231,6 +233,9 @@ namespace DBus Hihi& operator>>(Hihi& hihi, dbus_uint32_t& data); Hoho& operator<<(Hoho& hoho, dbus_uint32_t data); + Hihi& operator>>(Hihi& hihi, dbus_uint64_t& data); + Hoho& operator<<(Hoho& hoho, dbus_uint64_t data); + Hihi& operator>>(Hihi& hihi, time_t& data); Hoho& operator<<(Hoho& hoho, time_t data);