Lua: Implement Utils::Lua

Change-Id: Ib5a7f63d1c37b29beb424707962d21102db5927c
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
Marcus Tillmanns
2024-05-28 12:37:08 +02:00
parent 06e08178f0
commit bd50ee7573
2 changed files with 91 additions and 0 deletions

View File

@@ -10,6 +10,7 @@
#include <utils/expected.h>
#include <utils/filepath.h>
#include <utils/lua.h>
#include <sol/sol.hpp>
@@ -108,6 +109,9 @@ public:
return {};
}
// Runs the given script in a new Lua state. The returned Object manages the lifetime of the state.
std::unique_ptr<Utils::LuaState> runScript(const QString &script, const QString &name);
protected:
Utils::expected_str<void> connectHooks(
sol::state_view lua, const sol::table &table, const QString &path);