29 lines
633 B
C++
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;
|
|
};
|