21 #define ERR_CONFIG LOG_STREAM(err, log_config)
22 #define WRN_CONFIG LOG_STREAM(warn, log_config)
23 #define LOG_CONFIG LOG_STREAM(info, log_config)
29 if(
cfgs_.size() <= 1 || key !=
"terrain_graphics") {
38 for(
const config& cfg : boost::make_iterator_range(
cfgs_.begin() + 1,
cfgs_.end())) {
43 for (
const config& child :
cfgs_.front().get().child_range(key)) {
57 LOG_CONFIG <<
"gcv : cannot find [" << key <<
"] with " << name <<
"=" << value <<
", count = " <<
cfgs_.size();
67 throw config::error(
"Cannot find child [" + std::string(key) +
"] with " + name +
"=" + value);
73 if(
const auto res = cfg.optional_child(key)) {
77 throw config::error(
"missing WML tag [" + std::string(key) +
"]");
83 if(
const auto res = cfg.optional_child(key)) {
94 if(
const auto res = cfg.optional_child(key)) {
108 res.
cfgs_.push_back(child);
A config object defines a single node in a WML file, with access to child nodes.
child_itors child_range(config_key_type key)
A class grating read only view to a vector of config objects, viewed as one config with all children ...
const config & child_or_empty(config_key_type key) const
const config & mandatory_child(config_key_type key) const
optional_const_config optional_child(config_key_type key) const
optional_const_config find_child(config_key_type key, const std::string &name, const std::string &value) const
config_array_view child_range(config_key_type key) const
const config & find_mandatory_child(config_key_type key, const std::string &name, const std::string &value) const
game_config_view merged_children_view(config_key_type key) const
Definitions for the interface to Wesnoth Markup Language (WML).
std::string_view config_key_type
optional_config_impl< const config > optional_const_config
static lg::log_domain log_config("config")
std::vector< std::reference_wrapper< const config > > config_array_view
Standard logging facilities (interface).