|
6 | 6 | */ |
7 | 7 |
|
8 | 8 | #include "LemonConfig.hpp" |
| 9 | +// |
| 10 | +#include "base/LemonUtils.hpp" |
| 11 | +#include "base/compiler.h" |
| 12 | + |
| 13 | +namespace Lemon::base::config |
| 14 | +{ |
| 15 | + |
| 16 | + void LemonConfigJudge::read(const QJsonObject &json) |
| 17 | + { |
| 18 | + READ_JSON_INT(defaultFullScore) |
| 19 | + READ_JSON_INT(defaultTimeLimit) |
| 20 | + READ_JSON_INT(defaultMemoryLimit) |
| 21 | + READ_JSON_INT(compileTimeLimit) |
| 22 | + READ_JSON_INT(specialJudgeTimeLimit) |
| 23 | + READ_JSON_INT(fileSizeLimit) |
| 24 | + READ_JSON_INT(rejudgeTimes) |
| 25 | + |
| 26 | + READ_JSON_STR(defaultInputFileExtension) |
| 27 | + READ_JSON_STR(defaultOutputFileExtension) |
| 28 | + READ_JSON_STR(diffPath) |
| 29 | + |
| 30 | + READ_JSON_STRLIST(inputFileExtensions) |
| 31 | + READ_JSON_STRLIST(outputFileExtensions) |
| 32 | + READ_JSON_STRLIST(recentContest) |
| 33 | + |
| 34 | + // CompilerList |
| 35 | + if (json.contains("compilerList") && json["compilerList"].isArray()) { |
| 36 | + QJsonArray _compilerList = json["compilerList"].toArray(); |
| 37 | + compilerList.clear(); |
| 38 | + compilerList.reserve(_compilerList.size()); |
| 39 | + for (int compilerIndex = 0; compilerIndex < _compilerList.size(); ++compilerIndex) { |
| 40 | + QJsonObject compilerObject = _compilerList[compilerIndex].toObject(); |
| 41 | + Compiler *compiler = new Compiler(); |
| 42 | + compiler->read(compilerObject); |
| 43 | + compilerList.append(compiler); |
| 44 | + } |
| 45 | + } |
| 46 | + } |
| 47 | + |
| 48 | + void LemonConfigJudge::write(QJsonObject &json) const { |
| 49 | + |
| 50 | + } |
| 51 | + |
| 52 | +} // namespace Lemon::base::config |
0 commit comments