Classes | |
struct | parse_error |
Thrown when the help system fails to parse something. More... | |
Functions | |
std::string | make_link (const std::string &text, const std::string &dst) |
std::string | img (const std::string &src, const std::string &align, const bool floating) |
static config | parse_entity (std::string::const_iterator &beg, std::string::const_iterator end) |
static char | parse_escape (std::string::const_iterator &beg, std::string::const_iterator end) |
static config | parse_text_until (std::string::const_iterator &beg, std::string::const_iterator end, char close) |
static std::string | parse_name (std::string::const_iterator &beg, std::string::const_iterator end) |
static std::pair< std::string, std::string > | parse_attribute (std::string::const_iterator &beg, std::string::const_iterator end, bool allow_empty) |
static void | check_closing_tag (std::string::const_iterator &beg, std::string::const_iterator end, std::string_view match) |
static std::pair< std::string, config > | parse_tag (std::string::const_iterator &beg, std::string::const_iterator end) |
static config | parse_tag_contents (std::string::const_iterator &beg, std::string::const_iterator end, std::string_view match, bool check_for_attributes) |
config | parse_text (const std::string &text) |
Parse a xml style marked up text string. More... | |
template<typename... Args> | |
std::string | tag (const std::string &tag_name, Args &&... contents) |
template<typename... Args> | |
std::string | span_color (const color_t &color, Args &&... data) |
template<typename... Args> | |
std::string | span_color (const std::string &color, Args &&... data) |
template<typename... Args> | |
std::string | span_size (const std::string &size, Args &&... data) |
template<typename... Args> | |
std::string | bold (Args &&... data) |
template<typename... Args> | |
std::string | italic (Args &&... data) |
Variables | |
static const std::string | br = "<br/>" |
std::string markup::bold | ( | Args &&... | data | ) |
data | Variable list of contents to enclose inside the bold tag. Could anything that can be appended to a formatter. This function does not escape data internally, so data should be escaped by the caller if needed. |
Definition at line 128 of file markup.hpp.
Referenced by gui2::chatbox::add_active_window_message(), gui2::chatbox::add_active_window_whisper(), gui2::chatbox::add_chat_message(), gui2::chatbox::add_room_window_message(), gui2::chatbox::add_whisper_window_whisper(), attack_info(), carryover_show_gold(), gui2::dialogs::format_level_string(), gui2::dialogs::mp_change_control::highlight_side_nick(), help::unit_topic_generator::operator()(), gui2::dialogs::unit_attack::pre_show(), gui2::unit_preview_pane::print_attack_details(), gui2::unit_preview_pane::set_displayed_type(), gui2::unit_preview_pane::set_displayed_unit(), time_of_day_at(), tod_stats_at(), unit_abilities(), unit_alignment(), unit_defense(), unit_helper::unit_level_tooltip(), unit_name(), unit_race(), unit_traits(), unit_type(), and unit_weapons().
|
static |
Definition at line 290 of file markup.cpp.
Referenced by parse_tag_contents().
std::string markup::img | ( | const std::string & | src, |
const std::string & | align = "left" , |
||
const bool | floating = false |
||
) |
src | The WML path to where the image is located. (i.e., 'units/drakes/arbiter.png') |
align | Alignment of this image. Possible values: left, right, center. |
floating | Is the image a floating image or an inline image? |
Definition at line 29 of file markup.cpp.
References src.
Referenced by terrain_builder::add_images_from_config(), terrain_builder::apply_rule(), display::draw_hex(), display::draw_report(), help::generate_time_of_day_topics(), hotkey::command_executor::get_menu_images(), image::get_tod_colored(), intf_get_image_size(), help::terrain_topic_generator::operator()(), help::unit_topic_generator::operator()(), gui2::dialogs::drop_down_menu::pre_show(), gui2::dialogs::editor_edit_pbl::pre_show(), gui2::dialogs::terrain_layers::pre_show(), filesystem::read_file_as_data_uri(), terrain_builder::replace_rotate_tokens(), gui2::dialogs::achievements_dialog::set_sub_achievements(), gui2::dialogs::mp_create_game::update_details(), and gui2::dialogs::editor_edit_pbl::update_icon_preview().
std::string markup::italic | ( | Args &&... | data | ) |
data | Variable list of contents to enclose inside the italic tag. Could anything that can be appended to a formatter. This function does not escape data internally, so data should be escaped by the caller if needed. |
Definition at line 140 of file markup.hpp.
Referenced by gui2::chatbox::add_chat_message(), attack_info(), editor::context_manager::expand_areas_menu(), editor::context_manager::expand_open_maps_menu(), editor::context_manager::expand_sides_menu(), gui2::dialogs::mp_lobby::make_game_row_data(), help::unit_topic_generator::operator()(), gui2::dialogs::game_version::pre_show(), gui2::dialogs::unit_attack::pre_show(), gui2::dialogs::attack_predictions::set_data(), unit_abilities(), and gui2::dialogs::mp_staging::update_leader_display().
std::string markup::make_link | ( | const std::string & | text, |
const std::string & | dst | ||
) |
text | User visible text/caption of the link. |
dst | Destination of the link. Can be any string depending on the link handler in the parsing gui2::rich_label. |
Definition at line 23 of file markup.cpp.
References dst.
Referenced by help::generate_ability_topics(), help::generate_contents_links(), help::generate_era_topics(), help::generate_faction_topics(), help::generate_time_of_day_topics(), help::generate_unit_topics(), help::generate_weapon_special_topics(), help::make_unit_link(), help::terrain_topic_generator::operator()(), help::unit_topic_generator::operator()(), and help::print_trait_list().
|
static |
Definition at line 228 of file markup.cpp.
References config::all_children_count(), config::has_child(), config::optional_child(), parse_entity(), parse_escape(), parse_name(), parse_text_until(), s, and t.
Referenced by parse_tag(), and parse_tag_contents().
|
static |
Definition at line 90 of file markup.cpp.
Referenced by parse_attribute(), and parse_text_until().
|
static |
Definition at line 159 of file markup.cpp.
Referenced by parse_attribute(), and parse_text_until().
|
static |
Definition at line 219 of file markup.cpp.
References s.
Referenced by parse_attribute(), and parse_tag().
|
static |
Definition at line 365 of file markup.cpp.
References config::all_children_count(), config::append(), config::attribute_count(), config::has_attribute(), parse_attribute(), parse_name(), and parse_tag_contents().
Referenced by parse_tag_contents(), and parse_text().
|
static |
Definition at line 309 of file markup.cpp.
References config::add_child(), config::all_children_count(), config::append_children(), config::attribute_count(), check_closing_tag(), config::has_attribute(), config::has_child(), config::mandatory_child(), parse_attribute(), parse_tag(), parse_text_until(), and tag().
Referenced by parse_tag().
config markup::parse_text | ( | const std::string & | text | ) |
Parse a xml style marked up text string.
Return a config with the different parts of the text. Each markup item is a separate part while the text between markups are separate parts.
Definition at line 401 of file markup.cpp.
References config::add_child(), config::append_children(), parse_tag(), parse_text_until(), and tag().
Referenced by BOOST_AUTO_TEST_CASE(), and help::topic_text::parsed_text().
|
static |
Definition at line 170 of file markup.cpp.
References config::add_child(), parse_entity(), parse_escape(), and s.
Referenced by parse_attribute(), parse_tag_contents(), and parse_text().
std::string markup::span_color | ( | const color_t & | color, |
Args &&... | data | ||
) |
<span foreground=#color>#data</span>
.color | The color_t object from which to retrieve the color. |
data | Variable list of contents to enclose inside the span tag. Could anything that can be appended to a formatter. This function does not escape data internally, so data should be escaped by the caller if needed. |
Definition at line 68 of file markup.hpp.
References data, and color_t::to_hex_string().
Referenced by gui2::dialogs::lua_interpreter::lua_model::add_dialog_message(), add_name(), gui2::dialogs::mp_staging::add_side_node(), gui2::dialogs::add_unit_entry(), gui2::dialogs::mp_lobby::adjust_game_row_contents(), gui2::chatbox::append_to_chatbox(), attack_info(), help::best_str(), gui2::dialogs::campaign_selection::campaign_selected(), gui2::addon_list::colorize_addon_state_string(), gui2::dialogs::controller_name(), gui2::dialogs::game_load::evaluate_summary_string(), gui2::dialogs::format_cost_string(), gui2::dialogs::format_if_leader(), gui2::dialogs::format_level_string(), gui2::dialogs::format_movement_string(), help::format_mp_entry(), gui2::dialogs::mp_join_game::generate_side_list(), gui2::get_hp_tooltip(), gui2::get_mp_tooltip(), gui2::dialogs::gray_if_unrecruitable(), gray_inactive(), mp::initial_level_config(), gui2::dialogs::preferences_dialog::initialize_callbacks(), editor::editor_palette< Item >::layout(), gui2::dialogs::mp_lobby::make_game_row_data(), gui2::dialogs::maybe_inactive(), help::unit_topic_generator::operator()(), gui2::dialogs::campaign_difficulty::pre_show(), gui2::dialogs::formula_debugger::pre_show(), gui2::dialogs::game_stats::pre_show(), gui2::dialogs::label_settings::pre_show(), gui2::dialogs::language_selection::pre_show(), gui2::dialogs::mp_change_control::pre_show(), gui2::dialogs::unit_attack::pre_show(), gui2::dialogs::unit_list::pre_show(), gui2::dialogs::unit_recall::pre_show(), gui2::unit_preview_pane::print_attack_details(), REPORT_GENERATOR(), gui2::dialogs::achievements_dialog::set_achievements_row(), gui2::addon_list::set_addons(), gui2::dialogs::attack_predictions::set_data(), gui2::unit_preview_pane::set_displayed_type(), gui2::unit_preview_pane::set_displayed_unit(), gui2::dialogs::preferences_dialog::set_resolution_list(), gui2::dialogs::preferences_dialog::setup_hotkey_list(), gui2::dialogs::tally(), time_of_day_at(), help::time_of_day_bonus_colored(), unit_abilities(), unit_alignment(), unit_box_at(), unit_defense(), unit_hp(), unit_moves(), unit_weapons(), unit_xp(), gui2::lobby_player_list_helper::update(), gui2::dialogs::mp_match_history::update_display(), and attack_type::weapon_specials().
std::string markup::span_color | ( | const std::string & | color, |
Args &&... | data | ||
) |
<span foreground=#color>#data</span>
.color | The hex color string. |
data | Variable list of contents to enclose inside the span tag. Could anything that can be appended to a formatter. This function does not escape data internally, so data should be escaped by the caller if needed. |
Definition at line 89 of file markup.hpp.
References data.
std::string markup::span_size | ( | const std::string & | size, |
Args &&... | data | ||
) |
<span size=#size>#data</span>
.size | The font size. String so values like x-large, large etc could be used. |
data | Variable list of contents to enclose inside the span tag. Could anything that can be appended to a formatter. This function does not escape data internally, so data should be escaped by the caller if needed. |
Definition at line 110 of file markup.hpp.
References data, and utf8::size().
Referenced by gui2::dialogs::mp_lobby::adjust_game_row_contents(), gui2::dialogs::outro::outro(), gui2::dialogs::end_credits::pre_show(), gui2::unit_preview_pane::print_attack_details(), gui2::unit_preview_pane::set_displayed_type(), and gui2::unit_preview_pane::set_displayed_unit().
std::string markup::tag | ( | const std::string & | tag_name, |
Args &&... | contents | ||
) |
<tag_name>
and </tag_name>
. Does not escape its contents and returns empty string if empty or no contents is passed.tag_name | Name of the tag. |
contents | Variable list of contents to enclose inside tag_name . Could anything that can be appended to a formatter. |
Definition at line 45 of file markup.hpp.
Referenced by schema_validation::wml_tag::add_tag(), gui2::dialogs::mp_lobby::adjust_game_row_contents(), bold(), carryover_show_gold(), schema_validation::schema_self_validator::check_for_duplicates(), gui2::dialogs::controller_name(), copy_persistent(), gui2::addon_list::display_title_full_shift(), events::console_handler::do_choose_level(), schema_validation::duplicate_key_error(), schema_validation::duplicate_tag_error(), schema_validation::wml_tag::expand_all(), schema_validation::extra_key_error(), schema_validation::schema_validator::find_mandatory_keys(), schema_validation::wml_tag::find_tag(), help::generate_era_topics(), help::generate_faction_topics(), help::generate_time_of_day_topics(), gui2::dialogs::preferences_dialog::get_friends_list_row_data(), gui2::get_hp_tooltip(), gui2::get_mp_tooltip(), schema_validation::inheritance_cycle_error(), schema_validation::inheritance_loop_error(), mp::initial_level_config(), intf_remove_modifications(), italic(), schema_validation::link_cycle_error(), config::merge_with(), schema_validation::missing_key_error(), missing_mandatory_wml_tag(), schema_validation::missing_super_error(), schema_validation::schema_validator::open_tag(), help::terrain_topic_generator::operator()(), help::unit_topic_generator::operator()(), parse_tag_contents(), parse_text(), gui2::dialogs::campaign_difficulty::pre_show(), gui2::dialogs::language_selection::pre_show(), schema_validation::wml_tag::printl(), schema_validation::wml_tag::iterator< T, Map >::push_new_tag_conditions(), schema_validation::wml_tag::push_new_tag_conditions(), actions::undo_action::read_event_vector(), schema_validation::wml_tag::remove_keys_by_type(), game_events::filter_dynamic::serialize(), gui2::unit_preview_pane::set_displayed_type(), gui2::unit_preview_pane::set_displayed_unit(), gui2::dialogs::team_mode_controller::show_ai_components(), synced_command::synced_command(), tod_stats_at(), schema_validation::schema_validator::validate(), schema_validation::schema_validator::validate_mandatory_keys(), game_events::wml_action::wml_action(), actions::undo_action::write_event_vector(), schema_validation::wrong_path_error(), schema_validation::wrong_type_error(), and schema_validation::wrong_value_error().
|
static |
Definition at line 33 of file markup.hpp.
Referenced by help::terrain_topic_generator::operator()(), mp::user_info::operator<(), terrain_builder::parse_config(), terrain_builder::parse_mapstring(), and rect::subrect().