Thrive
lua_state.h
1 #pragma once
2 
3 #include <string>
4 
5 class lua_State;
6 
7 namespace thrive {
8 
12 class LuaState {
13 
14 public:
15 
21  LuaState();
22 
27  LuaState(const LuaState&) = delete;
28 
34  LuaState(LuaState&& other);
35 
39  ~LuaState();
40 
45  LuaState&
46  operator= (const LuaState&) = delete;
47 
55  LuaState&
56  operator= (LuaState&& other);
57 
61  operator lua_State* ();
62 
73  bool
74  doFile(
75  const std::string& filename
76  );
77 
88  bool
89  doString(
90  const std::string& string
91  );
92 
93 private:
94 
95  lua_State* m_state;
96 };
97 
98 }
LuaState()
Constructor.
Definition: lua_state.cpp:10
LuaState & operator=(const LuaState &)=delete
Non-copyable.
Definition: bullet_ogre_conversion.h:6
~LuaState()
Destructor.
Definition: lua_state.cpp:17
bool doString(const std::string &string)
Runs the chunk in the Lua state.
Definition: lua_state.cpp:55
RAII class for lua_State data structures.
Definition: lua_state.h:12
bool doFile(const std::string &filename)
Runs the file in the Lua state.
Definition: lua_state.cpp:47