The Battle for Wesnoth  1.15.12+dev
Classes | Functions
lua_check_impl Namespace Reference

Classes

struct  is_container
 
struct  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  is_map
 
struct  is_map< T, std::void_t< typename std::decay_t< T >::key_type, typename std::decay_t< T >::mapped_type > >
 
struct  is_pair
 
struct  is_pair< T, std::void_t< typename std::decay_t< T >::first_type, typename std::decay_t< T >::second_type > >
 

Functions

template<typename T >
std::enable_if_t< std::is_same_v< T, lua_index_raw >, lua_index_rawlua_check (lua_State *L, int n)
 
template<typename T >
std::enable_if_t< std::is_same_v< T, lua_index_raw >, lua_index_rawlua_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 (lua_State *L, int n)
 
template<typename T >
std::enable_if_t< std::is_same_v< T, std::string >, void > 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 (lua_State *L, int n)
 
template<typename T >
std::enable_if_t< std::is_same_v< T, std::string_view >, std::string_view > 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_push (lua_State *L, const T &val)
 
template<typename T >
std::enable_if_t< std::is_same_v< T, config >, configlua_check (lua_State *L, int n)
 
template<typename T >
std::enable_if_t< std::is_same_v< T, config >, void > 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 (lua_State *L, int n)
 
template<typename T >
std::enable_if_t< std::is_same_v< T, map_location >, map_locationlua_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_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 (lua_State *L, int n)
 
template<typename T >
std::enable_if_t< std::is_base_of_v< enum_tag, T >, T > 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_push (lua_State *L, T val)
 
template<typename T >
std::enable_if_t< std::is_same_v< T, t_string >, t_stringlua_check (lua_State *L, int n)
 
template<typename T >
std::enable_if_t< std::is_same_v< T, t_string >, void > 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_push (lua_State *L, gui2::widget &val)
 
template<typename T >
std::enable_if_t< std::is_same_v< T, bool >, bool > lua_check (lua_State *L, int n)
 
template<typename T >
std::enable_if_t< std::is_same_v< T, bool >, bool > 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_push (lua_State *L, bool val)
 
template<typename T >
std::enable_if_t< std::is_floating_point_v< T >, T > lua_check (lua_State *L, int n)
 
template<typename T >
std::enable_if_t< std::is_floating_point_v< T >, T > 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_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 (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_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_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 (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_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 (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_push (lua_State *L, const T &list)
 
template<typename T >
std::enable_if_t< is_map< T >::value, void > lua_push (lua_State *L, const T &map)
 

Function Documentation

◆ lua_check() [1/12]

template<typename T >
std::enable_if_t<std::is_same_v<T, lua_index_raw>, lua_index_raw> lua_check_impl::lua_check ( lua_State L,
int  n 
)

Definition at line 66 of file push_check.hpp.

References UNUSED.

Referenced by lua_check().

◆ lua_check() [2/12]

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 
)

Definition at line 82 of file push_check.hpp.

References luaL_checkstring.

◆ lua_check() [3/12]

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 
)

Definition at line 96 of file push_check.hpp.

References luaW_tostring().

◆ lua_check() [4/12]

template<typename T >
std::enable_if_t<std::is_same_v<T, config>, config> lua_check_impl::lua_check ( lua_State L,
int  n 
)

Definition at line 116 of file push_check.hpp.

References luaW_checkconfig().

◆ lua_check() [5/12]

template<typename T >
std::enable_if_t<std::is_same_v<T, map_location>, map_location> lua_check_impl::lua_check ( lua_State L,
int  n 
)

Definition at line 130 of file push_check.hpp.

References luaW_checklocation().

◆ lua_check() [6/12]

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 
)

Definition at line 154 of file push_check.hpp.

References luaL_argerror(), and n.

◆ lua_check() [7/12]

template<typename T >
std::enable_if_t<std::is_same_v<T, t_string>, t_string> lua_check_impl::lua_check ( lua_State L,
int  n 
)

Definition at line 186 of file push_check.hpp.

References luaW_checktstring().

◆ lua_check() [8/12]

template<typename T >
std::enable_if_t<std::is_same_v<T, bool>, bool> lua_check_impl::lua_check ( lua_State L,
int  n 
)

Definition at line 209 of file push_check.hpp.

References luaW_toboolean().

◆ lua_check() [9/12]

template<typename T >
std::enable_if_t<std::is_floating_point_v<T>, T> lua_check_impl::lua_check ( lua_State L,
int  n 
)

Definition at line 229 of file push_check.hpp.

References luaL_checknumber().

◆ lua_check() [10/12]

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 
)

Definition at line 254 of file push_check.hpp.

References luaL_checkinteger().

◆ lua_check() [11/12]

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 
)

Definition at line 281 of file push_check.hpp.

References lua_istable, lua_pop, and lua_rawgeti().

◆ lua_check() [12/12]

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 
)

Definition at line 307 of file push_check.hpp.

References i, lua_check(), lua_istable, lua_pop, lua_rawgeti(), lua_rawlen(), and luaL_argerror().

◆ lua_push() [1/13]

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 
)

Definition at line 88 of file push_check.hpp.

References lua_pushlstring().

Referenced by lua_push().

◆ lua_push() [2/13]

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 
)

Definition at line 108 of file push_check.hpp.

References lua_pushlstring().

◆ lua_push() [3/13]

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 
)

Definition at line 122 of file push_check.hpp.

References luaW_pushconfig().

◆ lua_push() [4/13]

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 
)

Definition at line 146 of file push_check.hpp.

References luaW_pushlocation().

◆ lua_push() [5/13]

template<typename T >
std::enable_if_t<std::is_base_of_v<enum_tag, T>, void> lua_check_impl::lua_push ( lua_State L,
val 
)

Definition at line 178 of file push_check.hpp.

References lua_push().

◆ lua_push() [6/13]

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 
)

Definition at line 192 of file push_check.hpp.

References luaW_pushtstring().

◆ lua_push() [7/13]

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 
)

Definition at line 201 of file push_check.hpp.

References luaW_pushwidget().

◆ lua_push() [8/13]

template<typename T >
std::enable_if_t<std::is_same_v<T, bool>, void> lua_check_impl::lua_push ( lua_State L,
bool  val 
)

Definition at line 221 of file push_check.hpp.

References lua_pushboolean().

◆ lua_push() [9/13]

template<typename T >
std::enable_if_t<std::is_floating_point_v<T>, void> lua_check_impl::lua_push ( lua_State L,
val 
)

Definition at line 246 of file push_check.hpp.

References lua_pushnumber().

◆ lua_push() [10/13]

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,
val 
)

Definition at line 272 of file push_check.hpp.

References lua_pushinteger().

◆ lua_push() [11/13]

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 
)

Definition at line 295 of file push_check.hpp.

References lua_newtable, and lua_rawseti().

◆ lua_push() [12/13]

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 
)

Definition at line 340 of file push_check.hpp.

References i, lua_createtable(), and lua_rawseti().

◆ lua_push() [13/13]

template<typename T >
std::enable_if_t<is_map<T>::value, void> lua_check_impl::lua_push ( lua_State L,
const T &  map 
)

Definition at line 356 of file push_check.hpp.

References lua_newtable, and lua_settable().

◆ lua_to_or_default() [1/7]

template<typename T >
std::enable_if_t<std::is_same_v<T, lua_index_raw>, lua_index_raw> lua_check_impl::lua_to_or_default ( lua_State L,
int  n,
const T &   
)

Definition at line 73 of file push_check.hpp.

References UNUSED.

◆ lua_to_or_default() [2/7]

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 
)

Definition at line 102 of file push_check.hpp.

References luaW_tostring_or_default().

◆ lua_to_or_default() [3/7]

template<typename T >
std::enable_if_t<std::is_same_v<T, map_location>, map_location> lua_check_impl::lua_to_or_default ( lua_State L,
int  n,
const T &  def 
)

Definition at line 136 of file push_check.hpp.

References luaW_tolocation().

◆ lua_to_or_default() [4/7]

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 
)

Definition at line 166 of file push_check.hpp.

References n.

◆ lua_to_or_default() [5/7]

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 &   
)

Definition at line 215 of file push_check.hpp.

References luaW_toboolean().

◆ lua_to_or_default() [6/7]

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 
)

Definition at line 235 of file push_check.hpp.

References d, and lua_tonumberx().

◆ lua_to_or_default() [7/7]

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 
)

Definition at line 260 of file push_check.hpp.

References lua_tointegerx().