dl
dl::LuaScript类 参考

lua脚本语言 更多...

#include <dl_lua.h>

struct  Env
 

Public 成员函数

 LuaScript ()
 
 ~LuaScript ()
 
void SetPathRoot (std::string_view str)
 设置加载根路径
 
bool DoString (std::string_view str)
 执行lua字符串
 
bool DoFile (std::string_view path_name)
 执行lua文件
 
bool DoFileEx (std::string_view path_name, LuaRef &ret)
 执行lua文件,并获取返回值
 
bool CallFunction (LuaRef func)
 调用函数
 
std::string GetRefString (LuaRef ref)
 返回lua对象字符串
 
EnvGetEnv ()
 
lua_State * GetL ()
 
void RegisterAll ()
 

详细描述

lua脚本语言

在文件 dl_lua.h38 行定义.

构造及析构函数说明

◆ LuaScript()

dl::LuaScript::LuaScript ( )

◆ ~LuaScript()

dl::LuaScript::~LuaScript ( )

成员函数说明

◆ CallFunction()

bool dl::LuaScript::CallFunction ( LuaRef func)

调用函数

参数
[in]funclua对象(函数)
注解
失败会打印日志

◆ DoFile()

bool dl::LuaScript::DoFile ( std::string_view path_name)

执行lua文件

◆ DoFileEx()

bool dl::LuaScript::DoFileEx ( std::string_view path_name,
LuaRef & ret )

执行lua文件,并获取返回值

◆ DoString()

bool dl::LuaScript::DoString ( std::string_view str)

执行lua字符串

◆ GetEnv()

Env & dl::LuaScript::GetEnv ( )
inline

在文件 dl_lua.h106 行定义.

◆ GetL()

lua_State * dl::LuaScript::GetL ( )
inline

在文件 dl_lua.h107 行定义.

◆ GetRefString()

std::string dl::LuaScript::GetRefString ( LuaRef ref)

返回lua对象字符串

参数
[in]funclua对象(函数、字符串)
返回值
失败返回空(不会打印)

◆ RegisterAll()

void dl::LuaScript::RegisterAll ( )

◆ SetPathRoot()

void dl::LuaScript::SetPathRoot ( std::string_view str)
inline

设置加载根路径

在文件 dl_lua.h51 行定义.


该类的文档由以下文件生成: