forked from shashankkumar/CodeRunner
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathFileHandle.h
executable file
·49 lines (46 loc) · 1.15 KB
/
FileHandle.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
#ifndef FILEHANDLE_H
#define FILEHANDLE_H
#include "includeh.h"
#include "CurlWrapper.h"
#include "FileInfo.h"
class FileHandle{
private:
int FileId, MemoryUsed, NoOfTestCases, TestCaseId, TimeLimit, MemoryLimit;
float TimeUsed;
char systemString[100];
char status[10], logs[10000], detailstatus[10000];
char str[100], *token, tmp[10];
char logString[100];
char TestCaseExecutionTime[10], TestCaseExecutionMemory[10];
char FileDirAddr[100], FileAddr[100], FileName[10], FullFileAddr[100], timeused[10], memoryused[10], fileid[10];
char command[1000];
const char* lang, *ProblemId;
string CompileOutput;
CurlWrapper FileCurl;
string ExecutionStr;
bool result;
FileInfoStruct* FileInfo;
public:
FileHandle(FileInfoStruct* FileInfo);
~FileHandle();
int FetchFile();
int CheckMIME();
int MakeDir();
void Compile();
void pipeCompile();
int pipeNoOfTestCases();
int PrepareToExecute();
void PipeExecute();
void Execute();
void MatchOutput();
void pipeMatch();
void SendResults();
void CleanUp();
static bool Clean;
static bool SendResultsVar;
static bool DownloadSourceFile;
bool getResult();
void FileOperations();
void Action();
};
#endif