33 return str.empty() ?
empty :
false;
56 std::shared_ptr<wml_type> type;
58 type = std::make_shared<wml_type_union>(
cfg[
"name"]);
61 type = std::make_shared<wml_type_intersection>(
cfg[
"name"]);
71 auto t = std::make_shared<wml_type_simple>(
cfg[
"name"],
cfg[
"value"]);
72 if(
cfg[
"allow_translatable"].to_bool())
t->allow_translatable();
75 type = std::make_shared<wml_type_alias>(
cfg[
"name"],
cfg[
"link"]);
78 auto composite_type = std::dynamic_pointer_cast<wml_type_composite>(type);
131 bool result = std::all_of(
it, end, [
this, &
type_map, &
n](
const boost::ssub_match& match){
133 if(!match.matched)
return true;
136 elem = std::string(match.first, match.second);
Variant for storing WML attributes.
A config object defines a single node in a WML file, with access to child nodes.
child_itors child_range(std::string_view key)
bool has_attribute(std::string_view key) const
bool has_child(std::string_view key) const
Determine whether a config has a child or not.
config & mandatory_child(std::string_view key, int n=0)
Returns the nth child with the given key, or throws an error if there is none.
std::shared_ptr< wml_type > cached_
bool matches(const config_attribute_value &value, const map &type_map) const override
std::vector< std::shared_ptr< wml_type > > subtypes_
bool matches(const config_attribute_value &value, const map &type_map) const override
bool matches(const config_attribute_value &value, const map &type_map) const override
bool matches(const config_attribute_value &value, const map &type_map) const override
bool matches(const config_attribute_value &value, const map &type_map) const override
bool matches(const config_attribute_value &value, const map &type_map) const override
static std::shared_ptr< wml_type > from_config(const config &cfg)
std::map< std::string, ptr > map
Definitions for the interface to Wesnoth Markup Language (WML).
std::unique_ptr< MIX_Audio, decltype(&MIX_DestroyAudio)> value
bool operator()(const utils::monostate &) const
bool operator()(const t_string &) const
bool operator()(const T &) const
bool operator()(const std::string &str) const
static map_location::direction n
This file contains object "type", which is used to store information about types while annotation par...
MacOS doesn't support std::visit when targing MacOS < 10.14 (currently we target 10....