blob: ff131e51bfc9996ce1f126abdbad8c2fe79a33af [file] [log] [blame]
51isoftb54753f2014-01-29 21:22:40 +08001/*
2 * File: Bott.h
3 * Author: 51isoft
4 *
5 * Created on 2014年1月19日, 上午1:04
6 */
7
8#ifndef BOTT_H
9#define BOTT_H
10
11#include "dispatcher.h"
12
13class Bott
14{
15 public:
16 /** Default constructor */
17 Bott();
18 Bott(string filename);
19 /** Default destructor */
20 virtual ~Bott();
51isoftb54753f2014-01-29 21:22:40 +080021 int Gettype() { return type; }
51isoftb54753f2014-01-29 21:22:40 +080022 void Settype(int val) { type = val; }
51isoft2e8fd9d2014-01-30 01:28:36 +080023 string Getrunid() { return runid; }
24 void Setrunid(string val) { runid = val; }
25 string Getcha_id() { return cha_id; }
26 void Setcha_id(string val) { cha_id = val; }
51isoftb54753f2014-01-29 21:22:40 +080027 string Getsrc() { return src; }
51isoftb54753f2014-01-29 21:22:40 +080028 void Setsrc(string val) { src = val; }
51isoft2e8fd9d2014-01-30 01:28:36 +080029 string Getlanguage() { return language; }
30 void Setlanguage(string val) { language = val; }
31 string Getpid() { return pid; }
32 void Setpid(string val) { pid = val; }
33 string Getnumber_of_testcases() { return number_of_testcases; }
34 void Setnumber_of_testcases(string val) { number_of_testcases = val; }
35 string Gettime_limit() { return time_limit; }
36 void Settime_limit(string val) { time_limit = val; }
37 string Getcase_limit() { return case_limit; }
38 void Setcase_limit(string val) { case_limit = val; }
39 string Getmemory_limit() { return memory_limit; }
40 void Setmemory_limit(string val) { memory_limit = val; }
41 string Getspj() { return spj; }
42 void Setspj(string val) { spj = val; }
51isoftb54753f2014-01-29 21:22:40 +080043 string Getvname() { return vname; }
51isoftb54753f2014-01-29 21:22:40 +080044 void Setvname(string val) { vname = val; }
51isoftb54753f2014-01-29 21:22:40 +080045 string Getvid() { return vid; }
51isoftb54753f2014-01-29 21:22:40 +080046 void Setvid(string val) { vid = val; }
51isoft2e8fd9d2014-01-30 01:28:36 +080047 string Getmemory_used() { return memory_used; }
48 void Setmemory_used(string val) { memory_used = val; }
49 string Gettime_used() { return time_used; }
50 void Settime_used(string val) { time_used = val; }
51isoftb54753f2014-01-29 21:22:40 +080051 string Getresult() { return result; }
51isoftb54753f2014-01-29 21:22:40 +080052 void Setresult(string val) { result = val; }
51isoftb54753f2014-01-29 21:22:40 +080053 string Getce_info() { return ce_info; }
51isoftb54753f2014-01-29 21:22:40 +080054 void Setce_info(string val) { ce_info = val; }
51isoft2e8fd9d2014-01-30 01:28:36 +080055 string Getdata_type() { return data_type; }
56 void Setdata_type(string val) { data_type = val; }
51isoftb54753f2014-01-29 21:22:40 +080057 string Getdata_detail() { return data_detail; }
51isoftb54753f2014-01-29 21:22:40 +080058 void Setdata_detail(string val) { data_detail = val; }
51isoft2e8fd9d2014-01-30 01:28:36 +080059 string Getdata_lang() { return data_lang; }
60 void Setdata_lang(string val) { data_lang = val; }
51isoftb54753f2014-01-29 21:22:40 +080061 string Getcha_result() { return cha_result; }
51isoftb54753f2014-01-29 21:22:40 +080062 void Setcha_result(string val) { cha_result = val; }
51isoftb54753f2014-01-29 21:22:40 +080063 string Getcha_detail() { return cha_detail; }
51isoftb54753f2014-01-29 21:22:40 +080064 void Setcha_detail(string val) { cha_detail = val; }
51isoftb54753f2014-01-29 21:22:40 +080065 string Getout_filename() { return out_filename; }
51isoftb54753f2014-01-29 21:22:40 +080066 void Setout_filename(string val) { out_filename= val; }
67 void toFile();
51isoft2e8fd9d2014-01-30 01:28:36 +080068 void save() { toFile(); }
69
70 static const string RAW_FILES_DIRECTORY;
71 static const string CHA_RAW_FILES_DIRECTORY;
72 static const string RESULTS_DIRECTORY;
73 static const string CHA_RESULTS_DIRECTORY;
74 static const string EXTENTION;
75
76 static const string SOURCE_CODE_BEGIN;
77 static const string SOURCE_CODE_END;
78 static const string COMPILE_INFO_BEGIN;
79 static const string COMPILE_INFO_END;
80 static const string DATA_DETAIL_BEGIN;
81 static const string DATA_DETAIL_END;
82 static const string CHALLENGE_DETAIL_BEGIN;
83 static const string CHALLENGE_DETAIL_END;
51isoftb54753f2014-01-29 21:22:40 +080084 protected:
85 private:
51isoft2e8fd9d2014-01-30 01:28:36 +080086 int type;
87 string runid;
88 string cha_id;
89 string src;
90 string language;
91 string pid;
92 string number_of_testcases;
93 string time_limit;
94 string case_limit;
95 string memory_limit;
96 string spj;
97 string vname;
98 string vid;
99 string memory_used;
100 string time_used;
101 string result;
102 string ce_info;
103 string data_type;
104 string data_lang;
105 string data_detail;
106 string cha_result;
107 string cha_detail;
51isoftb54753f2014-01-29 21:22:40 +0800108
51isoft2e8fd9d2014-01-30 01:28:36 +0800109 map <string, string> infos;
51isoftb54753f2014-01-29 21:22:40 +0800110 fstream fin;
111
112 string parseUntil(string end);
51isoftb54753f2014-01-29 21:22:40 +0800113 string out_filename;
114
115};
116
117#endif // BOTT_H
118