message-append: support obj-path and signature

Change-Id: I44d5195eba14c17f38cf2bf2b09eb071d54f59d8
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
diff --git a/sdbusplus/message/append.hpp b/sdbusplus/message/append.hpp
index 31038a3..c91ef08 100644
--- a/sdbusplus/message/append.hpp
+++ b/sdbusplus/message/append.hpp
@@ -47,6 +47,10 @@
 template<typename T> struct can_append_multiple : std::true_type {};
     // std::string needs a c_str() call.
 template<> struct can_append_multiple<std::string> : std::false_type {};
+    // object_path needs a c_str() call.
+template<> struct can_append_multiple<object_path> : std::false_type {};
+    // signature needs a c_str() call.
+template<> struct can_append_multiple<signature> : std::false_type {};
     // bool needs to be resized to int, per sdbus documentation.
 template<> struct can_append_multiple<bool> : std::false_type {};
     // std::vector needs a loop.
@@ -121,6 +125,18 @@
     }
 };
 
+/** @brief Specialization of append_single for details::string_wrapper. */
+template <typename T> struct append_single<details::string_wrapper<T>>
+{
+    template<typename S>
+    static void op(sd_bus_message* m, S&& s)
+    {
+        constexpr auto dbusType = std::get<0>(types::type_id<S>());
+        sd_bus_message_append_basic(m, dbusType, s.str.c_str());
+    }
+};
+
+
 /** @brief Specialization of append_single for bool. */
 template <> struct append_single<bool>
 {
diff --git a/test/message/append.cpp b/test/message/append.cpp
index 61dcb29..d73a386 100644
--- a/test/message/append.cpp
+++ b/test/message/append.cpp
@@ -223,6 +223,33 @@
         b.call_noreply(m);
     }
 
+    // Test object_path and signature.
+    {
+        auto m = newMethodCall__test(b);
+        auto o = sdbusplus::message::object_path("/asdf");
+        auto s = sdbusplus::message::signature("iii");
+        m.append(1, o, s, 4);
+        verifyTypeString = "iogi";
+
+        struct verify
+        {
+            static void op(sd_bus_message* m)
+            {
+                int32_t a = 0, b = 0;
+                const char *s0 = nullptr, *s1 = nullptr;
+                sd_bus_message_read(m, "iogi", &a, &s0, &s1, &b);
+                assert(a == 1);
+                assert(b == 4);
+                assert(0 == strcmp("/asdf", s0));
+                assert(0 == strcmp("iii", s1));
+
+            }
+        };
+        verifyCallback = &verify::op;
+
+        b.call_noreply(m);
+    }
+
     // Test vector.
     {
         auto m = newMethodCall__test(b);