forked from enigma-dev/enigma-dev
-
Notifications
You must be signed in to change notification settings - Fork 0
/
EnigmaCallbacks.hpp
47 lines (39 loc) · 1.16 KB
/
EnigmaCallbacks.hpp
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
#ifndef EMAKE_ENIGMACALLBACKS_HPP
#define EMAKE_ENIGMACALLBACKS_HPP
//This
#include "backend/JavaCallbacks.h"
//Should be:
//#include "backend/EnigmaCallbacks.h"
#include "compiler.pb.h"
#include <fstream>
#include <string>
#include <vector>
#include <mutex>
using ProgressMessage = buffers::ProgressMessage;
using LogMessage = buffers::LogMessage;
class CallBack : public EnigmaCallbacks
{
public:
CallBack();
const ProgressMessage& GetProgress() const;
const LogMessage GetFirstLogMessage(bool &end) const;
const LogMessage GetNextLogMessage(bool &end) const;
void ClearLogMessages();
void ProcessOutput();
private:
static ProgressMessage progressMessage;
static std::vector<LogMessage> logMessages;
static std::vector<LogMessage>::iterator logIt;
static std::mutex logMutex;
static std::ifstream outFile;
static void FrameOpen();
static void AppendFrame(const char*);
static void ClearFrame();
static void SetProgress(int);
static void SetProgressText(const char*);
static void SetOutFile(const char*);
static void ResetRedirect();
static int Execute(const char*, const char**, bool);
static Image* CompressImage(char *, int);
};
#endif