[ref]同步711

This commit is contained in:
shi_jq 2025-03-13 14:18:52 +08:00
parent 3068cba07f
commit 2f0cba37f1
2 changed files with 34 additions and 16 deletions

View File

@ -24,22 +24,9 @@ bool CCalcLua::initialize()
m_error = "错误:初始化lua环境失败!";
return false;
}
luabridge::getGlobalNamespace(lua_state)
.beginNamespace ("kbd")
.addFunction ("getDataByIndex",&CCalcLua::getDataByIndex)
.endNamespace ();
luabridge::getGlobalNamespace(lua_state)
.beginNamespace ("kbd")
.addFunction ("getInParamNum",&CCalcLua::getInParamNum)
.endNamespace ();
luabridge::getGlobalNamespace(lua_state)
.beginNamespace ("kbd")
.addFunction ("getBitAnd",&CCalcLua::getBitAnd)
.endNamespace ();
luabridge::getGlobalNamespace(lua_state)
.beginNamespace ("kbd")
.addFunction ("getBitOr",&CCalcLua::getBitOr)
.endNamespace ();
registFunctionToLua();
return true;
}
@ -217,3 +204,22 @@ bool CCalcLua::release()
}
return true;
}
void CCalcLua::registFunctionToLua()
{
luabridge::getGlobalNamespace(lua_state)
.beginNamespace ("kbd")
.addFunction ("getDataByIndex",&CCalcLua::getDataByIndex)
.addFunction ("getInParamNum",&CCalcLua::getInParamNum)
.addFunction ("getBitAnd",&CCalcLua::getBitAnd)
.addFunction ("getBitOr",&CCalcLua::getBitOr)
.endNamespace ();
luabridge::getGlobalNamespace(lua_state)
.beginNamespace ("iot")
.addFunction ("getDataByIndex",&CCalcLua::getDataByIndex)
.addFunction ("getInParamNum",&CCalcLua::getInParamNum)
.addFunction ("getBitAnd",&CCalcLua::getBitAnd)
.addFunction ("getBitOr",&CCalcLua::getBitOr)
.endNamespace ();
}

View File

@ -1,6 +1,18 @@

#include "CCommonConfigParse.h"
//< 屏蔽xml_parser编译告警
#ifdef __GNUC__
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdeprecated-copy"
#endif
#include "boost/property_tree/xml_parser.hpp"
#ifdef __GNUC__
#pragma GCC diagnostic pop
#endif
#include "boost/typeof/typeof.hpp"
#include "boost/filesystem.hpp"
#include "Common.h"