-
Notifications
You must be signed in to change notification settings - Fork 0
/
LanguageModule.h
74 lines (53 loc) · 1.77 KB
/
LanguageModule.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
#pragma once
#ifndef _SCRIPT_PAD_LANGUAGE_MODULE_H
#define _SCRIPT_PAD_LANGUAGE_MODULE_H
#include "../resource.h"
#include "ILanguage.h"
#include "BaseModule.h"
namespace querier {
enum LanguageType {
Interpreter,
Compiler
};
NLOHMANN_JSON_SERIALIZE_ENUM(LanguageType, {
{ Interpreter, "interpreter" },
{ Compiler, "compiler" }
});
struct LanguageFilePaths {
LanguageFilePaths(std::string, std::string, std::string);
LanguageFilePaths(std::wstring, std::wstring, std::wstring);
std::string MainModule;
std::wstring wMainModule;
std::string SourceFile;
std::wstring wSourceFile;
std::string ExecutableFile;
std::wstring wExecutableFile;
};
class __declspec(dllexport) LanguageModule : public ILanguage, public BaseModule {
public:
LanguageModule(std::wstring, std::wstring, bool);
LanguageModule(std::string, std::string, bool);
virtual ~LanguageModule();
virtual void Initialize() = 0;
virtual void Invoke(std::string);
bool GetFileContent(std::string*);
bool wGetFileContent(std::wstring*);
void SetFileContent(std::string);
void wSetFileContent(std::wstring);
std::string GetSourceFile();
std::wstring wGetSourceFile();
void SetSourceFile(std::string);
void wSetSourceFile(std::wstring);
std::string GetModuleVersion();
std::wstring wGetModuleVersion();
bool IsUnicode() {
return m_isUnicode;
}
protected:
LanguageType m_LanguageType{ Interpreter };
private:
LanguageFilePaths m_LanguageFilePaths;
File m_File;
};
} //namespace scriptpad
#endif //_SCRIPT_PAD_LANGUAGE_MODULE_H