Holds all information for a script. More...
Public Member Functions | |
Script () noexcept | |
virtual | ~Script () |
INTERPRETER | getTargetInterpreter () const |
nkMemory::StringView | getName () const |
nkMemory::StringView | getSources () const |
const CompilationResult & | getLastCompilationResult () const |
void | setTargetInterpreter (INTERPRETER interpreter) |
void | setName (nkMemory::StringView name) |
void | setSources (nkMemory::StringView sources) |
bool | load () |
void | unload () |
virtual void | exportClassToTree (nkExport::Node *rootNode) override |
virtual void | importClassFromTree (nkExport::Node *rootNode) override |
Public Member Functions inherited from nkExport::Exportable | |
Exportable () noexcept | |
virtual | ~Exportable () |
Holds all information for a script.
The holder is also responsible for script compilation and usage within an environment.
|
noexcept |
Constructor.
|
virtual |
Destructor.
INTERPRETER nkScripts::Script::getTargetInterpreter | ( | ) | const |
nkMemory::StringView nkScripts::Script::getName | ( | ) | const |
nkMemory::StringView nkScripts::Script::getSources | ( | ) | const |
const CompilationResult& nkScripts::Script::getLastCompilationResult | ( | ) | const |
void nkScripts::Script::setTargetInterpreter | ( | INTERPRETER | interpreter | ) |
Sets the interpreter this script should target.
interpreter | The type of interpreter the script should compile for. |
void nkScripts::Script::setName | ( | nkMemory::StringView | name | ) |
Sets the name of the script.
name | The name to assign. |
void nkScripts::Script::setSources | ( | nkMemory::StringView | sources | ) |
Sets the sources the script should compile from.
sources | The sources to assign. |
bool nkScripts::Script::load | ( | ) |
Loads the script. This triggers recompilation and prepares it for intepretation within the Environment.
void nkScripts::Script::unload | ( | ) |
Unloads and free all resources linked to compilation within the script.
|
overridevirtual |
Basic exporting capabilities.
rootNode | The root of the tree to export into. |
Implements nkExport::Exportable.
|
overridevirtual |
Basic importing capabilities.
rootNode | The root of the trree to import from. |
Implements nkExport::Exportable.