18#include <unordered_map>
20#define LUA_USE_APICHECK
24#define LUABRIDGE_DISABLE_CXX20_SPAN
26#include <LuaBridge/LuaBridge.h>
35 using luabridge::LuaRef;
51 void SetPathRoot(std::string_view str) { _pathRoot = std::string{ str }; }
60 bool DoFile(std::string_view path_name);
64 bool DoFileEx(std::string_view path_name, LuaRef& ret);
107 lua_State*
GetL() {
return L; }
114 std::string _pathRoot;
bool DoFile(std::string_view path_name)
执行lua文件
void SetPathRoot(std::string_view str)
设置加载根路径
bool DoString(std::string_view str)
执行lua字符串
bool DoFileEx(std::string_view path_name, LuaRef &ret)
执行lua文件,并获取返回值
bool CallFunction(LuaRef func)
调用函数
std::string GetRefString(LuaRef ref)
返回lua对象字符串