2 Star 4 Fork 3

Jally/fusion

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
LuaMgr.h 786 Bytes
一键复制 编辑 原始数据 按行查看 历史
Jally 提交于 6年前 . 同步代码
#pragma once
#include "Singleton.h"
#include <lua.hpp>
#include <shared_mutex>
#include <unordered_map>
class LuaMgr : public Singleton<LuaMgr>
{
public:
LuaMgr();
virtual ~LuaMgr();
void RemoveFile(const std::string &fileName);
int LoadFile(lua_State *L, const std::string &fileName);
bool DoFile(lua_State *L, const std::string &fileName);
static void DoFileEnv(lua_State *L, const char *fileName);
private:
int CacheFile(lua_State *L, const std::string &fileName);
void DumpChunk(lua_State *L, const std::string &fileName);
static int WriteChunk(lua_State *L, const char *p, size_t sz, std::ostream *stream);
std::shared_mutex mutex_;
std::unordered_map<std::string, std::string> chunks_;
};
#define sLuaMgr (*LuaMgr::instance())
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
C++
1
https://gitee.com/jallyx/fusion.git
git@gitee.com:jallyx/fusion.git
jallyx
fusion
fusion
master

搜索帮助