]> git.ipfire.org Git - thirdparty/snapper.git/commitdiff
- added uint64_t support
authorArvin Schnell <aschnell@suse.de>
Wed, 30 Mar 2016 13:14:40 +0000 (15:14 +0200)
committerArvin Schnell <aschnell@suse.de>
Wed, 30 Mar 2016 13:14:40 +0000 (15:14 +0200)
dbus/DBusMessage.cc
dbus/DBusMessage.h

index fab984f8810e7a8f86f28b46f2925457f7b06c9b..2daf7fb5c86f6cd9f7c585d8b1a74c4210142ed9 100644 (file)
@@ -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<dbus_uint32_t>::signature = "u";
+    const char* TypeInfo<dbus_uint64_t>::signature = "t";
     const char* TypeInfo<string>::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)
     {
index cb0e319d54d0dc5a0655f8a3648b496c63f2dec1..09190d05710e304e428de19b24024e9870fdfb52 100644 (file)
@@ -1,5 +1,6 @@
 /*
  * Copyright (c) 2012 Novell, Inc.
+ * Copyright (c) 2016 SUSE LLC
  *
  * All Rights Reserved.
  *
@@ -164,6 +165,7 @@ namespace DBus
     template <typename Type> struct TypeInfo {};
 
     template <> struct TypeInfo<dbus_uint32_t> { static const char* signature; };
+    template <> struct TypeInfo<dbus_uint64_t> { static const char* signature; };
     template <> struct TypeInfo<string> { 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);