Orxonox: orxonox::LuaBind Class Reference

# orxonox::LuaBind Class Reference

`#include <src/core/LuaBind.h>`

List of all members.

## Public Member Functions

void | clearLuaOutput ()
const std::string & | getLuaOutput ()
lua_State * | getLuaState ()
void | loadFile (const std::string &filename, bool luaTags)
| Loads the specified file line by line.
void | loadString (const std::string &code)
| LuaBind ()
void | luaPrint (const std::string &str)
std::string | replaceLuaTags (const std::string &text)
void | run ()
void | setIncludePath (const std::string &includepath)
| ~LuaBind ()

## Static Public Member Functions

static LuaBind & | getInstance ()
static const char * | lua_Chunkreader (lua_State *L, void *data, size_t *size)

## Private Attributes

std::string | includePath_
bool | isRunning_
std::string | luaSource_
lua_State * | luaState_
std::string | output_

## Static Private Attributes

static LuaBind * | singletonRef_s = NULL

## Classes

struct | LoadS

## Constructor & Destructor Documentation

orxonox::LuaBind::LuaBind | ( |  | ) |

References orxonox::Core::getMediaPathString(), includePath_, isRunning_, luaSource_, luaState_, output_, singletonRef_s, and tolua_Core_open().

orxonox::LuaBind::~LuaBind | ( |  | ) | `[inline]`

References singletonRef_s.

## Member Function Documentation

void orxonox::LuaBind::clearLuaOutput | ( |  | ) | `[inline]`

Referenced by orxonox::Loader::load().

static LuaBind& orxonox::LuaBind::getInstance | ( |  | ) | `[inline, static]`

References singletonRef_s.

Referenced by orxonox::Script::execute(), orxonox::Loader::load(), and tolua_Core_orxonox_LuaBind_getInstance00().

const std::string& orxonox::LuaBind::getLuaOutput | ( |  | ) | `[inline]`

Referenced by orxonox::Loader::load().

lua_State* orxonox::LuaBind::getLuaState | ( |  | ) | `[inline]`

void orxonox::LuaBind::loadFile | ( | const std::string & | filename,
|  | bool | luaTags |
| ) |  |  |

Loads the specified file line by line.

Parameters:

  | filename | The filename of the file
  | luaTags | if true, the loaded file gets stripped off luaTags

References COUT, luaSource_, output_, and replaceLuaTags().

Referenced by orxonox::Loader::load().

void orxonox::LuaBind::loadString | ( | const std::string & | code | ) |

References luaSource_, and output_.

Referenced by orxonox::Script::execute().

const char * orxonox::LuaBind::lua_Chunkreader | ( | lua_State * | L,
|  | void * | data,
|  | size_t * | size |
| ) |  |  | `[static]`

References orxonox::LuaBind::LoadS::s, and orxonox::LuaBind::LoadS::size.

Referenced by run().

void orxonox::LuaBind::luaPrint | ( | const std::string & | str | ) |

References COUT, and output_.

std::string orxonox::LuaBind::replaceLuaTags | ( | const std::string & | text | ) |

References COUT, and orxonox::getNextQuote().

Referenced by loadFile().

void orxonox::LuaBind::run | ( |  | ) |

References COUT, includePath_, isRunning_, lua_Chunkreader(), luaSource_, and luaState_.

Referenced by orxonox::Script::execute(), and orxonox::Loader::load().

void orxonox::LuaBind::setIncludePath | ( | const std::string & | includepath | ) | `[inline]`

## Member Data Documentation

std::string orxonox::LuaBind::includePath_`[private]`

Referenced by LuaBind(), and run().

bool orxonox::LuaBind::isRunning_`[private]`

Referenced by LuaBind(), and run().

std::string orxonox::LuaBind::luaSource_`[private]`

Referenced by loadFile(), loadString(), LuaBind(), and run().

lua_State* orxonox::LuaBind::luaState_`[private]`

Referenced by LuaBind(), and run().

std::string orxonox::LuaBind::output_`[private]`

Referenced by loadFile(), loadString(), LuaBind(), and luaPrint().

LuaBind * orxonox::LuaBind::singletonRef_s = NULL`[static, private]`

Referenced by getInstance(), LuaBind(), and ~LuaBind().

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

- src/core/LuaBind.h
- src/core/LuaBind.cc