Result.h
1/* Copyright (C) 2020-2026 by Marc Boris Duerner
2 SPDX-License-Identifier: LGPL-2.1-or-later WITH mif-exception
3*/
4
5#ifndef PT_LUA_RESULT_H
6#define PT_LUA_RESULT_H
7
8#include <Pt/Lua/Api.h>
9#include <string>
10
11struct lua_State;
12
13namespace Pt {
14
15namespace Lua {
16
30class PT_LUA_API Result
31{
32 public:
36
39 explicit Result(lua_State* L);
40
43 int get(const std::string& name) const;
44
45 private:
46 lua_State* _L;
47};
48
49} // namespace
50
51} // namespace
52
53#endif // include guard
int get(const std::string &name) const
Returns the integer value of the global name.
Result()
Creates a result with no Lua state.
Result(lua_State *L)
Creates a result that reads globals from L.
Lua runtime and reflected bindings.
Core module.
Definition Allocator.h:33