6 #ifndef SWIFT_MISC_DBUS_H
7 #define SWIFT_MISC_DBUS_H
10 #include <type_traits>
12 #include <QDBusArgument>
18 QDBusArgument &
operator<<(QDBusArgument &arg,
const std::string &s);
23 const QDBusArgument &
operator>>(
const QDBusArgument &arg, std::string &s);
29 template <
class E, std::enable_if_t<std::is_enum_v<E>,
int> = 0>
30 QDBusArgument &
operator<<(QDBusArgument &arg,
const E &value)
33 arg << static_cast<int>(value);
41 template <
class E, std::enable_if_t<std::is_enum_v<E>,
int> = 0>
42 const QDBusArgument &
operator>>(
const QDBusArgument &arg, E &value)
48 value =
static_cast<E
>(temp);
56 QDBusArgument &
operator<<(QDBusArgument &arg,
const QFlags<T> &value)
59 arg << static_cast<typename QFlags<T>::Int>(value);
68 const QDBusArgument &
operator>>(
const QDBusArgument &arg, QFlags<T> &value)
70 typename QFlags<T>::Int temp = 0;
74 value =
static_cast<QFlags<T>
>(temp);
QDBusArgument & operator<<(QDBusArgument &arg, const std::string &s)
Non member non-friend streaming for std::string.
const QDBusArgument & operator>>(const QDBusArgument &arg, std::string &s)
Operator for std::string from QDBusArgument.