The workhorse of the Lua scripting system. All scripts come here to be executed. More...
#include <lua51scriptingengine.h>
Public Types | |
typedef Mezzanine::Trie< char, const Mezzanine::String * > | CommandTrie |
A type for efficiently storing the kinds of Lexigraphical data aboutthe Lua runtime. | |
enum | Lua51Libraries { NoLib = 0, BaseLib = 1, PackageLib = 2, StringLib = 4, TableLib = 8, MathLib = 16, IOLib = 32, OSLib = 64, DebugLib = 128, MezzLib = 256, MezzSafeLib = 512, MezzXMLLib = 1024, MezzXMLSafeLib = 2048, MezzThreadingLib = 4096, MezzThreadingSafeLib = 8192, MezzPhysicsLib = 16384, MezzPhysicsSafeLib = 32768, MezzMathToolsLib = 65536, MezzMathToolsSafeLib = 131072, FirstLib = BaseLib, LastLib = MezzMathToolsSafeLib, DefaultLibs, AllLibs } |
Intended only to make constructing an Lua51ScriptingEngine with the desired libraries open a little easier. More... | |
Public Types inherited from Mezzanine::ManagerBase | |
enum | ManagerType { MT_Undefined = 0, MT_AudioManager = 1, MT_AnimationManager = 2, MT_CollisionShapeManager = 3, MT_CompositorManager = 4, MT_GraphicsManager = 5, MT_EventManager = 6, MT_InputManager = 7, MT_LogManager = 8, MT_MaterialManager = 9, MT_MeshManager = 10, MT_NetworkManager = 11, MT_ResourceManager = 12, MT_ScriptingManager = 13, MT_TextureManager = 14, MT_UIManager = 15, MT_ActorManager = 101, MT_AreaEffectManager = 102, MT_DebrisManager = 103, MT_PagingManager = 104, MT_PhysicsManager = 105, MT_SceneManager = 106, MT_SoundScapeManager = 107, MT_TerrainManager = 108, MT_VehicleManager = 109, MT_UserCreated = 512 } |
A listing of Manager Types. More... | |
Public Member Functions | |
Lua51ScriptingEngine (Lua51Libraries LibrariesToOpen=DefaultLibs) | |
Constructs a Scripting engine with a set of libraries preloaded. More... | |
Lua51ScriptingEngine (const NameValuePairList &Params) | |
Construct a from name value pairs. More... | |
Lua51ScriptingEngine (const XML::Node &XMLNode) | |
Construct by deserializing. More... | |
virtual | ~Lua51ScriptingEngine () |
Virtual Deconstructor. | |
virtual void | AliasLibrary (const String &Base, const String &Sub, const String &Alias) |
Nest Lua modules to put libraries in more clean positions. More... | |
virtual CountedPtr< iScriptCompilable > | Compile (const String &SourceToCompile) |
Calls Compile(CountedPtr<iScriptCompilable>) and returns a CountedPtr to the script created. More... | |
virtual void | Compile (CountedPtr< iScriptCompilable > &ScriptToCompile) |
Accepts an Counted ptr to a script and compiles it. More... | |
virtual void | Compile (CountedPtr< Lua51Script > &ScriptToCompile) |
Compile a Lua51 script. More... | |
virtual void | Compile (Lua51Script &ScriptToCompile) |
Performs the compilation on a script reference. More... | |
virtual void | Compile (Lua51Script *ScriptToCompile) |
Performs the compilation on a raw pointer. More... | |
virtual CountedPtr< iScript > | Execute (const String &ScriptSource) |
Compile and execute a passed string. More... | |
virtual void | Execute (CountedPtr< iScript > &ScriptToRun) |
Implements a required for iScriptManager, Calls Execute(CountedPtr<Lua51Script>) More... | |
virtual void | Execute (CountedPtr< Lua51Script > &ScriptToRun) |
This will execute the passed script, compiling it if not present. More... | |
virtual void | Execute (Lua51Script &ScriptToRun) |
Performs the compilation on a script reference. More... | |
virtual void | Execute (Lua51Script *ScriptToRun) |
Performs the compilation on a raw pointer. More... | |
virtual String | GetImplementationTypeName () const |
This Allows any manager name to be sent to a stream. Primarily used for logging. More... | |
const String & | GetLuaTypeString (int StackLocation) |
Get a human friendly string containing the type of the thing at the given stack location. More... | |
lua_State * | GetRawLuaState () |
Get the underlying Lua state that can be used with lua api calls directly. More... | |
int | GetStackCount () |
The stack is a specific part of the State relating to how data is passed between functions. How big is that? More... | |
CountedPtr< iScriptArgument > | GetValue (const String &LuaIdentifier) |
Get the Value stored in a lua identifier. More... | |
virtual Boole | IsLibraryOpen (Lua51Libraries LibToCheck) |
Check the Lua state to see if a table exists. More... | |
virtual void | OpenAllLibraries () |
Make all Mezzanine and Lua functionality. More... | |
virtual void | OpenBaseLibrary () |
Make some eof the more core functionality available to lua scripts. More... | |
virtual void | OpenDebugLibrary () |
Enable Debugging Lua features. More... | |
virtual void | OpenDefaultLibraries () |
Prepare most Mezzanine and some Lua functionality for use in Lua scripts. More... | |
virtual void | OpenIOLibrary () |
Enable Input/Output in lua scripts for reading and writing files. More... | |
virtual void | OpenLibraries (int LibrariesToOpen) |
Makes Lua function calls in Lua standard libraries available for use in Lua scripts. More... | |
virtual void | OpenMathLibrary () |
Enable Lua math and random number functionality. More... | |
virtual void | OpenMezzanineLibrary () |
Make everything in the Mezzanine Libary available for use in Lua51 scripts. More... | |
virtual void | OpenMezzanineMathToolsLibrary () |
Make the MathTools parts of the Mezzanine Libary available for use in Lua51 scripts. | |
virtual void | OpenMezzanineMathToolsSafeLibrary () |
Make the MathTools parts of the Mezzanine Libary available for use in Lua51 scripts. More... | |
virtual void | OpenMezzaninePhysicsLibrary () |
Make the Physics parts of the Mezzanine Libary available for use in Lua51 scripts. More... | |
virtual void | OpenMezzaninePhysicsSafeLibrary () |
Make the Physics parts of the Mezzanine Libary available for use in Lua51 scripts. More... | |
virtual void | OpenMezzanineSafeLibrary () |
Make a subset of the Mezzanine Library available for use in Lua51 scripts. More... | |
virtual void | OpenMezzanineThreadingLibrary () |
Make the Threading parts of the Mezzanine Libary available for use in Lua51 scripts. More... | |
virtual void | OpenMezzanineThreadingSafeLibrary () |
Make the Threading parts of the Mezzanine Libary available for use in Lua51 scripts. More... | |
virtual void | OpenMezzanineXMLLibrary () |
Make the XML parts of the Mezzanine Libary available for use in Lua51 scripts. More... | |
virtual void | OpenMezzanineXMLSafeLibrary () |
Make the XML parts of the Mezzanine Libary available for use in Lua51 scripts. More... | |
virtual void | OpenOSLibrary () |
EnableOS facilities in lua scriptsm such as file managements, time and shell execution. More... | |
virtual void | OpenPackageLibrary () |
Allow Lua scripts to load other libraries. More... | |
virtual void | OpenStringLibrary () |
Allow Lua scripts access to the Lua string manipulation libary. More... | |
virtual void | OpenTableLibrary () |
Enable Lua table manipulation functionality. More... | |
void | PopulateTabCompletionTrie (CommandTrie &CommandGroup, const String &TableName="", std::vector< String > AlreadyDidTables=std::vector< String >()) |
Populate a Trie with all the members and types in the current lua runtime. More... | |
Public Member Functions inherited from Mezzanine::Scripting::iScriptCompilationManager | |
virtual | ~iScriptCompilationManager () |
Overidable deconstructor. | |
Public Member Functions inherited from Mezzanine::Scripting::iScriptingManager | |
iScriptingManager () | |
Class constructor. More... | |
virtual | ~iScriptingManager () |
Class destructor. | |
virtual void | Deinitialize () |
Removes this manager from any necessary configuration so it can be safely disposed of. More... | |
virtual ManagerType | GetInterfaceType () const |
This returns the type of this manager. More... | |
virtual void | Initialize () |
Configures this manager for use prior to entering the main loop. More... | |
Public Member Functions inherited from Mezzanine::EntresolManager | |
EntresolManager () | |
Class constructor. | |
virtual | ~EntresolManager () |
Class destructor. | |
Public Member Functions inherited from Mezzanine::ManagerBase | |
ManagerBase () | |
Class constructor. | |
virtual | ~ManagerBase () |
Class destructor. | |
virtual String | GetInterfaceTypeAsString () const |
Gets a string of the interface type of this manager. More... | |
Boole | IsInitialized () const |
Gets whether or not this manager has been initialized. More... | |
Static Public Member Functions | |
static Lua51Libraries | GetLibFromName (String Name) |
Convert a string similar to one of the names on the Lua51ScriptingEngine to number. More... | |
static const String & | GetLibName (Lua51Libraries Lib) |
Convert a Lua51Libraries value to its name. More... | |
static const String & | GetTableName (Lua51Libraries Lib) |
Convert a Lua51Libraries value to the name of a table it loads. More... | |
static bool | IsValidCharInIdentifier (const char IdChar) |
Is the given character valid for is in a Lua Identifier. More... | |
static bool | IsValidCharInTableIdentifier (const char IdChar) |
Is the given character valid for is in a Lua Identifier including tables leading up to it and scoping operators. More... | |
static bool | IsValidCharStartIdentifier (const char IdChar) |
Is the given character valid for starting a Lua Identifier. More... | |
static bool | IsValidIdentifier (const String &Id) |
Is a string a valid identifier in Lua. More... | |
Static Public Member Functions inherited from Mezzanine::ManagerBase | |
static String | GetTypeAsString (const ManagerType &ManagerType) |
Gets the string form of the type of manager. More... | |
static ManagerType | GetTypeFromString (const String &ManagerName) |
Gets the type of manager requested from a string. More... | |
Static Public Attributes | |
static const String | AllLibsName = "All" |
The name used to identify the set of all libraries, "All". | |
static const String | BaseLibName = "Base" |
The name used to identify the Base library, "Base". | |
static const String | BaseTableName = "coroutine" |
The name used to identify a table loaded by the Base library, "coroutine". | |
static const String | DebugLibName = "Debug" |
The name used to identify the Debug library, "Debug". | |
static const String | DebugTableName = "debug" |
The name used to identify a table loaded by the Debug library, "debug". | |
static const String | DefaultLibsName = "Default" |
The name used to identify the Default set of libraries, "Default". | |
static const String | GlobalTableName = "_G" |
The place Lua keeps all the identifiers in a single Lua State. | |
static const ManagerBase::ManagerType | InterfaceType = ManagerBase::MT_ScriptingManager |
The type of functionality this manager provides. For ManagerBase compatibility. | |
static const String | IOLibName = "IO" |
The name used to identify the IO library, "IO". | |
static const String | IOTableName = "io" |
The name used to identify a table loaded by the IO library, "io". | |
static const String | MathLibName = "Math" |
The name used to identify the Math library, "Math". | |
static const String | MathTableName = "math" |
The name used to identify a table loaded by the Math library, "math". | |
static const String | MezzLibName = "Mezzanine" |
The name used to identify the Mezzanine library, "Mezzanine". | |
static const String | MezzMathToolsLibName = "MezzanineMathTools" |
The name used to identify the MezzanineMathTools library, "MezzanineMathTools". | |
static const String | MezzMathToolsSafeLibName = "MezzanineMathToolsSafe" |
The name used to identify the MezzanineMathToolsSafe library, "MezzanineMathToolsSafe". | |
static const String | MezzMathToolsSafeTableName = "MezzanineMathToolsSafe" |
The name used to identify a table loaded by the MezzanineMathToolsSafe library, "MezzanineMathToolsSafe". | |
static const String | MezzMathToolsTableName = "MezzanineMathTools" |
The name used to identify a table loaded by the MezzanineMathTools library, "MezzanineMathTools". | |
static const String | MezzPhysicsLibName = "MezzaninePhysics" |
The name used to identify the MezzaninePhysics library, "MezzaninePhysics". | |
static const String | MezzPhysicsSafeLibName = "MezzaninePhysicsSafe" |
The name used to identify the MezzaninePhysicsSafe library, "MezzaninePhysicsSafe". | |
static const String | MezzPhysicsSafeTableName = "MezzaninePhysicsSafe" |
The name used to identify a table loaded by the MezzaninePhysicsSafe library, "MezzaninePhysicsSafe". | |
static const String | MezzPhysicsTableName = "MezzaninePhysics" |
The name used to identify a table loaded by the MezzaninePhysics library, "MezzaninePhysics". | |
static const String | MezzSafeLibName = "MezzanineSafe" |
The name used to identify the MezzanineSafe library, "MezzanineSafe". | |
static const String | MezzSafeTableName = "MezzanineSafe" |
The name used to identify a table loaded by the MezzanineSafe library, "MezzanineSafe". | |
static const String | MezzTableName = "Mezzanine" |
The name used to identify a table loaded by the Mezzanine library, "Mezzanine". | |
static const String | MezzThreadingLibName = "MezzanineThreading" |
The name used to identify the MezzanineThreading library, "MezzanineThreading". | |
static const String | MezzThreadingSafeLibName = "MezzanineThreadingSafe" |
The name used to identify the MezzanineThreadingSafe library, "MezzanineThreadingSafe". | |
static const String | MezzThreadingSafeTableName = "MezzanineThreadingSafe" |
The name used to identify a table loaded by the MezzanineThreadingSafe library, "MezzanineThreadingSafe". | |
static const String | MezzThreadingTableName = "MezzanineThreading" |
The name used to identify a table loaded by the MezzanineThreading library, "MezzanineThreading". | |
static const String | MezzXMLLibName = "MezzanineXML" |
The name used to identify the MezzanineXML library, "MezzanineXML". | |
static const String | MezzXMLSafeLibName = "MezzanineXMLSafe" |
The name used to identify the MezzanineXMLSafe library, "MezzanineXMLSafe". | |
static const String | MezzXMLSafeTableName = "MezzanineXMLSafe" |
The name used to identify a table loaded by the MezzanineXMLSafe library, "MezzanineXMLSafe". | |
static const String | MezzXMLTableName = "MezzanineXML" |
The name used to identify a table loaded by the MezzanineXML library, "MezzanineXML". | |
static const String | NoLibName = "None" |
The name used to identify No libraries, "None". | |
static const String | OSLibName = "OS" |
The name used to identify the OS library, "OS". | |
static const String | OSTableName = "os" |
The name used to identify a table loaded by the OS library, "os". | |
static const String | PackageLibName = "Package" |
The name used to identify the Package library, "Package". | |
static const String | PackageTableName = "package" |
The name used to identify a table loaded by the Package library, "package". | |
static const String | ScriptEngineName = "Lua51ScriptingEngine" |
The name of this scripting engine for inspection purposes, "Lua51ScriptingEngine". | |
static const String | StringLibName = "String" |
The name used to identify the String library, "String". | |
static const String | StringTableName = "string" |
The name used to identify a table loaded by the String library, "string". | |
static const String | TableLibName = "Table" |
The name used to identify the Table library, "Table". | |
static const String | TableTableName = "table" |
The name used to identify a table loaded by the Table library, "table". | |
static const String | TypeNameBoolean = "Boolean" |
A human friendly representation of the Lua type boolean. | |
static const String | TypeNameFunction = "Function" |
A human friendly representation of the Lua type function. | |
static const String | TypeNameLightUserData = "Light User Data" |
A human friendly representation of the Lua type light user data. | |
static const String | TypeNameNil = "Nil" |
A human friendly representation of the Lua type nil. | |
static const String | TypeNameNumber = "Number" |
A human friendly representation of the Lua type number. | |
static const String | TypeNameString = "String" |
A human friendly representation of the Lua type string. | |
static const String | TypeNameTable = "Table" |
A human friendly representation of the Lua type table. | |
static const String | TypeNameThread = "Thread" |
A human friendly representation of the Lua type thread. | |
static const String | TypeNameUserData = "User Data" |
A human friendly representation of the Lua type user data. | |
Protected Member Functions | |
void | CheckLuaStateAfterConstruction () const |
Checks the internal Lua to see if memory was correctly allocated during its creation. More... | |
CountedPtr< iScriptArgument > | ScriptArgFromStack () |
Get the top value of the Lua stack. More... | |
Whole | ScriptArgsFromStack (Lua51Script *ScriptWasRun, Integer PreviousStackSize) |
Remove Scripts from Lua stack and put them into arguments on the passed script. More... | |
void | ScriptArgsOntoStack (Lua51Script *ScriptToLoad) |
Put the arguments in a script onto the stack. More... | |
void | ScriptOntoStack (Lua51Script *ScriptToLoad) |
Put a lua script onto the stack, compiling it if needed. More... | |
void | SetMathTools () |
Set The MezzanineMathTools library as the MathTools member of the Mezzanine library or fail silently. | |
void | SetMathToolsSafe () |
Set The MezzanineMathToolsSafe library as the MathTools member of the MezzanineSafe library or fail silently. | |
void | SetPhysics () |
Set The MezzaninePhysics library as the Physics member of the Mezzanine library or fail silently. | |
void | SetPhysicsSafe () |
Set The MezzaninePhysicsSafe library as the Physics member of the MezzanineSafe library or fail silently. | |
void | SetThreading () |
Set The MezzanineThreading library as the Threading member of the Mezzanine library or fail silently. | |
void | SetThreadingSafe () |
Set The MezzanineThreadingSafe library as the Threading member of the MezzanineSafe library or fail silently. | |
void | SetXML () |
Set The MezzanineXML library as the XML member of the Mezzanine library or fail silently. | |
void | SetXMLSafe () |
Set The MezzanineXMLSafe library as the XML member of the MezzanineSafe library or fail silently. | |
void | StackExecute (Whole ArgumentCount) |
Execute a thing on the top of the stack with arguments already put there. More... | |
virtual void | ThrowFromLuaErrorCode (int LuaReturn) |
This will throw an exception. More... | |
Friends | |
class | Lua51Script |
Additional Inherited Members | |
Protected Attributes inherited from Mezzanine::ManagerBase | |
Boole | Initialized |
Simple Boole indicating whether or not this manager has been initialized. More... | |
Entresol * | TheEntresol |
The actual pointer to the Entresol core class. More... | |
The workhorse of the Lua scripting system. All scripts come here to be executed.
Definition at line 96 of file lua51scriptingengine.h.
Intended only to make constructing an Lua51ScriptingEngine with the desired libraries open a little easier.
Enumerator | |
---|---|
NoLib |
No libraries. |
BaseLib |
Correlates to Lua51ScriptingEngine::OpenBaseLibrary. |
PackageLib |
Correlates to Lua51ScriptingEngine::OpenPackageLibrary. |
StringLib |
Correlates to Lua51ScriptingEngine::OpenStringLibrary. |
TableLib |
Correlates to Lua51ScriptingEngine::OpenTableLibrary. |
MathLib |
Correlates to Lua51ScriptingEngine::OpenMathLibrary. |
IOLib |
Correlates to Lua51ScriptingEngine::OpenIOLibrary. |
OSLib |
Correlates to Lua51ScriptingEngine::OpenOSLibrary. |
DebugLib |
Correlates to Lua51ScriptingEngine::OpenDebugLibrary. |
MezzLib |
Correlates to Lua51ScriptingEngine::OpenMezzanineLibrary. |
MezzSafeLib |
Correlates to Lua51ScriptingEngine::OpenMezzanineSafeLibrary. |
MezzXMLLib |
Correlates to Lua51ScriptingEngine::OpenMezzanineXMLLibrary. |
MezzXMLSafeLib |
Correlates to Lua51ScriptingEngine::OpenMezzanineXMLSafeLibrary. |
MezzThreadingLib |
Correlates to Lua51ScriptingEngine::OpenMezzanineThreadingLibrary. |
MezzThreadingSafeLib |
Correlates to Lua51ScriptingEngine::OpenMezzanineThreadingSafeLibrary. |
MezzPhysicsLib |
Correlates to Lua51ScriptingEngine::OpenMezzaninePhysicsLibrary. |
MezzPhysicsSafeLib |
Correlates to Lua51ScriptingEngine::OpenMezzaninePhysicsSafeLibrary. |
MezzMathToolsLib |
Correlates to Lua51ScriptingEngine::OpenMezzanineMathToolsLibrary. |
MezzMathToolsSafeLib |
Correlates to Lua51ScriptingEngine::OpenMezzanineMathToolsSafeLibrary. |
FirstLib |
Useful for math based ways to work with libraries, This is equal to the numerically lowest lib. |
LastLib |
Useful for math based ways to work with libraries, This is equal to the numerically highest lib. |
DefaultLibs |
A quick way to refer to all the libraries opened by Lua51ScriptingEngine::OpenDefaultLibraries. |
AllLibs |
A quick way to refer to all the libraries opened by Lua51ScriptingEngine::OpenAllLibraries. |
Definition at line 148 of file lua51scriptingengine.h.
|
explicit |
Constructs a Scripting engine with a set of libraries preloaded.
LibrariesToOpen | A Lua51Libraries bitmap indicating which libraries to load, this defaults to DefaultLibs |
Definition at line 483 of file lua51scriptingengine.cpp.
|
explicit |
Construct a from name value pairs.
Params | A collection of name value pairs indicating what to load and not load. |
Each name can be the name of a libname (except None) and the value can either be "Load" or "Unload". To indicate whether or not a library will be loaded or not during instantation.
Definition at line 489 of file lua51scriptingengine.cpp.
|
explicit |
Construct by deserializing.
XMLNode | An XML::Node That contains an A valid lua scripting engine. |
Definition at line 514 of file lua51scriptingengine.cpp.
|
virtual |
Nest Lua modules to put libraries in more clean positions.
this is used to create the syntax "Mezzanine.XML.Document()" for example. "Mezzanine" is the base, "MezzanineXML" another module in the root lua environment is the Sub and "XML" is the Alias. This does not "move" the library/module, this Simply creates a reference with a new name and location.
To ensure Tab completion works this also creates an alias/reference in the global table. In this above example this will also incidentally create the syntax "XML.Document()"
Base | The libary that will have another nested in it. |
Sub | The library to be nest into another. |
Alias | The new name of the library when referenced from its nested location. |
Definition at line 658 of file lua51scriptingengine.cpp.
|
protected |
Checks the internal Lua to see if memory was correctly allocated during its creation.
If | Lua could not get enouugh memory this throws an Exception::MM_OUT_OF_MEMORY_EXCEPTION |
Definition at line 239 of file lua51scriptingengine.cpp.
|
virtual |
Calls Compile(CountedPtr<iScriptCompilable>) and returns a CountedPtr to the script created.
SourceToCompile | A string Containing valid lua source code. |
Implements Mezzanine::Scripting::iScriptCompilationManager.
Definition at line 562 of file lua51scriptingengine.cpp.
|
virtual |
Accepts an Counted ptr to a script and compiles it.
ScriptToCompile | The CountedPtr to compile |
The ByteCode member on the passed script is erased, if present, and sets it to corresponding lua binary.
If | an invalid script is passed this throws ParametersCastException. |
Implements Mezzanine::Scripting::iScriptCompilationManager.
Definition at line 570 of file lua51scriptingengine.cpp.
|
virtual |
Compile a Lua51 script.
ScriptToCompile | A CountedPtr to a Lua51Script. |
Compiles the source code present in ScriptToCompile and puts the results back in the ByteCode member on the script.
Definition at line 581 of file lua51scriptingengine.cpp.
|
virtual |
Performs the compilation on a script reference.
ScriptToCompile | A reference to the Lua51Script to compile. |
Definition at line 584 of file lua51scriptingengine.cpp.
|
virtual |
Performs the compilation on a raw pointer.
ScriptToCompile | A pointer to the Lua51Script to compile. |
Definition at line 587 of file lua51scriptingengine.cpp.
|
virtual |
Compile and execute a passed string.
ScriptSource | A String containing the source code to be executed. |
This will create a CountPtr to a Lua51Script and assign both its Source and Byte code
Implements Mezzanine::Scripting::iScriptingManager.
Definition at line 525 of file lua51scriptingengine.cpp.
|
virtual |
Implements a required for iScriptManager, Calls Execute(CountedPtr<Lua51Script>)
ScriptToRun | A CountedPtr<iScript> to be run. This is cast to an CountedPtr<Lua51Script> and called if possible. |
If | this cannot be cast this throws a ParametersCastException. |
Implements Mezzanine::Scripting::iScriptingManager.
Definition at line 532 of file lua51scriptingengine.cpp.
|
virtual |
This will execute the passed script, compiling it if not present.
ScriptToRun | The script to execute. |
If a bytecode is present on ScriptToRun then it is executed. Otherwise the Source is compiled and the result is set as the bytecode and it is executed.
Definition at line 543 of file lua51scriptingengine.cpp.
|
virtual |
Performs the compilation on a script reference.
ScriptToRun | A reference to the Lua51Script to compile and run. |
Definition at line 546 of file lua51scriptingengine.cpp.
|
virtual |
Performs the compilation on a raw pointer.
ScriptToRun | A pointer to the Lua51Script to compile and run. |
Definition at line 548 of file lua51scriptingengine.cpp.
|
virtual |
This Allows any manager name to be sent to a stream. Primarily used for logging.
Implements Mezzanine::Scripting::iScriptingManager.
Definition at line 601 of file lua51scriptingengine.cpp.
|
static |
Convert a string similar to one of the names on the Lua51ScriptingEngine to number.
Name | A string containing a name of one of the libraries (without regard to case) |
Definition at line 441 of file lua51scriptingengine.cpp.
|
static |
Convert a Lua51Libraries value to its name.
Lib | A number indicating what libraries a Lua51ScriptingEngine could load |
Definition at line 386 of file lua51scriptingengine.cpp.
const String & Mezzanine::Scripting::Lua::Lua51ScriptingEngine::GetLuaTypeString | ( | int | StackLocation | ) |
Get a human friendly string containing the type of the thing at the given stack location.
StackLocation | Where to look in the Lua stack for item to inspect |
Definition at line 856 of file lua51scriptingengine.cpp.
lua_State * Mezzanine::Scripting::Lua::Lua51ScriptingEngine::GetRawLuaState | ( | ) |
Get the underlying Lua state that can be used with lua api calls directly.
Definition at line 828 of file lua51scriptingengine.cpp.
int Mezzanine::Scripting::Lua::Lua51ScriptingEngine::GetStackCount | ( | ) |
The stack is a specific part of the State relating to how data is passed between functions. How big is that?
Definition at line 831 of file lua51scriptingengine.cpp.
|
static |
Convert a Lua51Libraries value to the name of a table it loads.
Lib | A number indicating what libraries a Lua51ScriptingEngine could load |
Definition at line 415 of file lua51scriptingengine.cpp.
CountedPtr< iScriptArgument > Mezzanine::Scripting::Lua::Lua51ScriptingEngine::GetValue | ( | const String & | LuaIdentifier | ) |
Get the Value stored in a lua identifier.
LuaIdentifier | The name of the variable in lua to get the value from. |
Definition at line 883 of file lua51scriptingengine.cpp.
|
virtual |
Check the Lua state to see if a table exists.
LibToCheck | Indicator of which library to check |
Definition at line 646 of file lua51scriptingengine.cpp.
|
static |
Is the given character valid for is in a Lua Identifier.
IdChar | A Single character to check |
Definition at line 837 of file lua51scriptingengine.cpp.
|
static |
Is the given character valid for is in a Lua Identifier including tables leading up to it and scoping operators.
IdChar | A Single character to check |
Definition at line 840 of file lua51scriptingengine.cpp.
|
static |
Is the given character valid for starting a Lua Identifier.
IdChar | A Single character to check |
Definition at line 834 of file lua51scriptingengine.cpp.
|
static |
Is a string a valid identifier in Lua.
Id | The identifier to check |
Definition at line 843 of file lua51scriptingengine.cpp.
|
virtual |
Make all Mezzanine and Lua functionality.
Definition at line 681 of file lua51scriptingengine.cpp.
|
virtual |
Make some eof the more core functionality available to lua scripts.
See the Lua manual at http://www.lua.org/manual/5.1/manual.html#5.1 and http://www.lua.org/manual/5.1/manual.html#5.2 for further details on the functionality this enables.
Definition at line 684 of file lua51scriptingengine.cpp.
|
virtual |
Enable Debugging Lua features.
This is the only Lua library omitted from the Defaults for functionality rather than security reasons. This unimportant for most game uses and is primarily include for completeness. More details in the Lua manual at http://www.lua.org/manual/5.1/manual.html#5.9 .
Definition at line 726 of file lua51scriptingengine.cpp.
|
virtual |
Prepare most Mezzanine and some Lua functionality for use in Lua scripts.
This will load a the Lua Base, String, Table and Math libraries. This will make Mezzanine functionality available that does not provide any arbitrary file output or execution abilities.
Definition at line 679 of file lua51scriptingengine.cpp.
|
virtual |
Enable Input/Output in lua scripts for reading and writing files.
See http://www.lua.org/manual/5.1/manual.html#5.7 in the Lua manual for details
Definition at line 714 of file lua51scriptingengine.cpp.
|
virtual |
Makes Lua function calls in Lua standard libraries available for use in Lua scripts.
LibrariesToOpen | A Lua51Libraries bitmap indicating which libraries to loads |
Definition at line 606 of file lua51scriptingengine.cpp.
|
virtual |
Enable Lua math and random number functionality.
The Lua manual at http://www.lua.org/manual/5.1/manual.html#5.6 as further details.
Definition at line 708 of file lua51scriptingengine.cpp.
|
virtual |
Make everything in the Mezzanine Libary available for use in Lua51 scripts.
Definition at line 733 of file lua51scriptingengine.cpp.
|
virtual |
Make the MathTools parts of the Mezzanine Libary available for use in Lua51 scripts.
This should not allow access to any functions, methods or classes than can execute code or manage files or crash the client malicious ways.
Definition at line 800 of file lua51scriptingengine.cpp.
|
virtual |
Make the Physics parts of the Mezzanine Libary available for use in Lua51 scripts.
Definition at line 778 of file lua51scriptingengine.cpp.
|
virtual |
Make the Physics parts of the Mezzanine Libary available for use in Lua51 scripts.
This should not allow access to any functions, methods or classes than can execute code or manage files or crash the client malicious ways.
Definition at line 785 of file lua51scriptingengine.cpp.
|
virtual |
Make a subset of the Mezzanine Library available for use in Lua51 scripts.
This should not allow access to any functions, methods or classes than can execute code or manage files.
Definition at line 740 of file lua51scriptingengine.cpp.
|
virtual |
Make the Threading parts of the Mezzanine Libary available for use in Lua51 scripts.
Definition at line 763 of file lua51scriptingengine.cpp.
|
virtual |
Make the Threading parts of the Mezzanine Libary available for use in Lua51 scripts.
This should not allow access to any functions, methods or classes than can execute code or manage files or crash the client malicious ways.
Definition at line 770 of file lua51scriptingengine.cpp.
|
virtual |
Make the XML parts of the Mezzanine Libary available for use in Lua51 scripts.
Definition at line 748 of file lua51scriptingengine.cpp.
|
virtual |
Make the XML parts of the Mezzanine Libary available for use in Lua51 scripts.
This should not allow access to any functions, methods or classes than can execute code or manage files.
Definition at line 755 of file lua51scriptingengine.cpp.
|
virtual |
EnableOS facilities in lua scriptsm such as file managements, time and shell execution.
See http://www.lua.org/manual/5.1/manual.html#5.7 in the Lua manual for details
Definition at line 720 of file lua51scriptingengine.cpp.
|
virtual |
Allow Lua scripts to load other libraries.
see the Lua manual at http://www.lua.org/manual/5.1/manual.html#5.3 for details on what this enables. This does allow Lua scripts to load other libraries, inlcuding the IO or OS libraries.
Definition at line 690 of file lua51scriptingengine.cpp.
|
virtual |
Allow Lua scripts access to the Lua string manipulation libary.
The details of what this enables can be read about in the Lua manual at http://www.lua.org/manual/5.1/manual.html#5.4 .
Definition at line 696 of file lua51scriptingengine.cpp.
|
virtual |
Enable Lua table manipulation functionality.
See the Lua manual at http://www.lua.org/manual/5.1/manual.html#5.5 for details.
Definition at line 702 of file lua51scriptingengine.cpp.
void Mezzanine::Scripting::Lua::Lua51ScriptingEngine::PopulateTabCompletionTrie | ( | CommandTrie & | CommandGroup, |
const String & | TableName = "" , |
||
std::vector< String > | AlreadyDidTables = std::vector<String>() |
||
) |
Populate a Trie with all the members and types in the current lua runtime.
CommandGroup | The Trie to be populated. |
TableName | the name of the table to iterate over and populate the Trie with. |
AlreadyDidTables | To break cycles a list tables to skip descending into can be provided. |
Definition at line 889 of file lua51scriptingengine.cpp.
|
protected |
Get the top value of the Lua stack.
Definition at line 303 of file lua51scriptingengine.cpp.
|
protected |
Remove Scripts from Lua stack and put them into arguments on the passed script.
ScriptWasRun | the script was just run and needs to have its returns arguments loaded |
PreviousStackSize | How big was the stack before execution |
Definition at line 284 of file lua51scriptingengine.cpp.
|
protected |
Put the arguments in a script onto the stack.
ScriptToLoad | A Script with 0 or more arguments to load. |
Definition at line 262 of file lua51scriptingengine.cpp.
|
protected |
Put a lua script onto the stack, compiling it if needed.
ScriptToLoad | A Script to put onto the lua stack. |
This adds one item to the the Lua stack
Definition at line 245 of file lua51scriptingengine.cpp.
|
protected |
Execute a thing on the top of the stack with arguments already put there.
ArgumentCount | How many args are onthe stack for the script |
Definition at line 277 of file lua51scriptingengine.cpp.
|
protectedvirtual |
This will throw an exception.
LuaReturn | The return code from a Lua Compile or execution call |
This | Throws ScriptLuaYieldException, ScriptLuaRuntimeException, ScriptLuaRuntimeException, ScriptLuaErrErrException, SyntaxErrorLuaException, OutOfMemoryException, FileException, ScriptLuaException with as much precision as possible when thrown. |
Definition at line 205 of file lua51scriptingengine.cpp.