diff options
Diffstat (limited to 'jobs/{{base}}.h.mustache')
-rw-r--r-- | jobs/{{base}}.h.mustache | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/jobs/{{base}}.h.mustache b/jobs/{{base}}.h.mustache new file mode 100644 index 00000000..65c79e24 --- /dev/null +++ b/jobs/{{base}}.h.mustache @@ -0,0 +1,47 @@ +{{#@filePartial}}preamble{{/@filePartial}} + +#pragma once + +{{#operations}}#include "../basejob.h" +{{/operations}} +{{#imports}}#include {{.}} +{{/imports}} +{{#models}}#include "jobs/converters.h" +{{/models}} +namespace QMatrixClient +{ +{{#models}} // Data structures +{{# model}} + struct {{classname}}{{#parents?}} : {{#parents}}{{.}}{{#last?}}, {{/last?}}{{/parents}}{{/parents?}} + { + {{#vars}}{{datatype}} {{name}}; + {{/vars}} + operator QJsonValue() const; + }; + + template <> struct FromJson<{{classname}}> + { + {{classname}} operator()(QJsonValue jv); + }; +{{/ model}} +{{/models}} +{{#operations}} // Operations +{{# operation}} + class {{camelCaseOperationId}}Job : public BaseJob + { + public: + explicit {{camelCaseOperationId}}Job({{#allParams}}{{#avoidCopy?}}const {{dataType}}&{{/avoidCopy?}}{{^avoidCopy?}}{{dataType}}{{/avoidCopy?}} {{paramName}}{{^required?}} = {{defaultValue}}{{^defaultValue}}{}{{/defaultValue}}{{/required?}}{{#hasMore}}, {{/hasMore}}{{/allParams}}); +{{# responses}}{{#normalResponse?}}{{#properties?}} + ~{{camelCaseOperationId}}Job() override; + + {{#properties}}const {{dataType}}& {{paramName}}() const; + {{/properties}} + protected: + {{^returnFile}}Status parseJson(const QJsonDocument& data) override;{{/returnFile}} + {{#returnFile?}}Status parseReply(QByteArray data) override;{{/returnFile?}} + private: + class Private; + Private* d;{{/properties?}}{{/normalResponse?}}{{/responses}} + };{{/operation}} +{{/operations}} +} // namespace QMatrixClient |