-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjudge.h
48 lines (44 loc) · 1011 Bytes
/
judge.h
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
#ifndef JUDGE_H
#define JUDGE_H
#include <QtCore>
#include <QThread>
#include <QJsonArray>
#include "settings.h"
#include "database.h"
class judgeThread : public QThread
{
Q_OBJECT
public:
explicit judgeThread(QObject *parent = nullptr);
~judgeThread();
void setDatabase(Database *);
void setSettings(Settings *);
void setTask(int);
void setContestantName(const QString&);
void run();
private:
Database *db;
Settings *settings;
int runid;
int problem_id;
QString language;
int timeLimit;
int memoryLimit;
QList<QString> inputFile;
QList<QString> extraTest;
QString compileMessage;
QString systemMessage;
QJsonArray results;
int timeUsed;
int memoryUsed;
int score;
int status;
bool readFile();
bool checkFile();
bool compile();
int compare(const QString &, const QString &, QString &);
void judge();
void judgeExtraTest();
void clearPath(const QString &curDir);
};
#endif // JUDGE_H