Simplify creation of a Javascript shell.
This commit is contained in:
parent
57980975a0
commit
058a27bf32
4 changed files with 53 additions and 70 deletions
|
|
@ -18,10 +18,12 @@ public:
|
|||
|
||||
JSShell() {}
|
||||
|
||||
virtual ~JSShell();
|
||||
|
||||
virtual ~JSShell() = 0;
|
||||
|
||||
static JSShell* Create();
|
||||
|
||||
bool ImportModule(const std::string& name);
|
||||
|
||||
|
||||
virtual bool RunScript(const std::string& scriptPath);
|
||||
|
||||
virtual bool RunShell();
|
||||
|
|
@ -31,7 +33,7 @@ protected:
|
|||
virtual bool RegisterModule(HANDLE library, const std::string& module_name) = 0;
|
||||
|
||||
virtual bool InitializeEngine() = 0;
|
||||
|
||||
|
||||
virtual bool ExecuteScript(const std::string& source, const std::string& name) = 0;
|
||||
|
||||
virtual bool DisposeEngine() = 0;
|
||||
|
|
@ -39,7 +41,7 @@ protected:
|
|||
static std::string ReadFile(const std::string& fileName);
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
std::vector<HANDLE> loaded_modules;
|
||||
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue