message-types: support obj-path and signature
Change-Id: I7cb1563af3375f2a8b22c78ac59f7e69f176933f
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
diff --git a/sdbusplus/message/types.hpp b/sdbusplus/message/types.hpp
index 5200772..4daebf3 100644
--- a/sdbusplus/message/types.hpp
+++ b/sdbusplus/message/types.hpp
@@ -8,6 +8,7 @@
#include <systemd/sd-bus.h>
#include <sdbusplus/utility/type_traits.hpp>
+#include <sdbusplus/message/native_types.hpp>
namespace sdbusplus
{
@@ -141,6 +142,10 @@
template <> struct type_id<const char*> : tuple_type_id<SD_BUS_TYPE_STRING> {};
template <> struct type_id<char*> : tuple_type_id<SD_BUS_TYPE_STRING> {};
template <> struct type_id<std::string> : tuple_type_id<SD_BUS_TYPE_STRING> {};
+template <> struct type_id<object_path> :
+ tuple_type_id<SD_BUS_TYPE_OBJECT_PATH> {};
+template <> struct type_id<signature> :
+ tuple_type_id<SD_BUS_TYPE_SIGNATURE> {};
template <typename T> struct type_id<std::vector<T>>
{
diff --git a/test/message/types.cpp b/test/message/types.cpp
index 4172cb6..8676e25 100644
--- a/test/message/types.cpp
+++ b/test/message/types.cpp
@@ -29,5 +29,12 @@
assert(dbus_string(a, std::move(b), c) == "sss");
}
+
+ // Check object_path and signatures.
+ assert(dbus_string(std::string("asdf"),
+ sdbusplus::message::object_path("/asdf"),
+ sdbusplus::message::signature("sss")) ==
+ "sog");
+
return 0;
}