blob: f79ce9b6c849820f153803c0afb577d831fcd841 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
|
preprocess:
"%CLIENT_RELEASE_LABEL%": r0
"%CLIENT_MAJOR_VERSION%": r0
# FIXME: the below only fixes C++ compilation but not actual work - the code
# will try to reach out for wrong values in JSON payloads
#"signed:": "signedData:"
#"unsigned:": "unsignedData:"
#"default:": "isDefault:"
# Structure:
# swaggerType: <targetTypeSpec>
# OR
# swaggerType:
# - swaggerFormat: <targetTypeSpec>
# - /swaggerFormatRegEx/: <targetTypeSpec>
# - //: <targetTypeSpec> # default, if the format doesn't mach anything above
# WHERE
# targetTypeSpec = targetType OR
# { type: targetType, imports: <filename OR [ filenames... ]>, <other attributes...> }
types:
integer:
- int64: qint64
- int32: qint32
- //: int
number:
- float: float
- //: double
boolean: bool
string:
- byte: &ByteStream
type: QIODevice*
#initializer: '"{{defaultValue}}"'
#string?: true
imports: <QtCore/QIODevice>
- binary: *ByteStream
- date:
type: QDate
initializer: QDate::fromString("{{defaultValue}}")
avoidCopy?: true
imports: <QtCore/QDate>
- dateTime:
type: QDateTime
initializer: QDateTime::fromString("{{defaultValue}}")
avoidCopy?: true
imports: <QtCore/QDateTime>
- //:
type: QString
initializer: QStringLiteral("{{defaultValue}}")
string?: true
avoidCopy?: true
file: *ByteStream
object:
type: QJsonObject
avoidCopy?: true
imports: <QtCore/QJsonObject>
array:
- /.+/:
type: "QVector<{{1}}>"
avoidCopy?: true
imports: <QtCore/QVector>
- //: { type: QJsonArray, "avoidCopy?": true, imports: <QtCore/QJsonArray> }
schema:
avoidCopy?: true
#operations:
env:
_scopeRenderer: "{{scopeCamelCase}}Job::"
_literalQuote: '"'
maybeCrefType: "{{#avoidCopy?}}const {{/avoidCopy?}}{{dataType.name}}{{#avoidCopy?}}&{{/avoidCopy?}}"
qualifiedMaybeCrefType: "{{#avoidCopy?}}const {{/avoidCopy?}}{{dataType.qualifiedName}}{{#avoidCopy?}}&{{/avoidCopy?}}"
initializeDefaultValue: "{{#defaultValue}}{{>initializer}}{{/defaultValue}}{{^defaultValue}}{}{{/defaultValue}}"
paramToString: '{{#string?}}{{nameCamelCase}}{{/string?}}{{^string?}}QString("%1").arg({{nameCamelCase}}){{/string?}}'
# preamble: preamble.mustache
copyrightName: Kitsune Ral
copyrightEmail: <kitsune-ral@users.sf.net>
# imports: { set: }
templates:
- "{{base}}.h.mustache"
- "{{base}}.cpp.mustache"
#outFilesList: apifiles.txt
|