diff options
Diffstat (limited to 'jobs/{{base}}.h.mustache')
-rw-r--r-- | jobs/{{base}}.h.mustache | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/jobs/{{base}}.h.mustache b/jobs/{{base}}.h.mustache new file mode 100644 index 00000000..e19cf03d --- /dev/null +++ b/jobs/{{base}}.h.mustache @@ -0,0 +1,43 @@ +{{#@filePartial}}preamble{{/@filePartial}} + +#pragma once + +{{#operations}}#include "../basejob.h"{{/operations}} +{{#imports}} +#include {{.}} +{{/imports}} +{{#models}}#include <QtCore/QJsonValue>{{/models}}{{! FIXME: This should probably go inside imports }} +namespace QMatrixClient +{ +{{#models}} // Data structures + {{#model}} + struct {{classname}} + { + {{#vars}} + {{datatype}} {{name}}; + {{/vars}} + operator QJsonValue() const { return {}; } + };{{/model}} +{{/models}} +{{#operations}} // Operations + {{#operation}} + class {{#@cap}}{{operationId}}{{/@cap}}Job : public BaseJob + { + public: + {{#@cap}}{{operationId}}{{/@cap}}Job({{#allParams}}{{#avoidCopy?}}const {{dataType}}&{{/avoidCopy?}}{{^avoidCopy?}}{{dataType}}{{/avoidCopy?}} {{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}}); + {{#returns?}} + virtual {{className}}Job(); + + {{#returns}}{{type}} {{name}}() const;{{/returns}} + + protected: + {{#returnFile?}}Status parseReply(QByteArray data) override;{{/returnFile?}} + {{^returnFile}}Status parseJson(const JsonDocument& data) override;{{/returnFile}} + + private: + class Private; + Private* d; + {{/returns?}} + };{{/operation}} +{{/operations}} +} // namespace QMatrixClient |