$darkmode
lua_setup.hpp File Reference
#include <iostream>
#include <memory>
#include <optional>
#include <string>
#include <vector>
#include <sol/state.hpp>
#include <sol/state_view.hpp>
#include <sol/table.hpp>
#include <fable/environment.hpp>
Include dependency graph for lua_setup.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  cloe::LuaOptions
 

Functions

void cloe::setup_lua (sol::state_view lua, const LuaOptions &opt, Stack &stack)
 
void cloe::merge_lua (sol::state_view lua, const std::string &filepath)
 
void cloe::register_lib_fs (sol::table &lua)
 
void cloe::register_usertype_duration (sol::table &lua)
 
void cloe::register_usertype_sync (sol::table &lua)
 
void cloe::register_usertype_stack (sol::table &lua)
 

Detailed Description

This file contains function definitions required to set up the Lua API.

Function Documentation

◆ merge_lua()

void cloe::merge_lua ( sol::state_view  lua,
const std::string &  filepath 
)

Merge the provided Lua file into the existing Stack, respecting StackOptions.

See also
lua_setup.cpp

◆ register_lib_fs()

void cloe::register_lib_fs ( sol::table &  lua)

Define the filesystem library functions in the given table.

The following functions are made available:

  • basename
  • dirname
  • normalize
  • realpath
  • join
  • is_absolute
  • is_relative
  • is_dir
  • is_file
  • is_other
  • exists
See also
lua_setup_fs.cpp
Here is the call graph for this function:
Here is the caller graph for this function:

◆ register_usertype_duration()

void cloe::register_usertype_duration ( sol::table &  lua)

Define cloe::Duration usertype in Lua.

See also
cloe/core/duration.hpp from cloe-runtime
lua_setup_duration.cpp
Here is the call graph for this function:
Here is the caller graph for this function:

◆ register_usertype_stack()

void cloe::register_usertype_stack ( sol::table &  lua)

Define cloe::Stack usertype in Lua.

See also
clua_setup_stack.cpp
Here is the call graph for this function:
Here is the caller graph for this function:

◆ register_usertype_sync()

void cloe::register_usertype_sync ( sol::table &  lua)

Define cloe::Sync usertype in Lua.

See also
cloe/sync.hpp from cloe-runtime
lua_setup_sync.cpp
Here is the call graph for this function:
Here is the caller graph for this function:

◆ setup_lua()

void cloe::setup_lua ( sol::state_view  lua,
const LuaOptions opt,
Stack &  s 
)

Create a new lua state.

Currently this requires a fully configured Stack file.

See also
cloe::new_stack()
stack_factory.hpp
lua_setup.cpp