forked from zhipeng-jia/project-lemon
-
Notifications
You must be signed in to change notification settings - Fork 0
/
task.h
95 lines (81 loc) · 3.27 KB
/
task.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
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
85
86
87
88
89
90
91
92
93
94
95
/***************************************************************************
This file is part of Project Lemon
Copyright (C) 2011 Zhipeng Jia
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
***************************************************************************/
#ifndef TASK_H
#define TASK_H
#include <QtCore>
#include <QObject>
class TestCase;
class Settings;
class Task : public QObject
{
Q_OBJECT
public:
enum TaskType { Traditional, AnswersOnly };
enum ComparisonMode { LineByLineMode, IgnoreSpacesMode, ExternalToolMode, RealNumberMode, SpecialJudgeMode };
explicit Task(QObject *parent = 0);
const QList<TestCase*>& getTestCaseList() const;
const QString& getProblemTile() const;
const QString& getSourceFileName() const;
const QString& getInputFileName() const;
const QString& getOutputFileName() const;
bool getStandardInputCheck() const;
bool getStandardOutputCheck() const;
TaskType getTaskType() const;
ComparisonMode getComparisonMode() const;
const QString& getDiffArguments() const;
int getRealPrecision() const;
const QString& getSpecialJudge() const;
QString getCompilerConfiguration(const QString&) const;
const QString& getAnswerFileExtension() const;
void setProblemTitle(const QString&);
void setSourceFileName(const QString&);
void setInputFileName(const QString&);
void setOutputFileName(const QString&);
void setStandardInputCheck(bool);
void setStandardOutputCheck(bool);
void setTaskType(TaskType);
void setComparisonMode(ComparisonMode);
void setDiffArguments(const QString&);
void setRealPrecision(int);
void setSpecialJudge(const QString&);
void setCompilerConfiguration(const QString&, const QString&);
void setAnswerFileExtension(const QString&);
void addTestCase(TestCase*);
TestCase* getTestCase(int) const;
void deleteTestCase(int);
void refreshCompilerConfiguration(Settings*);
int getTotalTimeLimit() const;
void writeToStream(QDataStream&);
void readFromStream(QDataStream&);
private:
QList<TestCase*> testCaseList;
QString problemTitle;
QString sourceFileName;
QString inputFileName;
QString outputFileName;
bool standardInputCheck;
bool standardOutputCheck;
TaskType taskType;
ComparisonMode comparisonMode;
QString diffArguments;
int realPrecision;
QString specialJudge;
QMap<QString, QString> compilerConfiguration;
QString answerFileExtension;
signals:
void problemTitleChanged(const QString&);
void compilerConfigurationRefreshed();
};
#endif // TASK_H