Loads and runs Lua scripts.
More...
#include <kanzi/lua/lua_instance.hpp>
Loads and runs Lua scripts.
Use the LuaModule to initialize, retrieve, and free the LuaInstance.
- See also
- LuaModule
- Since
- Kanzi 3.9.9
◆ ~LuaInstance()
kanzi::LuaInstance::~LuaInstance |
( |
| ) |
|
◆ run() [1/4]
void kanzi::LuaInstance::run |
( |
string_view | scriptName | ) |
|
Runs a previously loaded Lua script with a matching name.
- Parameters
-
scriptName | Name of the script to be run. If nullopt, runs the latest loaded Lua script. |
◆ run() [2/4]
Runs a previously loaded Lua script with a matching name.
- Parameters
-
scriptName | Name of the script to be run. |
contextNode | The context node attached to the script. |
◆ run() [3/4]
Runs a previously loaded resource loaded as a Lua script.
- Parameters
-
resource | The binary resource that contains the Lua script to run. |
◆ run() [4/4]
Runs a previously loaded resource loaded as a Lua script.
- Parameters
-
resource | The binary resource that contains the Lua script to run. |
contextNode | The context node attached to the script. |
◆ loadScript() [1/2]
bool kanzi::LuaInstance::loadScript |
( |
string_view | scriptName, |
|
|
string_view | code ) |
Loads a Lua script and assigns a name to the script.
When you assign a name that is already in use by another script, the script replaces the previously loaded script.
- Parameters
-
code | Lua script to load. |
scriptName | Name of the script. |
- Returns
- True if the script is loaded.
◆ loadScript() [2/2]
Loads a binary resource as a Lua script.
The script does not load the script if is already loaded. The name of the script is the resource URL.
- Parameters
-
resource | The binary resource that contains the Lua script. |
- Returns
- True if the binary resource is loaded as a Lua script.
◆ LuaModule
◆ LuaInstanceIDProperty
Set to binary resources of scripts that are loaded into the Lua instance.
The documentation for this class was generated from the following file: