The Battle for Wesnoth  1.19.5+dev
Classes | Namespaces | Functions | Variables
push_check.hpp File Reference
#include "scripting/lua_common.hpp"
#include "scripting/lua_widget.hpp"
#include "lua/wrapper_lauxlib.h"
#include "tstring.hpp"
#include "map/location.hpp"
#include "variable.hpp"
#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, lua_index_raw >, void > lua_check_impl::lua_push (lua_State *L, lua_index_raw n)
 
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 >, std::string > 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 >, 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 >, configlua_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, 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, vconfig >, vconfiglua_check_impl::lua_check (lua_State *L, int n)
 
template<typename T >
std::enable_if_t< std::is_same_v< T, vconfig >, vconfiglua_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, vconfig >, void > lua_check_impl::lua_push (lua_State *L, const vconfig &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_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 >
T::type lua_check_impl::lua_check (lua_State *L, int n)
 
template<typename T >
std::enable_if_t< is_instance_of_v< T, utils::optional >, T > lua_check_impl::lua_check (lua_State *L, int n)
 
template<typename T >
std::enable_if_t< is_instance_of_v< T, utils::optional >, void > lua_check_impl::lua_push (lua_State *L, const T &opt)
 
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)
 

Variables

template<class T , template< class > class U>
constexpr bool lua_check_impl::is_instance_of_v = std::false_type{}
 
template<template< class > class U, class V >
constexpr bool lua_check_impl::is_instance_of_v< U< V >, U > = std::true_type{}
 

Function Documentation

◆ lua_check()

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

Definition at line 411 of file push_check.hpp.

References n.

Referenced by impl_source_set(), and read_event_name().

◆ lua_push()

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

Definition at line 425 of file push_check.hpp.

Referenced by game_lua_kernel::cfun_undoable_event(), luaW_Registry::dir(), dir_meta_helper(), ai::impl_ai_aspect_get(), ai::impl_ai_aspect_list(), ai::impl_ai_list(), impl_color_dir(), impl_color_get(), impl_color_tostring(), impl_colors_table_dir(), game_lua_kernel::impl_get_terrain_info(), game_lua_kernel::impl_get_terrain_list(), lua_common::impl_gettext_tostr(), impl_mp_settings_get(), impl_music_get(), impl_namedtuple_tostring(), impl_null_callback(), impl_preferences_dir(), impl_race_tostring(), game_lua_kernel::impl_theme_items_dir(), impl_unit_attack_tostring(), impl_unit_status_dir(), impl_unit_type_list(), impl_unit_type_tostring(), impl_unit_variables_dir(), lua_common::impl_vconfig_dir(), impl_version_dir(), impl_version_tostring(), impl_warn(), lua_widget::impl_widget_dir(), intf_add_dialog_item(), intf_add_item_of_type(), lua_fileops::intf_canonical_path(), intf_current_version(), intf_default_generate(), intf_deprecated_message(), lua_stringx::intf_format(), lua_stringx::intf_format_list(), intf_get_language(), lua_map_location::intf_get_tile_ring(), lua_map_location::intf_get_tiles_in_radius(), lua_kernel_base::intf_kernel_type(), intf_make_shroud_bitmap(), intf_object_dir(), game_lua_kernel::intf_progress_achievement(), lua_mathx::intf_random(), intf_random(), lua_fileops::intf_read_file(), intf_resolve_asset(), game_lua_kernel::intf_scroll(), game_lua_kernel::intf_set_sub_achievement(), lua_stringx::intf_str_join(), lua_stringx::intf_str_join_map(), lua_stringx::intf_str_map_split(), lua_stringx::intf_str_paren_split(), lua_stringx::intf_str_split(), intf_synchronize_choices(), luaW_get_attributes(), luaW_getwidgetcallback(), luaW_push_namedtuple(), luaW_setwidgetcallback(), luaW_table_set(), game_lua_kernel::mouse_button_callback(), game_lua_kernel::mouse_over_hex_callback(), register_lua_attribute(), register_widget_attribute(), game_lua_kernel::select_hex_callback(), and UNIT_GETTER().

◆ 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 418 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 435 of file push_check.hpp.

References utf8::index().

Referenced by ai::impl_ai_list(), game_lua_kernel::intf_add_event(), game_lua_kernel::intf_remove_label(), 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 
)

Definition at line 457 of file push_check.hpp.

References utf8::index(), and lua_push().

Referenced by game_lua_kernel::intf_set_floating_label(), and luaW_pushsinglecolor().