20 #include <boost/range/iterator_range.hpp>
23 #define ERR_CONFIG LOG_STREAM(err, log_config)
24 #define WRN_CONFIG LOG_STREAM(warn, log_config)
25 #define LOG_CONFIG LOG_STREAM(info, log_config)
31 if(
cfgs_.size() <= 1 || key !=
"terrain_graphics") {
40 for(
const config& cfg : boost::make_iterator_range(
cfgs_.begin() + 1,
cfgs_.end())) {
45 for (
const config& child :
cfgs_.front().get().child_range(key)) {
59 LOG_CONFIG <<
"gcv : cannot find [" << key <<
"] with " << name <<
"=" << value <<
", count = " <<
cfgs_.size();
69 throw config::error(
"Cannot find child [" + std::string(key) +
"] with " + name +
"=" + value);
75 if(
const auto res = cfg.optional_child(key)) {
79 throw config::error(
"missing WML tag [" + std::string(key) +
"]");
85 if(
const auto res = cfg.optional_child(key)) {
96 if(
const auto res = cfg.optional_child(key)) {
110 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
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).