feat: add support for string_view as D-Bus type

This commit is contained in:
Stanislav Angelovič
2024-04-24 20:20:29 +02:00
parent d856969051
commit f15c260750
5 changed files with 39 additions and 3 deletions
+1
View File
@@ -100,6 +100,7 @@ namespace sdbus {
Message& operator<<(double item);
Message& operator<<(const char *item);
Message& operator<<(const std::string &item);
Message& operator<<(std::string_view item);
Message& operator<<(const Variant &item);
template <typename ...Elements>
Message& operator<<(const std::variant<Elements...>& value);
+5
View File
@@ -41,6 +41,7 @@
# endif
#endif
#include <string>
#include <string_view>
#include <tuple>
#include <type_traits>
#include <unordered_map>
@@ -231,6 +232,10 @@ namespace sdbus {
static constexpr bool is_trivial_dbus_type = false;
};
template <>
struct signature_of<std::string_view> : signature_of<std::string>
{};
template <>
struct signature_of<char*> : signature_of<std::string>
{};