diff options
| author | chai <chaifix@163.com> | 2019-03-16 13:03:50 +0800 |
|---|---|---|
| committer | chai <chaifix@163.com> | 2019-03-16 13:03:50 +0800 |
| commit | 1ab2501db0f9e14f138292880e37120e7a6184de (patch) | |
| tree | 2d1cfa82a9a6a3a0f16e516f100b2acb6f7e0e4e /Source/3rdParty/Luax/luax_state.h | |
| parent | 95d27af75eb2aff8020e073eff8dfeb074b5bba6 (diff) | |
*luax
Diffstat (limited to 'Source/3rdParty/Luax/luax_state.h')
| -rw-r--r-- | Source/3rdParty/Luax/luax_state.h | 39 |
1 files changed, 31 insertions, 8 deletions
diff --git a/Source/3rdParty/Luax/luax_state.h b/Source/3rdParty/Luax/luax_state.h index 166ac26..a936ea6 100644 --- a/Source/3rdParty/Luax/luax_state.h +++ b/Source/3rdParty/Luax/luax_state.h @@ -9,7 +9,7 @@ namespace Luax { - class Context; + class LuaxContext; class LuaxEnum; class LuaxStrongRef; class LuaxWeakRef; @@ -43,11 +43,14 @@ namespace Luax //------------------------------------------------------------------------------------------------------------ // ƿռƿռһ_Gı + void PushGlobalNamespace(); void PushNamespace(cc8* name); void PopNamespace(); - + bool IsNamespace(int idx); + //------------------------------------------------------------------------------------------------------------ + void SetTop(int top); int GetTop(); bool CheckParams(int idx, cc8* format); int AbsIndex(int idx); @@ -55,11 +58,6 @@ namespace Luax //------------------------------------------------------------------------------------------------------------ - /// - /// עCעһ{0 0} - /// - void RegisterMethods(const luaL_Reg *l); - void GetField(int idx, cc8* name); void GetField(int idx, int key); std::string GetField(int idx, cc8* key, cc8* value); @@ -126,6 +124,7 @@ namespace Luax void DoFile(const std::string& file); //------------------------------------------------------------------------------------------------------------ + // ע᷽ /// /// עṤͨ࣬New @@ -142,9 +141,33 @@ namespace Luax /// void RegisterEnum(cc8* name, LuaxEnum* enums); + /// + /// עCעһ{0 0} + /// + void RegisterMethods(const luaL_Reg *l); + + /// + /// עᵥC + /// + void RegisterMethod(cc8* fname, lua_CFunction func); + + /// + /// preloaderӵpackage.preloadrequire"libname"ʱlualoader_preloadlibnameҵpreloaderֱӼء + /// ʵҪrequireʱżأҼعһκpackage.loaded¼´βټءͨrequire + /// preloader + /// + void RegisterPreloader(cc8* libname, lua_CFunction preloader); + + /// + /// luaL_Reglib table_Gpackage.loadedlibnameָlib table + /// + void RegisterLib(cc8* libname, const luaL_Reg* l); + + //------------------------------------------------------------------------------------------------------------ + private: - friend class Context; + friend class LuaxContext; LuaxState(lua_State* state); LuaxState(const LuaxState& state); |
