summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMax Kellermann <max@musicpd.org>2020-07-23 16:21:13 +0200
committerMax Kellermann <max@musicpd.org>2020-07-23 16:26:18 +0200
commit5e1a2e2a93cb8501c4990b38bc7b2f4b5e86ac70 (patch)
tree89f30598d58934ebb300c737b0c9a6488bae2bc5 /src
parent7376f31c9701b9ed35f7147029cbc61af8a66884 (diff)
lib/dbus/Values: add `uint32_t` and `uint64_t` support
Diffstat (limited to 'src')
-rw-r--r--src/lib/dbus/AppendIter.hxx4
-rw-r--r--src/lib/dbus/Types.hxx4
-rw-r--r--src/lib/dbus/Values.hxx3
3 files changed, 11 insertions, 0 deletions
diff --git a/src/lib/dbus/AppendIter.hxx b/src/lib/dbus/AppendIter.hxx
index a6bdc595f..183f24537 100644
--- a/src/lib/dbus/AppendIter.hxx
+++ b/src/lib/dbus/AppendIter.hxx
@@ -74,6 +74,10 @@ public:
return AppendBasic(DBUS_TYPE_UINT32, &value);
}
+ AppendMessageIter &Append(const uint64_t &value) {
+ return AppendBasic(DBUS_TYPE_UINT64, &value);
+ }
+
AppendMessageIter &AppendFixedArray(int element_type,
const void *value,
int n_elements) {
diff --git a/src/lib/dbus/Types.hxx b/src/lib/dbus/Types.hxx
index b5ddd9241..72b3d5682 100644
--- a/src/lib/dbus/Types.hxx
+++ b/src/lib/dbus/Types.hxx
@@ -62,6 +62,10 @@ template<>
struct TypeTraits<dbus_uint32_t> : BasicTypeTraits<DBUS_TYPE_UINT32> {
};
+template<>
+struct TypeTraits<dbus_uint64_t> : BasicTypeTraits<DBUS_TYPE_UINT64> {
+};
+
using BooleanTypeTraits = BasicTypeTraits<DBUS_TYPE_BOOLEAN>;
template<typename T>
diff --git a/src/lib/dbus/Values.hxx b/src/lib/dbus/Values.hxx
index 45223cc22..5511400f5 100644
--- a/src/lib/dbus/Values.hxx
+++ b/src/lib/dbus/Values.hxx
@@ -64,6 +64,9 @@ struct Boolean {
:value(_value) {}
};
+using Uint32 = BasicValue<dbus_uint32_t>;
+using Uint64 = BasicValue<dbus_uint64_t>;
+
template<typename T, template<typename U> class WrapTraits>
struct WrapValue {
typedef typename T::Traits ContainedTraits;