From 32729d9a7519cd2c4cddb0174b8329c6fd4a4a83 Mon Sep 17 00:00:00 2001 From: Kitsune Ral Date: Sun, 7 Jun 2020 19:46:40 +0200 Subject: Update generated files according to gtad/* changes --- lib/application-service/definitions/location.cpp | 23 --------- lib/application-service/definitions/location.h | 18 +++++--- lib/application-service/definitions/protocol.cpp | 59 ------------------------ lib/application-service/definitions/protocol.h | 53 +++++++++++++++------ lib/application-service/definitions/user.cpp | 23 --------- lib/application-service/definitions/user.h | 18 +++++--- 6 files changed, 64 insertions(+), 130 deletions(-) delete mode 100644 lib/application-service/definitions/location.cpp delete mode 100644 lib/application-service/definitions/protocol.cpp delete mode 100644 lib/application-service/definitions/user.cpp (limited to 'lib/application-service/definitions') diff --git a/lib/application-service/definitions/location.cpp b/lib/application-service/definitions/location.cpp deleted file mode 100644 index 0a054029..00000000 --- a/lib/application-service/definitions/location.cpp +++ /dev/null @@ -1,23 +0,0 @@ -/****************************************************************************** - * THIS FILE IS GENERATED - ANY EDITS WILL BE OVERWRITTEN - */ - -#include "location.h" - -using namespace Quotient; - -void JsonObjectConverter::dumpTo( - QJsonObject& jo, const ThirdPartyLocation& pod) -{ - addParam<>(jo, QStringLiteral("alias"), pod.alias); - addParam<>(jo, QStringLiteral("protocol"), pod.protocol); - addParam<>(jo, QStringLiteral("fields"), pod.fields); -} - -void JsonObjectConverter::fillFrom(const QJsonObject& jo, - ThirdPartyLocation& result) -{ - fromJson(jo.value("alias"_ls), result.alias); - fromJson(jo.value("protocol"_ls), result.protocol); - fromJson(jo.value("fields"_ls), result.fields); -} diff --git a/lib/application-service/definitions/location.h b/lib/application-service/definitions/location.h index e4c2d096..6801c99f 100644 --- a/lib/application-service/definitions/location.h +++ b/lib/application-service/definitions/location.h @@ -6,12 +6,8 @@ #include "converters.h" -#include - namespace Quotient { -// Data structures - struct ThirdPartyLocation { /// An alias for a matrix room. QString alias; @@ -25,8 +21,18 @@ struct ThirdPartyLocation { template <> struct JsonObjectConverter { - static void dumpTo(QJsonObject& jo, const ThirdPartyLocation& pod); - static void fillFrom(const QJsonObject& jo, ThirdPartyLocation& pod); + static void dumpTo(QJsonObject& jo, const ThirdPartyLocation& pod) + { + addParam<>(jo, QStringLiteral("alias"), pod.alias); + addParam<>(jo, QStringLiteral("protocol"), pod.protocol); + addParam<>(jo, QStringLiteral("fields"), pod.fields); + } + static void fillFrom(const QJsonObject& jo, ThirdPartyLocation& pod) + { + fromJson(jo.value("alias"_ls), pod.alias); + fromJson(jo.value("protocol"_ls), pod.protocol); + fromJson(jo.value("fields"_ls), pod.fields); + } }; } // namespace Quotient diff --git a/lib/application-service/definitions/protocol.cpp b/lib/application-service/definitions/protocol.cpp deleted file mode 100644 index 8c66aa4d..00000000 --- a/lib/application-service/definitions/protocol.cpp +++ /dev/null @@ -1,59 +0,0 @@ -/****************************************************************************** - * THIS FILE IS GENERATED - ANY EDITS WILL BE OVERWRITTEN - */ - -#include "protocol.h" - -using namespace Quotient; - -void JsonObjectConverter::dumpTo(QJsonObject& jo, - const FieldType& pod) -{ - addParam<>(jo, QStringLiteral("regexp"), pod.regexp); - addParam<>(jo, QStringLiteral("placeholder"), pod.placeholder); -} - -void JsonObjectConverter::fillFrom(const QJsonObject& jo, - FieldType& result) -{ - fromJson(jo.value("regexp"_ls), result.regexp); - fromJson(jo.value("placeholder"_ls), result.placeholder); -} - -void JsonObjectConverter::dumpTo(QJsonObject& jo, - const ProtocolInstance& pod) -{ - addParam<>(jo, QStringLiteral("desc"), pod.desc); - addParam(jo, QStringLiteral("icon"), pod.icon); - addParam<>(jo, QStringLiteral("fields"), pod.fields); - addParam<>(jo, QStringLiteral("network_id"), pod.networkId); -} - -void JsonObjectConverter::fillFrom(const QJsonObject& jo, - ProtocolInstance& result) -{ - fromJson(jo.value("desc"_ls), result.desc); - fromJson(jo.value("icon"_ls), result.icon); - fromJson(jo.value("fields"_ls), result.fields); - fromJson(jo.value("network_id"_ls), result.networkId); -} - -void JsonObjectConverter::dumpTo( - QJsonObject& jo, const ThirdPartyProtocol& pod) -{ - addParam<>(jo, QStringLiteral("user_fields"), pod.userFields); - addParam<>(jo, QStringLiteral("location_fields"), pod.locationFields); - addParam<>(jo, QStringLiteral("icon"), pod.icon); - addParam<>(jo, QStringLiteral("field_types"), pod.fieldTypes); - addParam<>(jo, QStringLiteral("instances"), pod.instances); -} - -void JsonObjectConverter::fillFrom(const QJsonObject& jo, - ThirdPartyProtocol& result) -{ - fromJson(jo.value("user_fields"_ls), result.userFields); - fromJson(jo.value("location_fields"_ls), result.locationFields); - fromJson(jo.value("icon"_ls), result.icon); - fromJson(jo.value("field_types"_ls), result.fieldTypes); - fromJson(jo.value("instances"_ls), result.instances); -} diff --git a/lib/application-service/definitions/protocol.h b/lib/application-service/definitions/protocol.h index ac1e50e2..6aee9c57 100644 --- a/lib/application-service/definitions/protocol.h +++ b/lib/application-service/definitions/protocol.h @@ -6,14 +6,7 @@ #include "converters.h" -#include -#include -#include - namespace Quotient { - -// Data structures - /// Definition of valid values for a field. struct FieldType { /// A regular expression for validation of a field's value. This may be @@ -27,8 +20,16 @@ struct FieldType { template <> struct JsonObjectConverter { - static void dumpTo(QJsonObject& jo, const FieldType& pod); - static void fillFrom(const QJsonObject& jo, FieldType& pod); + static void dumpTo(QJsonObject& jo, const FieldType& pod) + { + addParam<>(jo, QStringLiteral("regexp"), pod.regexp); + addParam<>(jo, QStringLiteral("placeholder"), pod.placeholder); + } + static void fillFrom(const QJsonObject& jo, FieldType& pod) + { + fromJson(jo.value("regexp"_ls), pod.regexp); + fromJson(jo.value("placeholder"_ls), pod.placeholder); + } }; struct ProtocolInstance { @@ -48,8 +49,20 @@ struct ProtocolInstance { template <> struct JsonObjectConverter { - static void dumpTo(QJsonObject& jo, const ProtocolInstance& pod); - static void fillFrom(const QJsonObject& jo, ProtocolInstance& pod); + static void dumpTo(QJsonObject& jo, const ProtocolInstance& pod) + { + addParam<>(jo, QStringLiteral("desc"), pod.desc); + addParam(jo, QStringLiteral("icon"), pod.icon); + addParam<>(jo, QStringLiteral("fields"), pod.fields); + addParam<>(jo, QStringLiteral("network_id"), pod.networkId); + } + static void fillFrom(const QJsonObject& jo, ProtocolInstance& pod) + { + fromJson(jo.value("desc"_ls), pod.desc); + fromJson(jo.value("icon"_ls), pod.icon); + fromJson(jo.value("fields"_ls), pod.fields); + fromJson(jo.value("network_id"_ls), pod.networkId); + } }; struct ThirdPartyProtocol { @@ -84,8 +97,22 @@ struct ThirdPartyProtocol { template <> struct JsonObjectConverter { - static void dumpTo(QJsonObject& jo, const ThirdPartyProtocol& pod); - static void fillFrom(const QJsonObject& jo, ThirdPartyProtocol& pod); + static void dumpTo(QJsonObject& jo, const ThirdPartyProtocol& pod) + { + addParam<>(jo, QStringLiteral("user_fields"), pod.userFields); + addParam<>(jo, QStringLiteral("location_fields"), pod.locationFields); + addParam<>(jo, QStringLiteral("icon"), pod.icon); + addParam<>(jo, QStringLiteral("field_types"), pod.fieldTypes); + addParam<>(jo, QStringLiteral("instances"), pod.instances); + } + static void fillFrom(const QJsonObject& jo, ThirdPartyProtocol& pod) + { + fromJson(jo.value("user_fields"_ls), pod.userFields); + fromJson(jo.value("location_fields"_ls), pod.locationFields); + fromJson(jo.value("icon"_ls), pod.icon); + fromJson(jo.value("field_types"_ls), pod.fieldTypes); + fromJson(jo.value("instances"_ls), pod.instances); + } }; } // namespace Quotient diff --git a/lib/application-service/definitions/user.cpp b/lib/application-service/definitions/user.cpp deleted file mode 100644 index 17d15a20..00000000 --- a/lib/application-service/definitions/user.cpp +++ /dev/null @@ -1,23 +0,0 @@ -/****************************************************************************** - * THIS FILE IS GENERATED - ANY EDITS WILL BE OVERWRITTEN - */ - -#include "user.h" - -using namespace Quotient; - -void JsonObjectConverter::dumpTo(QJsonObject& jo, - const ThirdPartyUser& pod) -{ - addParam<>(jo, QStringLiteral("userid"), pod.userid); - addParam<>(jo, QStringLiteral("protocol"), pod.protocol); - addParam<>(jo, QStringLiteral("fields"), pod.fields); -} - -void JsonObjectConverter::fillFrom(const QJsonObject& jo, - ThirdPartyUser& result) -{ - fromJson(jo.value("userid"_ls), result.userid); - fromJson(jo.value("protocol"_ls), result.protocol); - fromJson(jo.value("fields"_ls), result.fields); -} diff --git a/lib/application-service/definitions/user.h b/lib/application-service/definitions/user.h index 0d1984b6..3342ef80 100644 --- a/lib/application-service/definitions/user.h +++ b/lib/application-service/definitions/user.h @@ -6,12 +6,8 @@ #include "converters.h" -#include - namespace Quotient { -// Data structures - struct ThirdPartyUser { /// A Matrix User ID represting a third party user. QString userid; @@ -25,8 +21,18 @@ struct ThirdPartyUser { template <> struct JsonObjectConverter { - static void dumpTo(QJsonObject& jo, const ThirdPartyUser& pod); - static void fillFrom(const QJsonObject& jo, ThirdPartyUser& pod); + static void dumpTo(QJsonObject& jo, const ThirdPartyUser& pod) + { + addParam<>(jo, QStringLiteral("userid"), pod.userid); + addParam<>(jo, QStringLiteral("protocol"), pod.protocol); + addParam<>(jo, QStringLiteral("fields"), pod.fields); + } + static void fillFrom(const QJsonObject& jo, ThirdPartyUser& pod) + { + fromJson(jo.value("userid"_ls), pod.userid); + fromJson(jo.value("protocol"_ls), pod.protocol); + fromJson(jo.value("fields"_ls), pod.fields); + } }; } // namespace Quotient -- cgit v1.2.3