22 #include <type_traits>
29 const char*
what() const noexcept
31 return "invalid_variablename_exception";
101 static_assert(!std::is_same_v<
103 "variable_info_mutable cannot be specialized with 'vi_policy_const'"
128 void merge_array(std::vector<config> children)
const;
136 void clear(
bool only_tables =
false)
const;
Variant for storing WML attributes.
A config object defines a single node in a WML file, with access to child nodes.
boost::iterator_range< child_iterator > child_itors
invalid_variablename_exception()
const char * what() const noexcept
The variable_info policy classes.
Additional functionality for a non-const variable_info.
config::child_itors insert_array(std::vector< config > children) const
variable_info_mutable(const std::string &name, config &game_vars)
void merge_array(std::vector< config > children) const
config::child_itors replace_array(std::vector< config > children) const
void clear(bool only_tables=false) const
Clears the value this object points to.
config::child_itors append_array(std::vector< config > children) const
Information on a WML variable.
maybe_const_t< config::child_itors, V > as_array() const
If instantiated with vi_policy_const, the lifetime of the returned const attribute_value reference mi...
maybe_const_t< config::attribute_value, V > & as_scalar() const
If instantiated with vi_policy_const, the lifetime of the returned const attribute_value reference mi...
std::string get_error_message() const
void throw_on_invalid() const
bool exists_as_container() const
variable_info(const std::string &varname, maybe_const_t< config, V > &vars) noexcept
maybe_const_t< config, V > & as_container() const
If instantiated with vi_policy_const, the lifetime of the returned const attribute_value reference mi...
bool explicit_index() const
bool exists_as_attribute() const
variable_info_implementation::variable_info_state< V > state_
virtual config::attribute_value get_variable_const(const std::string &id) const =0
virtual variable_access_const get_variable_access_read(const std::string &varname) const =0
Definitions for the interface to Wesnoth Markup Language (WML).
typename variable_info_implementation::maybe_const< T, V >::type maybe_const_t
Helper template alias for maybe_const, defined at global scope for convenience.