cl3/include/lua/loader.hpp
Timofey Khoruzhii 7d09ff10c2
Some checks failed
Clang-format Check / clang-format-check (push) Successful in 16s
Tests Check / test-check (push) Failing after 2m20s
add include
2023-05-09 02:16:27 +03:00

30 lines
655 B
C++

#pragma once
#include <lua.hpp>
#include <vector>
#include <string>
#include <functional>
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;
};