diff options
Diffstat (limited to 'include/BLua.h')
-rw-r--r-- | include/BLua.h | 51 |
1 files changed, 49 insertions, 2 deletions
diff --git a/include/BLua.h b/include/BLua.h index 476ac0a..fb62b14 100644 --- a/include/BLua.h +++ b/include/BLua.h @@ -11,19 +11,66 @@ class Lua : public Base { Lua();
Lua(const Lua &) throw (GeneralException);
virtual ~Lua();
+ void open_base();
+ void open_table();
+ void open_io();
+ void open_string();
+ void open_math();
+ void open_debug();
+ void declarefunc(const String &, lua_CFunction, int = LUA_GLOBALSINDEX);
+ void call(const String &, int = LUA_GLOBALSINDEX, int = 0, int = 0);
+ void call(int = 0, int = 0);
void push();
- void push(double);
+ void push(lua_Number);
void push(const String &);
void push(bool);
void push(void *);
void push(lua_CFunction, int = 0);
+ void pop(int = 1);
+ void newtable();
+ void settable(int = -3);
+ void gettable(int = -2);
+ int gettop();
+ void error(const String &);
+ int type(int = -1);
+ bool isnil(int = -1);
+ bool isboolean(int = -1);
+ bool isnumber(int = -1);
+ bool isstring(int = -1);
+ bool istable(int = -1);
+ bool isfunction(int = -1);
+ bool iscfunction(int = -1);
+ bool isuserdata(int = -1);
+ bool islightuserdata(int = -1);
+ bool toboolean(int = -1);
+ lua_Number tonumber(int = -1);
+ String tostring(int = -1);
+ lua_CFunction tocfunction(int = -1);
+ void * touserdata(int = -1);
+ Lua * tothread(int = -1);
void load(Handle *) throw (GeneralException) ;
Lua * thread();
- static Lua * find(lua_State *);
+ static Lua * find(lua_State *) throw (GeneralException);
+ void showerror();
+ int getmetatable(int = -1);
+ int setmetatable(int = -2);
private:
Lua(lua_State *);
lua_State * L;
static std::map<lua_State *, Lua *> lualist;
};
+class LuaObject : public Base {
+ public:
+ LuaObject() : wantdestruct(false), pushed(false) {}
+ virtual void push(Lua *) throw (GeneralException);
+ static void * getme(Lua *, int = 1) throw (GeneralException);
+ void pushdestruct(Lua *) throw (GeneralException);
+ protected:
+ virtual void pushmembers(Lua *) = 0;
+ void pushme(Lua *, void *);
+ static void pushit(Lua *, const String &, lua_CFunction);
+ bool wantdestruct, pushed;
+};
+
#endif
|