From aacc4bcb4a487871daae6717f77605aaba444341 Mon Sep 17 00:00:00 2001 From: Marc Deop Date: Sat, 2 Mar 2019 12:26:57 +0100 Subject: style: apply .clang-format to all .cpp and .h files --- lib/csapi/filter.h | 96 +++++++++++++++++++++++++++--------------------------- 1 file changed, 48 insertions(+), 48 deletions(-) (limited to 'lib/csapi/filter.h') diff --git a/lib/csapi/filter.h b/lib/csapi/filter.h index 0ca7e953..85e05667 100644 --- a/lib/csapi/filter.h +++ b/lib/csapi/filter.h @@ -9,8 +9,7 @@ #include "converters.h" #include "csapi/definitions/sync_filter.h" -namespace QMatrixClient -{ +namespace QMatrixClient { // Operations /// Upload a new filter. @@ -21,65 +20,66 @@ namespace QMatrixClient class DefineFilterJob : public BaseJob { public: - /*! Upload a new filter. - * \param userId - * The id of the user uploading the filter. The access token must be authorized to make requests for this user id. - * \param filter - * Uploads a new filter definition to the homeserver. - * Returns a filter ID that may be used in future requests to - * restrict which events are returned to the client. - */ - explicit DefineFilterJob(const QString& userId, const Filter& filter); - ~DefineFilterJob() override; - - // Result properties - - /// The ID of the filter that was created. Cannot start - /// with a ``{`` as this character is used to determine - /// if the filter provided is inline JSON or a previously - /// declared filter by homeservers on some APIs. - const QString& filterId() const; + /*! Upload a new filter. + * \param userId + * The id of the user uploading the filter. The access token must be + * authorized to make requests for this user id. \param filter Uploads a + * new filter definition to the homeserver. Returns a filter ID that may + * be used in future requests to restrict which events are returned to + * the client. + */ + explicit DefineFilterJob(const QString& userId, const Filter& filter); + ~DefineFilterJob() override; + + // Result properties + + /// The ID of the filter that was created. Cannot start + /// with a ``{`` as this character is used to determine + /// if the filter provided is inline JSON or a previously + /// declared filter by homeservers on some APIs. + const QString& filterId() const; protected: - Status parseJson(const QJsonDocument& data) override; + Status parseJson(const QJsonDocument& data) override; private: - class Private; - QScopedPointer d; + class Private; + QScopedPointer d; }; /// Download a filter class GetFilterJob : public BaseJob { public: - /*! Download a filter - * \param userId - * The user ID to download a filter for. - * \param filterId - * The filter ID to download. - */ - explicit GetFilterJob(const QString& userId, const QString& filterId); - - /*! Construct a URL without creating a full-fledged job object - * - * This function can be used when a URL for - * GetFilterJob is necessary but the job - * itself isn't. - */ - static QUrl makeRequestUrl(QUrl baseUrl, const QString& userId, const QString& filterId); - - ~GetFilterJob() override; - - // Result properties - - /// "The filter defintion" - const Filter& data() const; + /*! Download a filter + * \param userId + * The user ID to download a filter for. + * \param filterId + * The filter ID to download. + */ + explicit GetFilterJob(const QString& userId, const QString& filterId); + + /*! Construct a URL without creating a full-fledged job object + * + * This function can be used when a URL for + * GetFilterJob is necessary but the job + * itself isn't. + */ + static QUrl makeRequestUrl(QUrl baseUrl, const QString& userId, + const QString& filterId); + + ~GetFilterJob() override; + + // Result properties + + /// "The filter defintion" + const Filter& data() const; protected: - Status parseJson(const QJsonDocument& data) override; + Status parseJson(const QJsonDocument& data) override; private: - class Private; - QScopedPointer d; + class Private; + QScopedPointer d; }; } // namespace QMatrixClient -- cgit v1.2.3 From 27ca32a1e5a56e09b9cc1d94224d2831004dcf3d Mon Sep 17 00:00:00 2001 From: Kitsune Ral Date: Sun, 7 Jul 2019 19:32:34 +0900 Subject: Namespace: QMatrixClient -> Quotient (with back comp alias) --- lib/csapi/filter.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib/csapi/filter.h') diff --git a/lib/csapi/filter.h b/lib/csapi/filter.h index 0a5a98ae..5001a492 100644 --- a/lib/csapi/filter.h +++ b/lib/csapi/filter.h @@ -10,7 +10,7 @@ #include "jobs/basejob.h" -namespace QMatrixClient +namespace Quotient { // Operations @@ -88,4 +88,4 @@ private: QScopedPointer d; }; -} // namespace QMatrixClient +} // namespace Quotient -- cgit v1.2.3 From 7036ed0dcb137cb5cbb6b426dd338c5e2e4c6424 Mon Sep 17 00:00:00 2001 From: Kitsune Ral Date: Fri, 17 Apr 2020 07:42:13 +0200 Subject: Regenerate API files using new GTAD and refreshed templates No functional changes. --- lib/csapi/filter.h | 32 +++++++++++++++----------------- 1 file changed, 15 insertions(+), 17 deletions(-) (limited to 'lib/csapi/filter.h') diff --git a/lib/csapi/filter.h b/lib/csapi/filter.h index 5001a492..7a0f8958 100644 --- a/lib/csapi/filter.h +++ b/lib/csapi/filter.h @@ -10,21 +10,20 @@ #include "jobs/basejob.h" -namespace Quotient -{ +namespace Quotient { // Operations -/// Upload a new filter. -/*! +/*! \brief Upload a new filter. + * * Uploads a new filter definition to the homeserver. * Returns a filter ID that may be used in future requests to * restrict which events are returned to the client. */ -class DefineFilterJob : public BaseJob -{ +class DefineFilterJob : public BaseJob { public: - /*! Upload a new filter. + /*! \brief Upload a new filter. + * * \param userId * The id of the user uploading the filter. The access token must be * authorized to make requests for this user id. \param filter Uploads a new @@ -51,12 +50,13 @@ private: QScopedPointer d; }; -/// Download a filter - -class GetFilterJob : public BaseJob -{ +/*! \brief Download a filter + * + */ +class GetFilterJob : public BaseJob { public: - /*! Download a filter + /*! \brief Download a filter + * * \param userId * The user ID to download a filter for. * \param filterId @@ -64,15 +64,13 @@ public: */ explicit GetFilterJob(const QString& userId, const QString& filterId); - /*! Construct a URL without creating a full-fledged job object + /*! \brief Construct a URL without creating a full-fledged job object * - * This function can be used when a URL for - * GetFilterJob is necessary but the job - * itself isn't. + * This function can be used when a URL for GetFilterJob + * is necessary but the job itself isn't. */ static QUrl makeRequestUrl(QUrl baseUrl, const QString& userId, const QString& filterId); - ~GetFilterJob() override; // Result properties -- cgit v1.2.3 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/csapi/filter.h | 35 +++++++++-------------------------- 1 file changed, 9 insertions(+), 26 deletions(-) (limited to 'lib/csapi/filter.h') diff --git a/lib/csapi/filter.h b/lib/csapi/filter.h index 7a0f8958..9aa7dc79 100644 --- a/lib/csapi/filter.h +++ b/lib/csapi/filter.h @@ -4,16 +4,12 @@ #pragma once -#include "converters.h" - #include "csapi/definitions/sync_filter.h" #include "jobs/basejob.h" namespace Quotient { -// Operations - /*! \brief Upload a new filter. * * Uploads a new filter definition to the homeserver. @@ -23,31 +19,24 @@ namespace Quotient { class DefineFilterJob : public BaseJob { public: /*! \brief Upload a new filter. + * * * \param userId * The id of the user uploading the filter. The access token must be - * authorized to make requests for this user id. \param filter Uploads a new - * filter definition to the homeserver. Returns a filter ID that may be used - * in future requests to restrict which events are returned to the client. + * authorized to make requests for this user id. + * + * \param filter + * The filter to upload. */ explicit DefineFilterJob(const QString& userId, const Filter& filter); - ~DefineFilterJob() override; - // Result properties /// The ID of the filter that was created. Cannot start /// with a ``{`` as this character is used to determine /// if the filter provided is inline JSON or a previously /// declared filter by homeservers on some APIs. - const QString& filterId() const; - -protected: - Status parseJson(const QJsonDocument& data) override; - -private: - class Private; - QScopedPointer d; + QString filterId() const { return loadFromJson("filter_id"_ls); } }; /*! \brief Download a filter @@ -56,9 +45,11 @@ private: class GetFilterJob : public BaseJob { public: /*! \brief Download a filter + * * * \param userId * The user ID to download a filter for. + * * \param filterId * The filter ID to download. */ @@ -71,19 +62,11 @@ public: */ static QUrl makeRequestUrl(QUrl baseUrl, const QString& userId, const QString& filterId); - ~GetFilterJob() override; // Result properties /// "The filter defintion" - const Filter& data() const; - -protected: - Status parseJson(const QJsonDocument& data) override; - -private: - class Private; - QScopedPointer d; + Filter data() const { return fromJson(jsonData()); } }; } // namespace Quotient -- cgit v1.2.3 From e17764a1ae81393968dfb747c7b67353c109bc71 Mon Sep 17 00:00:00 2001 From: Kitsune Ral Date: Fri, 19 Jun 2020 15:01:33 +0200 Subject: csapi/: generated using the latest GTAD and matrix-doc For matrix-doc, specifically, it is master (5cb4b086) merged with https://github.com/matrix-org/matrix-doc/pull/2518. --- lib/csapi/filter.h | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'lib/csapi/filter.h') diff --git a/lib/csapi/filter.h b/lib/csapi/filter.h index 9aa7dc79..f07b489c 100644 --- a/lib/csapi/filter.h +++ b/lib/csapi/filter.h @@ -19,7 +19,6 @@ namespace Quotient { class DefineFilterJob : public BaseJob { public: /*! \brief Upload a new filter. - * * * \param userId * The id of the user uploading the filter. The access token must be @@ -45,7 +44,6 @@ public: class GetFilterJob : public BaseJob { public: /*! \brief Download a filter - * * * \param userId * The user ID to download a filter for. @@ -65,8 +63,8 @@ public: // Result properties - /// "The filter defintion" - Filter data() const { return fromJson(jsonData()); } + /// The filter definition. + Filter filter() const { return fromJson(jsonData()); } }; } // namespace Quotient -- cgit v1.2.3