summaryrefslogtreecommitdiff
path: root/Source/3rdParty/Luax/luax_state.h
diff options
context:
space:
mode:
Diffstat (limited to 'Source/3rdParty/Luax/luax_state.h')
-rw-r--r--Source/3rdParty/Luax/luax_state.h39
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.preloadrequire"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);