The Battle for Wesnoth  1.15.2+dev
Classes | Namespaces | Typedefs | Functions
push_check.hpp File Reference
#include "scripting/lua_common.hpp"
#include "serialization/string_view.hpp"
#include <type_traits>
#include <boost/mpl/not.hpp>
#include <boost/mpl/and.hpp>
#include <boost/mpl/has_xxx.hpp>
#include "tstring.hpp"
#include "map/location.hpp"
#include "lua/lauxlib.h"
#include "lua/lua.h"
#include <cassert>
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_check_impl::is_container< T, T2 >
 
struct  lua_check_impl::is_map< T, T2 >
 
struct  lua_check_impl::is_pair< T, T2 >
 

Namespaces

 lua_check_impl
 
 lua_check_impl::detail
 

Typedefs

template<typename T >
using lua_check_impl::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_impl::lua_check (lua_State *L, int n)
 
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)
 
template<typename T >
std::enable_if_t< std::is_same< T, utils::string_view >::value, utils::string_viewlua_check_impl::lua_check (lua_State *L, int n)
 
template<typename T >
std::enable_if_t< std::is_same< T, utils::string_view >::value, utils::string_viewlua_check_impl::lua_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_check_impl::lua_push (lua_State *L, const T &val)
 
template<typename T >
std::enable_if_t< std::is_same< T, config >::value, configlua_check_impl::lua_check (lua_State *L, int n)
 
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)
 
template<typename T >
std::enable_if_t< std::is_same< T, map_location >::value, map_locationlua_check_impl::lua_check (lua_State *L, int n)
 
template<typename T >
std::enable_if_t< std::is_same< T, map_location >::value, 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< T, map_location >::value, void > lua_check_impl::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_impl::lua_check (lua_State *L, int n)
 
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)
 
template<typename T >
std::enable_if_t< std::is_base_of< enum_tag, T >::value, void > lua_check_impl::lua_push (lua_State *L, T val)
 
template<typename T >
std::enable_if_t< std::is_same< T, t_string >::value, t_stringlua_check_impl::lua_check (lua_State *L, int n)
 
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)
 
template<typename T >
std::enable_if_t< std::is_same< T, bool >::value, bool > lua_check_impl::lua_check (lua_State *L, int n)
 
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 &)
 
template<typename T >
std::enable_if_t< std::is_same< T, bool >::value, void > lua_check_impl::lua_push (lua_State *L, bool val)
 
template<typename T >
std::enable_if_t< std::is_floating_point< T >::value, T > lua_check_impl::lua_check (lua_State *L, int n)
 
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)
 
template<typename T >
std::enable_if_t< std::is_floating_point< T >::value, void > lua_check_impl::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_impl::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_check_impl::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_check_impl::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_impl::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_check_impl::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_impl::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_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 >
lua_check_impl::remove_constref< T > lua_check (lua_State *L, int n)
 
template<typename T >
lua_check_impl::remove_constref< 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 >
lua_check_impl::remove_constref< T > luaW_table_get_def (lua_State *L, int index, utils::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...
 

Function Documentation

◆ lua_check()

template<typename T >
lua_check_impl::remove_constref<T> lua_check ( lua_State L,
int  n 
)

Definition at line 357 of file push_check.hpp.

References n.

Referenced by lua_gui2::intf_set_dialog_value().

◆ lua_push()

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

◆ lua_to_or_default()

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

Definition at line 364 of file push_check.hpp.

References n.

◆ luaW_table_get_def()

template<typename T >
lua_check_impl::remove_constref<T> luaW_table_get_def ( lua_State L,
int  index,
utils::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 381 of file push_check.hpp.

References utils::basic_string_view< charT, traits >::data(), utf8::index(), lua_gettable(), lua_isnoneornil, lua_istable, lua_pop, lua_pushlstring(), luaL_argerror(), and utils::basic_string_view< charT, traits >::size().