summaryrefslogtreecommitdiff
path: root/source/3rd-party/Luax/luax_state.h
diff options
context:
space:
mode:
Diffstat (limited to 'source/3rd-party/Luax/luax_state.h')
-rw-r--r--source/3rd-party/Luax/luax_state.h33
1 files changed, 28 insertions, 5 deletions
diff --git a/source/3rd-party/Luax/luax_state.h b/source/3rd-party/Luax/luax_state.h
index fbe424b..564eba3 100644
--- a/source/3rd-party/Luax/luax_state.h
+++ b/source/3rd-party/Luax/luax_state.h
@@ -107,13 +107,17 @@ namespace Luax
///
/// void** ʽuserdataֵΪptr
///
- void PushPtrUserData(void* ptr);
+ void PushPtrUserdata(void* ptr);
void Pop(int n = 1);
void Settop(int idx);
- template<typename T> T* GetLuaUserdata(int idx = 1);
+ template<typename T> T* GetUserdata(int idx = 1);
+
+ //------------------------------------------------------------------------------------------------------------
+
+ int ErrorType(int idx, cc8* hint);
//------------------------------------------------------------------------------------------------------------
@@ -123,6 +127,9 @@ namespace Luax
template<typename T> void SetField(int idx, cc8* key, T value);
template<typename T> void SetFieldByIndex(int idx, int key, T value);
+ template<typename T> T* CheckUserdata(int idx);
+ template<typename T> T CheckParam(int idx);
+
//------------------------------------------------------------------------------------------------------------
void DoString(const std::string& code);
@@ -175,7 +182,7 @@ namespace Luax
void RegisterPlainClassRegistry(cc8* name);
#endif
-#if LUAX_ENABLE_PLAIN_ENABLE
+#if LUAX_ENABLE_PLAIN_ENUM
///
/// עᴿluaö٣Էֹ޸öֵ
///
@@ -203,7 +210,7 @@ namespace Luax
};
//--------------------------------------------------------------------------------------------------------------
- // GetValue()ģػ
+ // GetValue()ģʵ
template <> bool LuaxState::GetValue < bool >(int idx, const bool value);
template <> cc8* LuaxState::GetValue < cc8* >(int idx, const cc8* value);
@@ -219,8 +226,24 @@ namespace Luax
template <> u64 LuaxState::GetValue < u64 >(int idx, const u64 value);
template <> std::string LuaxState::GetValue < std::string >(int idx, const std::string value);
template <> const void* LuaxState::GetValue < const void* >(int idx, const void* value);
- template <> int LuaxState::GetValue < int >(int idx, int value);
+ //--------------------------------------------------------------------------------------------------------------
+ // CheckParamģʵ
+
+ template <> bool LuaxState::CheckParam < bool >(int idx);
+ template <> cc8* LuaxState::CheckParam < cc8* >(int idx);
+ template <> double LuaxState::CheckParam < double >(int idx);
+ template <> float LuaxState::CheckParam < float >(int idx);
+ template <> s8 LuaxState::CheckParam < s8 >(int idx);
+ template <> s16 LuaxState::CheckParam < s16 >(int idx);
+ template <> s32 LuaxState::CheckParam < s32 >(int idx);
+ template <> s64 LuaxState::CheckParam < s64 >(int idx);
+ template <> u8 LuaxState::CheckParam < u8 >(int idx);
+ template <> u16 LuaxState::CheckParam < u16 >(int idx);
+ template <> u32 LuaxState::CheckParam < u32 >(int idx);
+ template <> u64 LuaxState::CheckParam < u64 >(int idx);
+ template <> std::string LuaxState::CheckParam < std::string >(int idx);
+ template <> const void* LuaxState::CheckParam < const void* >(int idx);
///
/// ڳԱﴴLuaxStateԲм顣