cl3/include/lua/loader.hpp
2023-04-16 00:23:12 +03:00

29 lines
633 B
C++

#pragma once
#include <lua.hpp>
#include <vector>
#include <string>
class LuaLoader {
public:
LuaLoader();
~LuaLoader();
void AddLuaPath(const std::string&);
void AddCPath(const std::string&);
void Call(const std::string& lua_module, const std::string& function);
void LoadToGlobal(const std::string&);
std::vector<std::string> GetListScripts(const std::string&) const;
private:
void Import(const std::string&, const std::string&, int);
void LoadImpl(const std::string&);
void ForEachByStringArray(std::function<void(const std::string&)>);
void ParseRequire();
void ParseImport();
lua_State* L;
};