@@ -116,20 +116,20 @@ void Compiler::copyFrom(Compiler *other) {
116
116
disableMemoryLimitCheck = other->getDisableMemoryLimitCheck ();
117
117
}
118
118
119
- void Compiler::read (const QJsonObject &json) {
119
+ int Compiler::read (const QJsonObject &json) {
120
120
121
121
if (json.contains (" compilerType" ) && json[" compilerType" ].isDouble ())
122
122
compilerType = CompilerType (json[" compilerType" ].toInt ());
123
123
124
- READ_JSON_STR ( compilerName)
125
- READ_JSON_STR ( compilerLocation)
126
- READ_JSON_STR ( interpreterLocation)
124
+ READ_JSON (json, compilerName);
125
+ READ_JSON (json, compilerLocation);
126
+ READ_JSON (json, interpreterLocation);
127
127
128
- READ_JSON_STRLIST ( sourceExtensions)
129
- READ_JSON_STRLIST ( bytecodeExtensions)
130
- READ_JSON_STRLIST ( configurationNames)
131
- READ_JSON_STRLIST ( compilerArguments)
132
- READ_JSON_STRLIST ( interpreterArguments)
128
+ READ_JSON (json, sourceExtensions);
129
+ READ_JSON (json, bytecodeExtensions);
130
+ READ_JSON (json, configurationNames);
131
+ READ_JSON (json, compilerArguments);
132
+ READ_JSON (json, interpreterArguments);
133
133
134
134
QStringList _environment;
135
135
if (json.contains (" environment" ) && json[" environment" ].isString ()) {
@@ -143,26 +143,27 @@ void Compiler::read(const QJsonObject &json) {
143
143
environment.insert (variable, value);
144
144
}
145
145
146
- READ_JSON_DOUBLE (timeLimitRatio)
147
- READ_JSON_DOUBLE (memoryLimitRatio)
148
- READ_JSON_BOOL (disableMemoryLimitCheck)
146
+ READ_JSON (json, timeLimitRatio);
147
+ READ_JSON (json, memoryLimitRatio);
148
+ READ_JSON (json, disableMemoryLimitCheck);
149
+ return 0 ;
149
150
}
150
151
151
152
void Compiler::write (QJsonObject &json) const {
152
- WRITE_JSON (compilerType)
153
- WRITE_JSON (compilerName)
154
- WRITE_JSON (compilerLocation)
155
- WRITE_JSON (interpreterLocation)
156
-
157
- WRITE_JSON_STRLIST (sourceExtensions)
158
- WRITE_JSON_STRLIST (bytecodeExtensions)
159
- WRITE_JSON_STRLIST (configurationNames)
160
- WRITE_JSON_STRLIST (compilerArguments)
161
- WRITE_JSON_STRLIST (interpreterArguments)
162
-
163
- WRITE_JSON_STRLIST (environment.toStringList ())
164
-
165
- WRITE_JSON (timeLimitRatio) // double
166
- WRITE_JSON (memoryLimitRatio) // double
167
- WRITE_JSON (disableMemoryLimitCheck) // bool
153
+ WRITE_JSON (json, compilerType)
154
+ WRITE_JSON (json, compilerName)
155
+ WRITE_JSON (json, compilerLocation)
156
+ WRITE_JSON (json, interpreterLocation)
157
+
158
+ WRITE_JSON_STRLIST (json, sourceExtensions)
159
+ WRITE_JSON_STRLIST (json, bytecodeExtensions)
160
+ WRITE_JSON_STRLIST (json, configurationNames)
161
+ WRITE_JSON_STRLIST (json, compilerArguments)
162
+ WRITE_JSON_STRLIST (json, interpreterArguments)
163
+
164
+ WRITE_JSON_STRLIST (json, environment.toStringList ())
165
+
166
+ WRITE_JSON (json, timeLimitRatio) // double
167
+ WRITE_JSON (json, memoryLimitRatio) // double
168
+ WRITE_JSON (json, disableMemoryLimitCheck) // bool
168
169
}
0 commit comments