API Documentation
Static Public Member Functions | List of all members
nkAstraeus::nkScriptsWrap::ScriptWrapper Class Referencefinal

Wraps a nkScripts::Script and offers functions for use in scripting. More...

Static Public Member Functions

static void updateEnvironment (nkScripts::Environment *env)
 
static void * constructor (const nkScripts::DataStack &stack)
 
static void destructor (void *toDestroy)
 
static nkScripts::OutputValue getTargetInterpreter (const nkScripts::DataStack &stack)
 
static nkScripts::OutputValue getName (const nkScripts::DataStack &stack)
 
static nkScripts::OutputValue getSources (const nkScripts::DataStack &stack)
 
static nkScripts::OutputValue getLastCompilationResult (const nkScripts::DataStack &stack)
 
static nkScripts::OutputValue setTargetInterpreter (const nkScripts::DataStack &stack)
 
static nkScripts::OutputValue setName (const nkScripts::DataStack &stack)
 
static nkScripts::OutputValue setSources (const nkScripts::DataStack &stack)
 
static nkScripts::OutputValue load (const nkScripts::DataStack &stack)
 
static nkScripts::OutputValue unload (const nkScripts::DataStack &stack)
 
static nkScripts::OutputValue call (const nkScripts::DataStack &stack)
 

Detailed Description

Wraps a nkScripts::Script and offers functions for use in scripting.

Member Function Documentation

◆ updateEnvironment()

static void nkAstraeus::nkScriptsWrap::ScriptWrapper::updateEnvironment ( nkScripts::Environment env)
static

Updates a given environment and set it up to use all functions wrapped by this wrapper.

Parameters
envThe environment to set up.

◆ constructor()

static void* nkAstraeus::nkScriptsWrap::ScriptWrapper::constructor ( const nkScripts::DataStack stack)
static

Wrapper function for the constructor of the user type.

local t = nkScripts.Script.new() ;
Parameters
stackThe parameter stack.
Returns
An output value with the user type and data allocated.

◆ destructor()

static void nkAstraeus::nkScriptsWrap::ScriptWrapper::destructor ( void *  toDestroy)
static

Wrapper function for the destructor of the user type.

Parameters
toDestroyThe data that has to be freed.

◆ getTargetInterpreter()

static nkScripts::OutputValue nkAstraeus::nkScriptsWrap::ScriptWrapper::getTargetInterpreter ( const nkScripts::DataStack stack)
static

Wrapper function for nkScripts::Script::getTargetInterpreter().

local i = s:getTargetInterpreter() ;
Parameters
stackThe parameter stack.
Returns
The attribute value, as a nkScripts::INTERPRETER.

◆ getName()

static nkScripts::OutputValue nkAstraeus::nkScriptsWrap::ScriptWrapper::getName ( const nkScripts::DataStack stack)
static

Wrapper function for nkScripts::Script::getName().

local n = s:getName() ;
Parameters
stackThe parameter stack.
Returns
The attribute value, as a string.

◆ getSources()

static nkScripts::OutputValue nkAstraeus::nkScriptsWrap::ScriptWrapper::getSources ( const nkScripts::DataStack stack)
static

Wrapper function for nkScripts::Script::getSources().

local s = t:getSources() ;
Parameters
stackThe parameter stack.
Returns
The attribute value, as a string.

◆ getLastCompilationResult()

static nkScripts::OutputValue nkAstraeus::nkScriptsWrap::ScriptWrapper::getLastCompilationResult ( const nkScripts::DataStack stack)
static

Wrapper function for nkScripts::Script::getLastCompilationResult().

Parameters
stackThe parameter stack.
Returns
The attribute value, as a nkScripts::CompilationResult.

◆ setTargetInterpreter()

static nkScripts::OutputValue nkAstraeus::nkScriptsWrap::ScriptWrapper::setTargetInterpreter ( const nkScripts::DataStack stack)
static

Wrapper function for nkScripts::Script::setTargetInterpreter().

s:setTargetInterpreter(nkScripts.INTERPRETER.LUA) ;
Parameters
stackThe parameter stack.
Returns
The output value, empty.

◆ setName()

static nkScripts::OutputValue nkAstraeus::nkScriptsWrap::ScriptWrapper::setName ( const nkScripts::DataStack stack)
static

Wrapper function for nkScripts::Script::setName().

s:setName('myScript') ;
Parameters
stackThe parameter stack.
Returns
The output value, empty.

◆ setSources()

static nkScripts::OutputValue nkAstraeus::nkScriptsWrap::ScriptWrapper::setSources ( const nkScripts::DataStack stack)
static

Wrapper function for nkScripts::Script::setSources().

s:setSources('s = 0.5') ;
Parameters
stackThe parameter stack.
Returns
The output value, empty.

◆ load()

static nkScripts::OutputValue nkAstraeus::nkScriptsWrap::ScriptWrapper::load ( const nkScripts::DataStack stack)
static

Wrapper function for nkScripts::Script::load().

local t = s:load() ;
Parameters
stackThe parameter stack.
Returns
The output value, a bool.

◆ unload()

static nkScripts::OutputValue nkAstraeus::nkScriptsWrap::ScriptWrapper::unload ( const nkScripts::DataStack stack)
static

Wrapper function for nkScripts::Script::unload().

s:unload() ;
Parameters
stackThe parameter stack.
Returns
The output value, empty.

◆ call()

static nkScripts::OutputValue nkAstraeus::nkScriptsWrap::ScriptWrapper::call ( const nkScripts::DataStack stack)
static

Utility function to allow to call scripts and execute them.

nkScripts.call("scriptName") ;

This can be used to execute scripts from a script. If anything bad happens, the error will be logged from nkScripts::LogManager.

Parameters
stackThe parameter stack, with the name of the script to execute (string).
Returns
The output value, empty.

The documentation for this class was generated from the following file: