diff options
author | Kitsune Ral <Kitsune-Ral@users.sf.net> | 2018-01-09 10:57:03 +0900 |
---|---|---|
committer | Kitsune Ral <Kitsune-Ral@users.sf.net> | 2018-01-09 11:53:55 +0900 |
commit | 93cb0e5897cc94d8cc691bbe62f5b0093dd0a00f (patch) | |
tree | 6a1f7b82a0bca8034de55bbc3e86cd1b8a4ca211 /jobs | |
parent | dca271aaf0142e2722219df8fcc03bf8fc03c150 (diff) | |
download | libquotient-93cb0e5897cc94d8cc691bbe62f5b0093dd0a00f.tar.gz libquotient-93cb0e5897cc94d8cc691bbe62f5b0093dd0a00f.zip |
Job template: Use QIODevice instead of QByteArray to store byte streams
This allows smooth pipelining of files to and from the network.
Diffstat (limited to 'jobs')
-rw-r--r-- | jobs/gtad.yaml | 17 | ||||
-rw-r--r-- | jobs/{{base}}.cpp.mustache | 2 |
2 files changed, 8 insertions, 11 deletions
diff --git a/jobs/gtad.yaml b/jobs/gtad.yaml index 54f70cdb..f79ce9b6 100644 --- a/jobs/gtad.yaml +++ b/jobs/gtad.yaml @@ -27,12 +27,12 @@ types: - //: double boolean: bool string: - - byte: &QByteArray - type: QByteArray - initializer: '"{{defaultValue}}"' - string?: true - imports: <QtCore/QByteArray> - - binary: *QByteArray + - byte: &ByteStream + type: QIODevice* + #initializer: '"{{defaultValue}}"' + #string?: true + imports: <QtCore/QIODevice> + - binary: *ByteStream - date: type: QDate initializer: QDate::fromString("{{defaultValue}}") @@ -48,10 +48,7 @@ types: initializer: QStringLiteral("{{defaultValue}}") string?: true avoidCopy?: true - imports: <QtCore/QString> - file: - type: QByteArray - imports: <QtCore/QByteArray> + file: *ByteStream object: type: QJsonObject avoidCopy?: true diff --git a/jobs/{{base}}.cpp.mustache b/jobs/{{base}}.cpp.mustache index 0726d523..34e7faf3 100644 --- a/jobs/{{base}}.cpp.mustache +++ b/jobs/{{base}}.cpp.mustache @@ -88,7 +88,7 @@ class {{camelCaseOperationId}}Job::Private BaseJob::Status {{camelCaseOperationId}}Job::parseReply(QNetworkReply* reply) { {{#headers}}d->{{paramName}} = reply->rawHeader("{{baseName}}"); {{! We don't check for required headers yet }} - {{/headers}}{{#properties}}d->{{paramName}} = reply->readAll();{{/properties}} + {{/headers}}{{#properties}}d->{{paramName}} = reply;{{/properties}} return Success; }{{/ producesNotJson?}}{{^producesNotJson?}} BaseJob::Status {{camelCaseOperationId}}Job::parseJson(const QJsonDocument& data) |