My Project
|
NPLScriptingState interface. More...
#include <INPLScriptingState.h>
Public Member Functions | |
virtual void | Release ()=0 |
this is something like delete this | |
virtual void * | GetState ()=0 |
get the Mono Domain state. More... | |
virtual bool | IsValid ()=0 |
return true if the runtime state is valid | |
virtual bool | IsScriptFileLoaded (const std::string &filepath)=0 |
whether a given script file is loaded. More... | |
virtual bool | LoadFile (const std::string &filePath, bool bReload)=0 |
load a new CS script file without running it. More... | |
virtual int | DoString (const char *sCall, int nLength=0)=0 |
do string in the current state. More... | |
virtual NPL::NPLReturnCode | ActivateFile (const std::string &filepath, const char *code=NULL, int nLength=0)=0 |
Activate a local file. More... | |
virtual bool | CreateState (const char *name, INPLRuntimeState *pState=NULL)=0 |
load or restore the runtime state More... | |
virtual void | DestroyState ()=0 |
destroy the runtime state careful with this function, it will make the state invalid. | |
virtual void | SetNPLRuntimeState (INPLRuntimeState *pState)=0 |
set the NPL runtime state that this mono scripting state belongs to. More... | |
virtual INPLRuntimeState * | GetNPLRuntimeState ()=0 |
Get the NPL runtime state that this mono scripting state belongs to. | |
NPLScriptingState interface.
Implement this to support additional languages inside NPLRuntimeState. Please note that we use const std::string& for filename, which means that implementation of this interface should most probably use std::map<std::string filename, file_instance> for keeping loaded files as well. It can save us one std::string copy instruction when these API are called.
|
pure virtual |
Activate a local file.
The file should be loaded already.
filepath | pointer to the file path. |
|
pure virtual |
load or restore the runtime state
name | any runtime state name. |
pState | the NPL runtime state that this mono scripting state belongs to. |
Implemented in CMonoScriptingState, and CMonoScriptingState.
|
pure virtual |
do string in the current state.
This function is usually called from the scripting interface. If one do not want to implement DoString for security reasons. Just put do nothing and return NPL_OK.
sCall | the string to executed. |
nLength | length in bytes.if this is 0, length will be calculated, but must be smaller than a predefined safe length. If this is positive. any string length is allowed. |
Implemented in CMonoScriptingState, and CMonoScriptingState.
|
pure virtual |
get the Mono Domain state.
Implemented in CMonoScriptingState, and CMonoScriptingState.
|
pure virtual |
whether a given script file is loaded.
filePath | the local file path in the following format: [dir0]/[dir1]/[dir2]/[filename.lua] |
|
pure virtual |
load a new CS script file without running it.
If the file is already loaded, it will not be loaded again.
filePath | the local CS script file path, such as "test.dll/test.cs", "test.dll/ParaMono.test.cs", where ParaMono can be a namespace. |
bReload | if true, the file will be reloaded even if it is already loaded. otherwise, the file will only be loaded if it is not loaded yet. |
|
pure virtual |
set the NPL runtime state that this mono scripting state belongs to.
This function is used internally by NPLRuntimeState.
Implemented in CMonoScriptingState, and CMonoScriptingState.