mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-31 04:25:35 +08:00
Ref T552 Using QDataStream marshalling mixins in value classes.
This commit is contained in:
@@ -53,6 +53,7 @@ namespace BlackMisc
|
||||
public Mixin::EqualsByCompare<CStrongStringView>,
|
||||
public Mixin::LessThanByCompare<CStrongStringView>,
|
||||
public Mixin::DBusOperators<CStrongStringView>,
|
||||
public Mixin::DataStreamOperators<CStrongStringView>,
|
||||
public Mixin::JsonOperators<CStrongStringView>,
|
||||
public Mixin::String<CStrongStringView>
|
||||
{
|
||||
@@ -110,6 +111,12 @@ namespace BlackMisc
|
||||
void unmarshallFromDbus(const QDBusArgument &arg) { arg >> m_string; m_view = m_string; }
|
||||
//! @}
|
||||
|
||||
//! QDataStream marshalling.
|
||||
//! @{
|
||||
void marshalToDataStream(QDataStream &stream) const { stream << toQString(); }
|
||||
void unmarshalFromDataStream(QDataStream &stream) { stream >> m_string; m_view = m_string; }
|
||||
//! @}
|
||||
|
||||
//! JSON conversion.
|
||||
//! @{
|
||||
QJsonObject toJson() const { QJsonObject json; json.insert(QStringLiteral("value"), toQString()); return json; }
|
||||
|
||||
Reference in New Issue
Block a user