#include <config.hpp>
Public Types | |
typedef std::vector< config * > | child_list |
typedef std::map< std::string, child_list > | child_map |
typedef std::vector< config * > ::iterator | child_iterator |
typedef std::vector< config * > ::const_iterator | const_child_iterator |
typedef std::pair < child_iterator, child_iterator > | child_itors |
typedef std::pair < const_child_iterator, const_child_iterator > | const_child_itors |
Public Member Functions | |
config () | |
config (const config &cfg) | |
config (const std::string &child) | |
~config () | |
config & | operator= (const config &cfg) |
child_itors | child_range (const std::string &key) |
const_child_itors | child_range (const std::string &key) const |
const child_list & | get_children (const std::string &key) const |
const child_map & | all_children () const |
config * | child (const std::string &key) |
const config * | child (const std::string &key) const |
config & | add_child (const std::string &key) |
config & | add_child (const std::string &key, const config &val) |
config & | add_child_at (const std::string &key, const config &val, size_t index) |
t_string & | operator[] (const std::string &key) |
const t_string & | operator[] (const std::string &key) const |
const t_string & | get_attribute (const std::string &key) const |
bool | has_attribute (const std::string &key) const |
config * | find_child (const std::string &key, const std::string &name, const t_string &value) |
const config * | find_child (const std::string &key, const std::string &name, const t_string &value) const |
void | clear_children (const std::string &key) |
void | remove_child (const std::string &key, size_t index) |
void | recursive_clear_value (const std::string &key) |
void | clear () |
bool | empty () const |
std::string | debug () const |
std::string | hash () const |
all_children_iterator | ordered_begin () const |
In-order iteration over all children. | |
all_children_iterator | ordered_end () const |
all_children_iterator | erase (const all_children_iterator &i) |
config | get_diff (const config &c) const |
A function to get the differences between this object, and 'c', as another config object. | |
void | get_diff (const config &c, config &res) const |
void | apply_diff (const config &diff) |
void | merge_with (const config &c) |
Merge config 'c' into this config. | |
void | merge_and_keep (const config &c) |
Merge config 'c' into this config. | |
bool | matches (const config &filter) const |
void | prune () |
Removes keys with empty values. | |
void | append (const config &cfg) |
Append data from another config object to this one. | |
void | merge_children (const std::string &key) |
All children with the given key will be merged into the first element with that key. | |
void | reset_translation () const |
Resets the translated values of all strings contained in this object. | |
void | swap (config &cfg) |
Public Attributes | |
string_map | values |
All the attributes of this node. | |
Private Attributes | |
child_map | children |
A list of all children of this node. | |
std::vector< child_pos > | ordered_children |
Classes | |
struct | all_children_iterator |
struct | child_pos |
struct | error |
Definition at line 43 of file config.hpp.
typedef std::vector<config*> config::child_list |
Definition at line 57 of file config.hpp.
typedef std::map<std::string,child_list> config::child_map |
Definition at line 58 of file config.hpp.
typedef std::vector<config*>::iterator config::child_iterator |
Definition at line 60 of file config.hpp.
typedef std::vector<config*>::const_iterator config::const_child_iterator |
Definition at line 61 of file config.hpp.
typedef std::pair<child_iterator,child_iterator> config::child_itors |
Definition at line 63 of file config.hpp.
typedef std::pair<const_child_iterator,const_child_iterator> config::const_child_itors |
Definition at line 64 of file config.hpp.
config::config | ( | ) |
config::config | ( | const config & | cfg | ) |
config::config | ( | const std::string & | child | ) |
config::~config | ( | ) |
config::child_itors config::child_range | ( | const std::string & | key | ) |
Definition at line 92 of file config.cpp.
References children.
Referenced by unit_type_data::unit_type_map_wrapper::add_advancement(), replay::add_config(), unit::add_modification(), variable_info::as_array(), unit_type::attacks(), vconfig::child(), formula_ai::evaluate(), help::generate_contents(), mp::wait::generate_menu(), vconfig::has_child(), init_textdomains(), unit::internal_matches_filter(), mp::connect::lists_init(), load_language_list(), next_tip_of_day(), unit_animation::particule::particule(), formula_ai::play_turn(), unit_animation::prepare_animation(), read_tips_of_day(), help::section_is_referenced(), mp::connect::side::side(), team::team_info::team_info(), help::topic_is_referenced(), replay::undo(), and unit_animation::unit_animation().
config::const_child_itors config::child_range | ( | const std::string & | key | ) | const |
const config::child_list & config::get_children | ( | const std::string & | key | ) | const |
Definition at line 114 of file config.cpp.
References children.
Referenced by unit::ability_active(), unit::ability_affects_adjacent(), unit_animation::add_anims(), game_config::add_color_info(), terrain_builder::add_images_from_config(), about::add_lines(), theme::add_object(), unit::advance_to(), apply_diff(), unit::apply_modifications(), variable_info::as_container(), ai::avoided_locations(), unit_type::build_full(), check_checksums(), check_names_legal(), replay::commands(), mp::create::create(), cutter::cut_surface(), default_generate_map(), do_replay_handle(), expand_partialresolution(), extract_summary_data_from_save(), extract_summary_from_config(), find_scripts(), ai::find_threats(), find_translations(), game_state::game_state(), mp::ui::gamelist_updated(), gamemap::gamemap(), gamestatus::gamestatus(), cave_map_generator::generate_chambers(), mp::wait::generate_menu(), unit::generate_traits(), unit::get_abilities(), unit::get_ability_bool(), get_checksum(), mp::create::get_parameters(), rng::get_random(), rng::get_random_results(), attack_type::get_special_bool(), attack_type::get_specials(), about::get_text(), get_tip_of_day(), unit_type::has_ability(), unit::has_ability_type(), play_controller::init(), unit::internal_matches_filter(), mp::wait::join_game(), mp::lobby::lobby_sorter::less(), mp::level_to_gamestate(), font::load_font_config(), mp::connect::load_game(), hotkey::load_hotkeys(), cutter::load_masks(), gui2::load_settings(), game_events::manager::manager(), matches(), merge_children(), unit_type::modification_advancements(), unit::modification_advancements(), unit::modification_count(), theme::modify(), gamemap::overlay(), terrain_builder::parse_config(), parse_times(), play_game(), playsingle_controller::play_scenario(), dfool::dfool_ai::play_turn(), unit_type::possible_traits(), mp::create::process_event(), turn_info::process_network_data(), mp::wait::process_network_data(), gui2::twindow_builder::read(), unit::read(), gui2::tgui_definition::read(), map_labels::read(), wesnothd::ban_manager::read(), read_battle_result_map(), read_player(), statistics::read_stats(), unit::remove_temporary_modifications(), preferences::server_list(), about::set_about(), wesnothd::ban_manager::set_default_ban_times(), unit::set_game_context(), mp::gamebrowser::set_game_items(), theme::set_known_themes(), rng::set_random_results(), theme::set_resolution(), show_intro_part(), attack_type::special_active(), mp::wait::start_game(), mp::connect::start_game(), scoped_wml_variable::store(), gui2::tbuilder_grid::tbuilder_grid(), gui2::tbutton_definition::tbutton_definition(), team::team(), team::team_info::team_info(), map_editor::terrain_palette::terrain_palette(), gui2::tlabel_definition::tlabel_definition(), gui2::tlistbox_definition::tlistbox_definition(), gui2::tpanel_definition::tpanel_definition(), gui2::tspacer_definition::tspacer_definition(), gui2::ttext_box_definition::ttext_box_definition(), gui2::ttoggle_button_definition::ttoggle_button_definition(), gui2::ttooltip_definition::ttooltip_definition(), gui2::tvertical_scrollbar_definition::tvertical_scrollbar_definition(), unarchive_dir(), dfool::unit_memory::unit_memory(), variable_info::variable_info(), verify(), events::menu_handler::write_game_snapshot(), and scoped_wml_variable::~scoped_wml_variable().
const config::child_map & config::all_children | ( | ) | const |
Definition at line 125 of file config.cpp.
References children.
Referenced by unit::ability_tooltips(), theme::add_object(), unit_type::build_help_index(), do_replay_handle(), expand_partialresolution(), find_ref(), unit_type::has_ability_by_id(), unit::has_ability_by_id(), attack_type::has_special_by_id(), attack_type::special_tooltips(), unit::unit_ability_tooltips(), unit_animation::unit_animation(), and attack_type::weapon_specials().
config * config::child | ( | const std::string & | key | ) |
Definition at line 127 of file config.cpp.
References children.
Referenced by unit::abilities_affects_adjacent(), unit::ability_active(), unit::ability_affects_self(), unit::ability_tooltips(), replay::add_attack(), replay::add_config(), unit::add_modification(), theme::add_object(), terrain_builder::add_off_map_rule(), apply_diff(), attack_type::apply_modification(), variable_info::as_container(), unit::backup_state(), unit_type::build_full(), unit_type::build_help_index(), mp::check_response(), vconfig::child(), copy_era(), default_map_generator::create_scenario(), cave_map_generator::create_scenario(), mp::connect::current_config(), unit_movement_type::damage_table(), default_generate_map(), unit_movement_type::defense_modifier(), unit::defense_modifier(), do_replay_handle(), extract_summary_data_from_save(), extract_summary_from_config(), attack::fire_event(), upload_log::game_finished(), game_state::game_state(), mp::lobby::gamelist_updated(), cave_map_generator::generate_chambers(), help::generate_contents(), unit::get_abilities(), unit::get_ability_bool(), unit::get_base_resistances(), preferences::get_child(), mp::connect::side::get_config(), rng::get_random_results(), attack_type::get_special_bool(), attack_type::get_specials(), unit_type::has_ability(), unit_type::has_ability_by_id(), unit::has_ability_by_id(), unit::has_ability_type(), vconfig::has_child(), attack_type::has_special_by_id(), hash(), mp::wait::join_game(), mp::lobby::lobby_sorter::less(), mp::level_to_gamestate(), font::load_font_config(), mp::connect::load_game(), ai::move_leader_to_goals(), unit_movement_type::movement_cost(), unit::movement_cost_internal(), map_editor::new_map_dialog(), open_connection(), help::parse_config(), cave_map_generator::place_items(), play_game(), mp::create::process_event(), turn_info::process_network_data(), mp::wait::process_network_data(), mp::ui::process_network_data(), mp::connect::process_network_data(), prune(), statistics::stats::read(), gui2::tgui_definition::read(), replay_controller::rebuild_replay_theme(), unit::remove_ability_by_id(), reset_translation(), unit_movement_type::resistance_against(), unit::resistance_against(), help::section_is_referenced(), help::help_text_area::set_items(), mp::connect::side::side(), attack_type::special_active(), attack_type::special_tooltips(), mp::wait::start_game(), mp::connect::start_game(), theme::status_item::status_item(), gui2::tbuilder_listbox::tbuilder_listbox(), gui2::tbuilder_panel::tbuilder_panel(), help::topic_is_referenced(), gui2::twindow_builder::tresolution::tresolution(), gui2::tvertical_scrollbar_definition::tresolution::tresolution(), gui2::ttooltip_definition::tresolution::tresolution(), gui2::ttoggle_button_definition::tresolution::tresolution(), gui2::ttext_box_definition::tresolution::tresolution(), gui2::tpanel_definition::tresolution::tresolution(), gui2::tlistbox_definition::tresolution::tresolution(), gui2::tlabel_definition::tresolution::tresolution(), gui2::tbutton_definition::tresolution::tresolution(), gui2::tstate_definition::tstate_definition(), replay::undo(), unit::unit_ability_tooltips(), unit_movement_type::unit_movement_type(), variable_info::variable_info(), attack_type::weapon_specials(), wml_menu_item::wml_menu_item(), unit::write(), and write_game().
const config * config::child | ( | const std::string & | key | ) | const |
config & config::add_child | ( | const std::string & | key | ) |
Definition at line 147 of file config.cpp.
References children, config(), and ordered_children.
Referenced by replay::add_advancement(), unit_animation::add_anims(), replay::add_command(), replay::add_config(), replay::add_countdown_update(), replay::add_disband(), replay::add_event(), upload_log::add_game_result(), replay::add_label(), add_license(), unit::add_modification(), terrain_builder::add_off_map_rule(), replay::add_pos(), replay::add_recall(), replay::add_recruit(), replay::add_rename(), replay::add_start(), replay::add_unit_checksum(), replay::add_value(), game_state::add_variable_cfg(), append(), attack_type::apply_modification(), archive_campaign(), archive_dir(), variable_info::as_container(), attack::attack(), unit_type::build_full(), turn_info::change_side_controller(), events::menu_handler::change_side_controller(), replay::clear_labels(), replay_network_sender::commit_and_sync(), commit_wmi_commands(), config(), mp::connect::connect(), construct_error(), construct_message(), copy_era(), default_map_generator::create_scenario(), do_resolve_rects(), events::chat_command_handler::do_whisper(), replay::end_turn(), expand_partialresolution(), find_translations(), attack::fire_event(), help::generate_contents(), unit::generate_traits(), get_checksum(), mp::connect::side::get_config(), replay::get_data_range(), get_diff(), vconfig::get_parsed_config(), rng::get_random(), mp::ui::handle_event(), mp::connect::kick_player(), mp::level_to_gamestate(), mp::connect::load_game(), merge_and_keep(), merge_children(), merge_with(), open_connection(), cave_map_generator::place_items(), play_game(), playsingle_controller::play_scenario(), unit_animation::prepare_animation(), mp::lobby::process_event(), mp::create::process_event(), mp::connect::process_event(), server::process_login(), turn_info::process_network_data(), mp::connect::process_network_data(), read_compressed_internal(), mp::wait::request_snapshot(), unit::reset_modifications(), hotkey::save_hotkeys(), save_summary(), mp::ui::send_chat_message(), events::chat_handler::send_command(), about::set_about(), preferences::set_child(), rng::set_random_results(), replay::set_random_value(), replay::speak(), mp::connect::start_game(), replay_network_sender::sync_non_undoable(), replay::text_input(), unit_movement_type::unit_movement_type(), mp::connect::update_and_send_diff(), mp::connect::update_level(), variable_info::variable_info(), unit::write(), team::write(), team::team_info::write(), statistics::stats::write(), map_labels::write(), gamestatus::write(), wesnothd::ban_manager::write(), dfool::unit_memory::write(), write_battle_result_map(), dfool::unit_memory::write_element(), game_events::write_events(), write_game(), events::menu_handler::write_game_snapshot(), game_display::write_overlays(), write_player(), statistics::write_stats(), and upload_log::~upload_log().
Definition at line 163 of file config.cpp.
References children, config(), ordered_children, and value.
Referenced by unit_animation::add_anims(), and apply_diff().
t_string & config::operator[] | ( | const std::string & | key | ) |
const t_string & config::operator[] | ( | const std::string & | key | ) | const |
const t_string & config::get_attribute | ( | const std::string & | key | ) | const |
Definition at line 290 of file config.cpp.
References empty_string, and values.
Referenced by attack_type::apply_modification(), mp::connect::side::get_config(), mp::connect::load_game(), unit_movement_type::name(), operator[](), mp::create::process_event(), mp::connect::process_network_data(), mp::gamebrowser::set_game_items(), and mp::connect::side::side().
bool config::has_attribute | ( | const std::string & | key | ) | const [inline] |
Definition at line 81 of file config.hpp.
References values.
Referenced by vconfig::has_attribute(), and variable_info::variable_info().
config * config::find_child | ( | const std::string & | key, | |
const std::string & | name, | |||
const t_string & | value | |||
) |
Definition at line 316 of file config.cpp.
References children.
Referenced by add_font_to_fontlist(), add_license(), default_generate_map(), expand_partialresolution(), extract_summary_data_from_save(), extract_summary_from_config(), unit_type_data::unit_type_map_wrapper::find_config(), find_ref(), help::generate_contents_links(), get_theme(), mp::connect::load_game(), map_editor::new_map_dialog(), help::parse_config_internal(), place_village(), play_game(), play_replay(), save_summary(), and mp::gamebrowser::set_game_items().
void config::clear_children | ( | const std::string & | key | ) |
Definition at line 205 of file config.cpp.
References children, and ordered_children.
Referenced by unit::advance_to(), attack_type::apply_modification(), unit_type::build_full(), game_state::clear_variable(), game_state::clear_variable_cfg(), help::generate_contents(), get_checksum(), merge_children(), unit::read(), unit::reset_modifications(), hotkey::save_hotkeys(), preferences::set_child(), unit_type_data::unit_type_map_wrapper::set_config(), rng::set_random_results(), mp::connect::update_level(), and unit::write().
void config::remove_child | ( | const std::string & | key, | |
size_t | index | |||
) |
Definition at line 254 of file config.cpp.
References children, ERR_CF, ordered_children, pos, and halo::remove().
Referenced by apply_diff(), game_state::clear_variable(), game_state::clear_variable_cfg(), find_ref(), unit::read(), replay::remove_command(), and unit::remove_temporary_modifications().
void config::recursive_clear_value | ( | const std::string & | key | ) |
Definition at line 218 of file config.cpp.
References ordered_begin(), ordered_end(), and values.
Referenced by get_checksum().
void config::clear | ( | void | ) |
Definition at line 351 of file config.cpp.
References children, map, ordered_children, and values.
Referenced by unit_type::build_full(), cave_map_generator::create_scenario(), enter_connect_mode(), enter_wait_mode(), dialogs::network_data_dialog(), open_connection(), operator=(), play_game(), play_replay(), mp::create::process_event(), unit::read(), read_compressed(), read_save_file(), read_tips_of_day(), mp::create::parameters::reset(), save_index(), turn_info::sync_network(), unit::write(), and ~config().
bool config::empty | ( | ) | const |
Definition at line 364 of file config.cpp.
References children, and values.
Referenced by replay_network_sender::commit_and_sync(), commit_wmi_commands(), default_generate_map(), unit_abilities::effect::effect(), vconfig::empty(), play_controller::expand_wml_commands(), extract_summary_data_from_save(), game_state::game_state(), get_tip_of_day(), mp::level_to_gamestate(), mp::connect::load_game(), play_game(), play_replay(), read_save_file(), network::receive_data(), network::send_data(), game_state::set_variables(), replay_network_sender::sync_non_undoable(), mp::connect::update_and_send_diff(), team::team_info::write(), and upload_log::~upload_log().
std::string config::debug | ( | ) | const |
std::string config::hash | ( | ) | const |
Definition at line 747 of file config.cpp.
References child(), children, utils::portable_isspace(), and values.
Referenced by get_checksum(), get_hash_of(), and mp::connect::load_game().
config::all_children_iterator config::ordered_begin | ( | ) | const |
In-order iteration over all children.
Definition at line 420 of file config.cpp.
References ordered_children.
Referenced by unit::add_modification(), append(), attack_type::apply_modification(), do_resolve_rects(), vconfig::get_children(), vconfig::get_parsed_config(), matches(), operator<<(), operator==(), vconfig::ordered_begin(), gui2::tcanvas::parse_cfg(), cave_map_generator::place_chamber(), unit_animation::prepare_animation(), recursive_clear_value(), unit::remove_ability_by_id(), show_intro(), write_compressed_internal(), and write_internal().
config::all_children_iterator config::ordered_end | ( | ) | const |
Definition at line 425 of file config.cpp.
References ordered_children.
Referenced by unit::add_modification(), append(), attack_type::apply_modification(), do_resolve_rects(), erase(), vconfig::get_children(), vconfig::get_parsed_config(), matches(), operator<<(), operator==(), vconfig::ordered_end(), gui2::tcanvas::parse_cfg(), cave_map_generator::place_chamber(), unit_animation::prepare_animation(), recursive_clear_value(), unit::remove_ability_by_id(), show_intro(), write_compressed_internal(), and write_internal().
config::all_children_iterator config::erase | ( | const all_children_iterator & | i | ) |
Definition at line 228 of file config.cpp.
References children, erase(), ERR_CF, config::all_children_iterator::get_index(), config::all_children_iterator::get_key(), ordered_children, and ordered_end().
Referenced by erase(), and unit::remove_ability_by_id().
A function to get the differences between this object, and 'c', as another config object.
I.e. calling cfg2.apply_diff(cfg1.get_diff(cfg2)) will make cfg1 identical to cfg2.
Definition at line 430 of file config.cpp.
Referenced by get_diff(), and mp::connect::update_and_send_diff().
Definition at line 437 of file config.cpp.
References a, add_child(), b, buf, children, get_diff(), and values.
void config::apply_diff | ( | const config & | diff | ) |
Definition at line 541 of file config.cpp.
References add_child_at(), child(), children, get_children(), lexical_cast(), remove_child(), and values.
Referenced by mp::wait::process_network_data(), and mp::ui::process_network_data().
void config::merge_with | ( | const config & | c | ) |
Merge config 'c' into this config.
Overwrites this config's values.
Definition at line 597 of file config.cpp.
References add_child(), children, ordered_children, and values.
Referenced by unit::advance_to(), unit_type::build_full(), mp::connect::side::get_config(), and unit_type_data::unit_type_map_wrapper::set_config().
void config::merge_and_keep | ( | const config & | c | ) |
Merge config 'c' into this config.
Keeps this config's values and does not add existing elements. NOTICE: other nonstandard behavior includes no merge recursion into child and has limited merging for child lists of differing lengths
Definition at line 630 of file config.cpp.
References add_child(), children, and values.
bool config::matches | ( | const config & | filter | ) | const |
Definition at line 650 of file config.cpp.
References t_string::base_str(), get_children(), ordered_begin(), ordered_end(), utils::string_bool(), and values.
Referenced by unit::internal_matches_filter().
void config::prune | ( | ) |
Removes keys with empty values.
Definition at line 691 of file config.cpp.
References child(), children, and values.
Referenced by mp::connect::side::get_config().
void config::append | ( | const config & | cfg | ) |
Append data from another config object to this one.
Attributes in the latter config object will clobber attributes in this one.
Definition at line 64 of file config.cpp.
References add_child(), ordered_begin(), ordered_end(), value, and values.
Referenced by unit::add_modification(), config(), mp::connect::side::get_config(), merge_children(), operator=(), unit_animation::prepare_animation(), scoped_wml_variable::store(), team::team_info::team_info(), and unit::write().
void config::merge_children | ( | const std::string & | key | ) |
All children with the given key will be merged into the first element with that key.
Definition at line 76 of file config.cpp.
References add_child(), append(), children, clear_children(), and get_children().
void config::reset_translation | ( | ) | const |
Resets the translated values of all strings contained in this object.
Definition at line 708 of file config.cpp.
References child(), children, and values.
Referenced by map_editor::change_language().
void config::swap | ( | config & | cfg | ) |
Definition at line 808 of file config.cpp.
References children, ordered_children, and values.
Referenced by network_worker_pool::get_received_data().
All the attributes of this node.
Definition at line 182 of file config.hpp.
Referenced by replay::add_attack(), append(), apply_diff(), variable_info::as_scalar(), clear(), game_state::clear_variable(), unit_movement_type::damage_table(), do_resolve_rects(), empty(), preferences::erase(), expand_partialresolution(), attack::fire_event(), get_attribute(), unit::get_base_resistances(), get_diff(), vconfig::get_parsed_config(), has_attribute(), hash(), mp::wait::join_game(), preferences::manager::manager(), matches(), merge_and_keep(), merge_with(), mod_mdr_merge(), operator<<(), operator==(), operator[](), cave_map_generator::place_items(), play_game(), unit_animation::prepare_animation(), mp::connect::process_network_data(), prune(), unit::read(), read_battle_result_map(), read_compressed_internal(), read_str_int_map(), network::receive_data(), recursive_clear_value(), reset_translation(), preferences::resolution(), mp::gamebrowser::set_game_items(), set_language(), swap(), write_compressed_internal(), events::menu_handler::write_game_snapshot(), and write_internal().
child_map config::children [private] |
A list of all children of this node.
Definition at line 186 of file config.hpp.
Referenced by add_child(), add_child_at(), all_children(), apply_diff(), child(), child_range(), clear(), clear_children(), empty(), erase(), find_child(), get_children(), get_diff(), hash(), merge_and_keep(), merge_children(), merge_with(), prune(), remove_child(), reset_translation(), and swap().
std::vector<child_pos> config::ordered_children [private] |
Definition at line 188 of file config.hpp.
Referenced by add_child(), add_child_at(), clear(), clear_children(), erase(), merge_with(), ordered_begin(), ordered_end(), remove_child(), and swap().
Generated by doxygen 1.5.5 on 23 May 2008 for The Battle for Wesnoth | Gna! | Forum | Wiki | CIA | devdocs |