The Battle for Wesnoth  1.15.12+dev
Classes | Namespaces | Functions
push_check.hpp File Reference
#include "scripting/lua_common.hpp"
#include "scripting/lua_widget.hpp"
#include "global.hpp"
#include "tstring.hpp"
#include "map/location.hpp"
#include "lua/lauxlib.h"
#include "lua/lua.h"
#include <cassert>
#include <string_view>
#include <type_traits>
Include dependency graph for push_check.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  lua_index_raw
 
struct  lua_check_impl::is_container< T, T2 >
 
struct  lua_check_impl::is_container< T, std::void_t< typename std::decay_t< T >::value_type, typename std::decay_t< T >::iterator, typename std::decay_t< T >::size_type, typename std::decay_t< T >::reference > >
 
struct  lua_check_impl::is_map< T, T2 >
 
struct  lua_check_impl::is_map< T, std::void_t< typename std::decay_t< T >::key_type, typename std::decay_t< T >::mapped_type > >
 
struct  lua_check_impl::is_pair< T, T2 >
 
struct  lua_check_impl::is_pair< T, std::void_t< typename std::decay_t< T >::first_type, typename std::decay_t< T >::second_type > >
 

Namespaces

 lua_check_impl
 

Functions

template<typename T >
std::enable_if_t< std::is_same_v< T, lua_index_raw >, lua_index_rawlua_check_impl::lua_check (lua_State *L, int n)
 
template<typename T >
std::enable_if_t< std::is_same_v< T, lua_index_raw >, lua_index_rawlua_check_impl::lua_to_or_default (lua_State *L, int n, const T &)
 
template<typename T >
std::enable_if_t< std::is_same_v< T, std::string >, std::string > lua_check_impl::lua_check (lua_State *L, int n)
 
template<typename T >
std::enable_if_t< std::is_same_v< T, std::string >, void > lua_check_impl::lua_push (lua_State *L, const T &val)
 
template<typename T >
std::enable_if_t< std::is_same_v< T, std::string_view >, std::string_view > lua_check_impl::lua_check (lua_State *L, int n)
 
template<typename T >
std::enable_if_t< std::is_same_v< T, std::string_view >, std::string_view > lua_check_impl::lua_to_or_default (lua_State *L, int n, const T &def)
 
template<typename T >
std::enable_if_t< std::is_same_v< T, std::string_view >, void > lua_check_impl::lua_push (lua_State *L, const T &val)
 
template<typename T >
std::enable_if_t< std::is_same_v< T, config >, configlua_check_impl::lua_check (lua_State *L, int n)
 
template<typename T >
std::enable_if_t< std::is_same_v< T, config >, void > lua_check_impl::lua_push (lua_State *L, const config &val)
 
template<typename T >
std::enable_if_t< std::is_same_v< T, map_location >, map_locationlua_check_impl::lua_check (lua_State *L, int n)
 
template<typename T >
std::enable_if_t< std::is_same_v< T, map_location >, map_locationlua_check_impl::lua_to_or_default (lua_State *L, int n, const T &def)
 
template<typename T >
std::enable_if_t< std::is_same_v< T, map_location >, void > lua_check_impl::lua_push (lua_State *L, const map_location &val)
 
template<typename T >
std::enable_if_t< std::is_base_of_v< enum_tag, T >, T > lua_check_impl::lua_check (lua_State *L, int n)
 
template<typename T >
std::enable_if_t< std::is_base_of_v< enum_tag, T >, T > lua_check_impl::lua_to_or_default (lua_State *L, int n, const T &def)
 
template<typename T >
std::enable_if_t< std::is_base_of_v< enum_tag, T >, void > lua_check_impl::lua_push (lua_State *L, T val)
 
template<typename T >
std::enable_if_t< std::is_same_v< T, t_string >, t_stringlua_check_impl::lua_check (lua_State *L, int n)
 
template<typename T >
std::enable_if_t< std::is_same_v< T, t_string >, void > lua_check_impl::lua_push (lua_State *L, const t_string &val)
 
template<typename T >
std::enable_if_t< std::is_same_v< T, gui2::widget >, void > lua_check_impl::lua_push (lua_State *L, gui2::widget &val)
 
template<typename T >
std::enable_if_t< std::is_same_v< T, bool >, bool > lua_check_impl::lua_check (lua_State *L, int n)
 
template<typename T >
std::enable_if_t< std::is_same_v< T, bool >, bool > lua_check_impl::lua_to_or_default (lua_State *L, int n, const T &)
 
template<typename T >
std::enable_if_t< std::is_same_v< T, bool >, void > lua_check_impl::lua_push (lua_State *L, bool val)
 
template<typename T >
std::enable_if_t< std::is_floating_point_v< T >, T > lua_check_impl::lua_check (lua_State *L, int n)
 
template<typename T >
std::enable_if_t< std::is_floating_point_v< T >, T > lua_check_impl::lua_to_or_default (lua_State *L, int n, const T &def)
 
template<typename T >
std::enable_if_t< std::is_floating_point_v< T >, void > lua_check_impl::lua_push (lua_State *L, T val)
 
template<typename T >
std::enable_if_t< std::is_integral_v< T > &&!std::is_same_v< T, bool >, T > lua_check_impl::lua_check (lua_State *L, int n)
 
template<typename T >
std::enable_if_t< std::is_integral_v< T > &&!std::is_same_v< T, bool >, T > lua_check_impl::lua_to_or_default (lua_State *L, int n, const T &def)
 
template<typename T >
std::enable_if_t< std::is_integral_v< T > &&!std::is_same_v< T, bool >, void > lua_check_impl::lua_push (lua_State *L, T val)
 
template<typename T >
std::enable_if_t< is_pair< T >::value &&!std::is_const_v< typename T::first_type >, T > lua_check_impl::lua_check (lua_State *L, int n)
 
template<typename T >
std::enable_if_t< is_pair< T >::value &&!std::is_const_v< typename T::first_type >, void > lua_check_impl::lua_push (lua_State *L, const T &val)
 
template<typename T >
std::enable_if_t< is_container< T >::value &&!std::is_same_v< T, std::string > &&!std::is_same_v< T, std::string_view >, T > lua_check_impl::lua_check (lua_State *L, int n)
 
template<typename T >
std::enable_if_t< is_container< T >::value &&!std::is_same_v< T, std::string > &&!std::is_same_v< T, std::string_view > &&!is_map< T >::value, void > lua_check_impl::lua_push (lua_State *L, const T &list)
 
template<typename T >
std::enable_if_t< is_map< T >::value, void > lua_check_impl::lua_push (lua_State *L, const T &map)
 
template<typename T >
std::decay_t< T > lua_check (lua_State *L, int n)
 
template<typename T >
std::decay_t< T > lua_to_or_default (lua_State *L, int n, const T &def)
 
template<typename T >
void lua_push (lua_State *L, const T &val)
 
template<typename T >
std::decay_t< T > luaW_table_get_def (lua_State *L, int index, std::string_view k, const T &def)
 returns t[k] where k is the table at index index and k is k or def if it is not convertible to the correct type. More...
 
template<typename T >
void luaW_table_set (lua_State *L, int index, std::string_view k, const T &value)
 

Function Documentation

◆ lua_check()

template<typename T >
std::decay_t<T> lua_check ( lua_State L,
int  n 
)

Definition at line 370 of file push_check.hpp.

References n.

◆ lua_push()

template<typename T >
void lua_push ( lua_State L,
const T &  val 
)

◆ lua_to_or_default()

template<typename T >
std::decay_t<T> lua_to_or_default ( lua_State L,
int  n,
const T &  def 
)

Definition at line 377 of file push_check.hpp.

References n.

◆ luaW_table_get_def()

template<typename T >
std::decay_t<T> luaW_table_get_def ( lua_State L,
int  index,
std::string_view  k,
const T &  def 
)

returns t[k] where k is the table at index index and k is k or def if it is not convertible to the correct type.

Definition at line 394 of file push_check.hpp.

References lua_index_raw::index, lua_gettable(), lua_isnoneornil, lua_istable, lua_pop, lua_pushlstring(), and luaL_argerror().

Referenced by lua_stringx::intf_str_map_split(), lua_stringx::intf_str_split(), and intf_terrain_mask().

◆ luaW_table_set()

template<typename T >
void luaW_table_set ( lua_State L,
int  index,
std::string_view  k,
const T &  value 
)