A class grating read only view to a vector of config objects, viewed as one config with all children appended, used by the game_config class to read data from addons config, and from the main config. More...
#include <game_config_view.hpp>
Public Member Functions | |
game_config_view () | |
config_array_view | child_range (config_key_type key) const |
optional_const_config | find_child (config_key_type key, const std::string &name, const std::string &value) const |
const config & | find_mandatory_child (config_key_type key, const std::string &name, const std::string &value) const |
const config & | mandatory_child (config_key_type key) const |
optional_const_config | optional_child (config_key_type key) const |
const config & | child_or_empty (config_key_type key) const |
game_config_view | merged_children_view (config_key_type key) const |
config_array_view & | data () |
Static Public Member Functions | |
static game_config_view | wrap (const config &cfg) |
Private Member Functions | |
game_config_view (const config &cfg) | |
Private Attributes | |
config_array_view | cfgs_ |
A class grating read only view to a vector of config objects, viewed as one config with all children appended, used by the game_config class to read data from addons config, and from the main config.
Definition at line 30 of file game_config_view.hpp.
|
inline |
Definition at line 34 of file game_config_view.hpp.
Referenced by wrap().
|
inlineexplicitprivate |
Definition at line 63 of file game_config_view.hpp.
References cfgs_.
const config & game_config_view::child_or_empty | ( | config_key_type | key | ) | const |
Definition at line 91 of file game_config_view.cpp.
References cfgs_.
Referenced by help::generate_contents().
config_array_view game_config_view::child_range | ( | config_key_type | key | ) | const |
Definition at line 26 of file game_config_view.cpp.
References cfgs_, and config::child_range().
Referenced by game_config::add_color_info(), help::generate_era_sections(), ng::create_engine::init_all_levels(), ng::create_engine::init_extras(), init_strings(), init_textdomains(), terrain_type_data::lazy_initialization(), prefs::load_advanced_prefs(), hotkey::load_custom_hotkeys(), hotkey::load_default_hotkeys(), ng::depcheck::manager::manager(), terrain_builder::parse_config(), about::set_about(), unit_type_data::set_config(), theme::set_known_themes(), filesystem::binary_paths_manager::set_paths(), editor::item_palette::setup(), editor::terrain_palette::setup(), savegame::loadgame::show_difficulty_dialog(), and unit_type_data::traits().
|
inline |
Definition at line 56 of file game_config_view.hpp.
References cfgs_.
Referenced by game_config_manager::set_enabled_addon(), and game_config_manager::set_enabled_addon_all().
optional_const_config game_config_view::find_child | ( | config_key_type | key, |
const std::string & | name, | ||
const std::string & | value | ||
) | const |
Definition at line 50 of file game_config_view.cpp.
References cfgs_, and LOG_CONFIG.
Referenced by play_controller::check_next_scenario_is_known(), ng::create_engine::create_engine(), gui2::dialogs::game_load::evaluate_summary_string(), find_mandatory_child(), and help::generate_era_topics().
const config & game_config_view::find_mandatory_child | ( | config_key_type | key, |
const std::string & | name, | ||
const std::string & | value | ||
) | const |
Definition at line 61 of file game_config_view.cpp.
References find_child().
Referenced by gui2::dialogs::game_load::evaluate_summary_string(), and ng::create_engine::prepare_for_era_and_mods().
const config & game_config_view::mandatory_child | ( | config_key_type | key | ) | const |
Definition at line 70 of file game_config_view.cpp.
References cfgs_.
Referenced by default_map_generator_job::default_generate_map(), and gui2::dialogs::editor_edit_unit::pre_show().
game_config_view game_config_view::merged_children_view | ( | config_key_type | key | ) | const |
Definition at line 102 of file game_config_view.cpp.
References cfgs_, and config::child_range().
Referenced by test_utils::game_config_manager::game_config_manager().
optional_const_config game_config_view::optional_child | ( | config_key_type | key | ) | const |
Definition at line 80 of file game_config_view.cpp.
References cfgs_, and optional_config_impl< T >::value().
Referenced by do_gameloop(), ng::create_engine::init_all_levels(), and unit_type_data::set_config().
|
inlinestatic |
Definition at line 37 of file game_config_view.hpp.
References game_config_view().
Referenced by terrain_builder::add_off_map_rule(), unit::apply_builtin_effect(), BOOST_AUTO_TEST_CASE(), unit_type::build_full(), gui2::dialogs::mp_join_game::fetch_game_config(), gamemap::gamemap(), prefs::load_hotkeys(), terrain_builder::parse_config(), and play_controller::play_controller().
|
private |
Definition at line 68 of file game_config_view.hpp.
Referenced by child_or_empty(), child_range(), data(), find_child(), game_config_view(), mandatory_child(), merged_children_view(), and optional_child().