diff options
Diffstat (limited to 'scripting.h')
-rw-r--r-- | scripting.h | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/scripting.h b/scripting.h new file mode 100644 index 0000000..d14aa3c --- /dev/null +++ b/scripting.h @@ -0,0 +1,30 @@ +#ifndef SCRIPTING_H +#define SCRIPTING_H + +#include <lua.hpp> +#include <boost/function.hpp> + +#include <string> +#include <stdexcept> + +class LuaError : public std::runtime_error { + public: + LuaError(const std::string& s) : std::runtime_error(s) {}; +}; + +class Lua { + protected: + lua_State *L; + boost::function<void (const char*)> log_func; + + public: + Lua(); + virtual ~Lua(); + + void set_log_func(boost::function<void (const char*)> log_func); + void print(const char *s); + + void dostring(std::string s); +}; + +#endif |