lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


	I was working on something similar a few months ago, but it is still
far from completion (it will require a lot of rewriting). Yet you can
have a look at the source on launchpad.net.
https://launchpad.net/lune

TNHarris a écrit :
> Hello,
> 
> I'd like to wrap the Lua API in a C++ class to take advantage of
> overloading and default arguments, etc. I looked at Paolo Capriotti's
> library but it seems to be oriented for using C++ objects on the stack.
> I don't need that so much as just a more convenient way to use Lua.
> 
> I think something like this would be favorable:
> 
> namespace luaxx
> {
>         class State
>         {
>                 void getTable(int index = -2)
>                         { lua_gettable(m_L, index); };
>                 void getTable(int index = -2, int key = -1)
>                 {
>                         if (index < 0 && index > LUA_REGISTRYINDEX)
>                                 index -= 1;
>                         push(key);
>                         lua_gettable(m_L, index);
>                 };
>         };
> }
> 
> Does anyone have a library already made?
> 
> -- tom
> telliamed@whoopdedo.org
> 
> 
>