The Battle for Wesnoth  1.15.0-dev
Namespaces | Classes | Typedefs | Functions
lua_check_impl Namespace Reference

Namespaces

 detail
 

Classes

struct  is_container
 
struct  is_map
 
struct  is_pair
 

Typedefs

template<typename T >
using remove_constref = std::remove_const_t< std::remove_reference_t< std::remove_const_t< T > >>
 

Functions

template<typename T >
std::enable_if_t< std::is_same< T, std::string >::value, std::string > lua_check (lua_State *L, int n)
 
template<typename T >
std::enable_if_t< std::is_same< T, std::string >::value, void > lua_push (lua_State *L, const T &val)
 
template<typename T >
std::enable_if_t< std::is_same< T, utils::string_view >::value, utils::string_viewlua_check (lua_State *L, int n)
 
template<typename T >
std::enable_if_t< std::is_same< T, utils::string_view >::value, utils::string_viewlua_to_or_default (lua_State *L, int n, const T &def)
 
template<typename T >
std::enable_if_t< std::is_same< T, utils::string_view >::value, void > lua_push (lua_State *L, const T &val)
 
template<typename T >
std::enable_if_t< std::is_same< T, config >::value, configlua_check (lua_State *L, int n)
 
template<typename T >
std::enable_if_t< std::is_same< T, config >::value, void > lua_push (lua_State *L, const config &val)
 
template<typename T >
std::enable_if_t< std::is_same< T, map_location >::value, map_locationlua_check (lua_State *L, int n)
 
template<typename T >
std::enable_if_t< std::is_same< T, map_location >::value, map_locationlua_to_or_default (lua_State *L, int n, const T &def)
 
template<typename T >
std::enable_if_t< std::is_same< T, map_location >::value, void > lua_push (lua_State *L, const map_location &val)
 
template<typename T >
std::enable_if_t< std::is_base_of< enum_tag, T >::value, T > lua_check (lua_State *L, int n)
 
template<typename T >
std::enable_if_t< std::is_base_of< enum_tag, T >::value, T > lua_to_or_default (lua_State *L, int n, const T &def)
 
template<typename T >
std::enable_if_t< std::is_base_of< enum_tag, T >::value, void > lua_push (lua_State *L, T val)
 
template<typename T >
std::enable_if_t< std::is_same< T, t_string >::value, t_stringlua_check (lua_State *L, int n)
 
template<typename T >
std::enable_if_t< std::is_same< T, t_string >::value, void > lua_push (lua_State *L, const t_string &val)
 
template<typename T >
std::enable_if_t< std::is_same< T, bool >::value, bool > lua_check (lua_State *L, int n)
 
template<typename T >
std::enable_if_t< std::is_same< T, bool >::value, bool > lua_to_or_default (lua_State *L, int n, const T &)
 
template<typename T >
std::enable_if_t< std::is_same< T, bool >::value, void > lua_push (lua_State *L, bool val)
 
template<typename T >
std::enable_if_t< std::is_floating_point< T >::value, T > lua_check (lua_State *L, int n)
 
template<typename T >
std::enable_if_t< std::is_floating_point< T >::value, T > lua_to_or_default (lua_State *L, int n, const T &def)
 
template<typename T >
std::enable_if_t< std::is_floating_point< T >::value, void > lua_push (lua_State *L, T val)
 
template<typename T >
std::enable_if_t< std::is_integral< T >::value &&!std::is_same< T, bool >::value, T > lua_check (lua_State *L, int n)
 
template<typename T >
std::enable_if_t< std::is_integral< T >::value &&!std::is_same< T, bool >::value, T > lua_to_or_default (lua_State *L, int n, const T &def)
 
template<typename T >
std::enable_if_t< std::is_integral< T >::value &&!std::is_same< T, bool >::value, void > lua_push (lua_State *L, T val)
 
template<typename T >
std::enable_if_t< is_pair< T >::value &&!std::is_const< typename T::first_type >::value, T > lua_check (lua_State *L, int n)
 
template<typename T >
std::enable_if_t< is_pair< T >::value &&!std::is_const< typename T::first_type >::value, void > lua_push (lua_State *L, const T &val)
 
template<typename T >
std::enable_if_t< is_container< T >::value &&!std::is_same< T, std::string >::value, T > lua_check (lua_State *L, int n)
 
template<typename T >
std::enable_if_t< is_container< T >::value &&!std::is_same< T, std::string >::value &&!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)
 

Typedef Documentation

◆ remove_constref

template<typename T >
using lua_check_impl::remove_constref = typedef std::remove_const_t<std::remove_reference_t<std::remove_const_t<T> >>

Definition at line 73 of file push_check.hpp.

Function Documentation

◆ lua_check() [1/11]

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

Definition at line 78 of file push_check.hpp.

References luaL_checkstring.

Referenced by lua_check().

◆ lua_check() [2/11]

template<typename T >
std::enable_if_t<std::is_same<T, utils::string_view>::value, utils::string_view> lua_check_impl::lua_check ( lua_State L,
int  n 
)

Definition at line 92 of file push_check.hpp.

References luaW_tostring().

◆ lua_check() [3/11]

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

Definition at line 112 of file push_check.hpp.

References luaW_checkconfig().

◆ lua_check() [4/11]

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

Definition at line 126 of file push_check.hpp.

References luaW_checklocation().

◆ lua_check() [5/11]

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

Definition at line 150 of file push_check.hpp.

References luaL_argerror(), n, and name().

◆ lua_check() [6/11]

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

Definition at line 182 of file push_check.hpp.

References luaW_checktstring().

◆ lua_check() [7/11]

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

Definition at line 196 of file push_check.hpp.

References luaW_toboolean().

◆ lua_check() [8/11]

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

Definition at line 216 of file push_check.hpp.

References luaL_checknumber().

◆ lua_check() [9/11]

template<typename T >
std::enable_if_t<std::is_integral<T>::value && !std::is_same<T, bool>::value, T> lua_check_impl::lua_check ( lua_State L,
int  n 
)

Definition at line 241 of file push_check.hpp.

References luaL_checkinteger().

◆ lua_check() [10/11]

template<typename T >
std::enable_if_t<is_pair<T>::value && !std::is_const<typename T::first_type>::value, T> lua_check_impl::lua_check ( lua_State L,
int  n 
)

Definition at line 268 of file push_check.hpp.

References lua_istable, lua_pop, and lua_rawgeti().

◆ lua_check() [11/11]

template<typename T >
std::enable_if_t<is_container<T>::value && !std::is_same<T, std::string>::value, T> lua_check_impl::lua_check ( lua_State L,
int  n 
)

Definition at line 294 of file push_check.hpp.

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

◆ lua_push() [1/12]

template<typename T >
std::enable_if_t<std::is_same<T, std::string>::value, void> lua_check_impl::lua_push ( lua_State L,
const T &  val 
)

Definition at line 84 of file push_check.hpp.

References lua_pushlstring().

Referenced by lua_push().

◆ lua_push() [2/12]

template<typename T >
std::enable_if_t<std::is_same<T, utils::string_view>::value, void> lua_check_impl::lua_push ( lua_State L,
const T &  val 
)

Definition at line 104 of file push_check.hpp.

References lua_pushlstring().

◆ lua_push() [3/12]

template<typename T >
std::enable_if_t<std::is_same<T, config>::value, void> lua_check_impl::lua_push ( lua_State L,
const config val 
)

Definition at line 118 of file push_check.hpp.

References luaW_pushconfig().

◆ lua_push() [4/12]

template<typename T >
std::enable_if_t<std::is_same<T, map_location>::value, void> lua_check_impl::lua_push ( lua_State L,
const map_location val 
)

Definition at line 142 of file push_check.hpp.

References luaW_pushlocation().

◆ lua_push() [5/12]

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

Definition at line 174 of file push_check.hpp.

References lua_push().

◆ lua_push() [6/12]

template<typename T >
std::enable_if_t<std::is_same<T, t_string>::value, void> lua_check_impl::lua_push ( lua_State L,
const t_string val 
)

Definition at line 188 of file push_check.hpp.

References luaW_pushtstring().

◆ lua_push() [7/12]

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

Definition at line 208 of file push_check.hpp.

References lua_pushboolean().

◆ lua_push() [8/12]

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

Definition at line 233 of file push_check.hpp.

References lua_pushnumber().

◆ lua_push() [9/12]

template<typename T >
std::enable_if_t<std::is_integral<T>::value && !std::is_same<T, bool>::value, void> lua_check_impl::lua_push ( lua_State L,
val 
)

Definition at line 259 of file push_check.hpp.

References lua_pushnumber().

◆ lua_push() [10/12]

template<typename T >
std::enable_if_t<is_pair<T>::value && !std::is_const<typename T::first_type>::value, void> lua_check_impl::lua_push ( lua_State L,
const T &  val 
)

Definition at line 282 of file push_check.hpp.

References lua_newtable, and lua_rawseti().

◆ lua_push() [11/12]

template<typename T >
std::enable_if_t< is_container<T>::value && !std::is_same<T, std::string>::value && !is_map<T>::value , void > lua_check_impl::lua_push ( lua_State L,
const T &  list 
)

Definition at line 327 of file push_check.hpp.

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

◆ lua_push() [12/12]

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 343 of file push_check.hpp.

References lua_newtable, and lua_settable().

◆ lua_to_or_default() [1/6]

template<typename T >
std::enable_if_t<std::is_same<T, utils::string_view>::value, utils::string_view> lua_check_impl::lua_to_or_default ( lua_State L,
int  n,
const T &  def 
)

Definition at line 98 of file push_check.hpp.

References luaW_tostring_or_default().

◆ lua_to_or_default() [2/6]

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

Definition at line 132 of file push_check.hpp.

References luaW_tolocation().

◆ lua_to_or_default() [3/6]

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

Definition at line 162 of file push_check.hpp.

References n.

◆ lua_to_or_default() [4/6]

template<typename T >
std::enable_if_t<std::is_same<T, bool>::value, bool> lua_check_impl::lua_to_or_default ( lua_State L,
int  n,
const T &   
)

Definition at line 202 of file push_check.hpp.

References luaW_toboolean().

◆ lua_to_or_default() [5/6]

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

Definition at line 222 of file push_check.hpp.

References d, and lua_tonumberx().

◆ lua_to_or_default() [6/6]

template<typename T >
std::enable_if_t<std::is_integral<T>::value && !std::is_same<T, bool>::value, T> lua_check_impl::lua_to_or_default ( lua_State L,
int  n,
const T &  def 
)

Definition at line 247 of file push_check.hpp.

References lua_tointegerx().