#include "formula/string_utils.hpp"
#include "config.hpp"
#include "log.hpp"
#include "formula/formula.hpp"
#include "gettext.hpp"
Go to the source code of this file.
Classes | |
class | utils::string_map_variable_set |
Namespaces | |
utils | |
Macros | |
#define | ERR_NG LOG_STREAM(err, log_engine) |
Functions | |
static bool | two_dots (char a, char b) |
static std::string | do_interpolation (const std::string &str, const variable_set &set) |
std::string | utils::interpolate_variables_into_string (const std::string &str, const string_map *const symbols) |
Function which will interpolate variables, starting with '$' in the string 'str' with the equivalent symbols in the given symbol table. More... | |
std::string | utils::interpolate_variables_into_string (const std::string &str, const variable_set &variables) |
t_string | utils::interpolate_variables_into_tstring (const t_string &str, const variable_set &variables) |
Function that does the same as the above, for t_stringS. More... | |
std::string | vgettext (const char *msgid, const utils::string_map &symbols) |
std::string | vgettext (const char *domain, const char *msgid, const utils::string_map &symbols) |
std::string | vngettext (const char *sing, const char *plur, int n, const utils::string_map &symbols) |
Variables | |
static lg::log_domain | log_engine ("engine") |
#define ERR_NG LOG_STREAM(err, log_engine) |
Definition at line 24 of file string_utils.cpp.
Referenced by do_interpolation().
|
static |
the default value is specified after ''?'
Definition at line 49 of file string_utils.cpp.
References config::attribute_value::blank(), e, ERR_NG, game_logic::formula::evaluate(), game_logic::formula_error::formula, variable_set::get_variable_const(), int(), variant::string_cast(), two_dots(), and game_logic::formula_error::type.
Referenced by utils::interpolate_variables_into_string().
|
static |
Definition at line 26 of file string_utils.cpp.
Referenced by do_interpolation().
std::string vgettext | ( | const char * | msgid, |
const utils::string_map & | symbols | ||
) |
Definition at line 238 of file string_utils.cpp.
References _(), utils::interpolate_variables_into_string(), and game_logic::msg().
Referenced by ad_hoc_addon_fetch_session(), gui2::tpreferences::add_hotkey_callback(), unit::add_modification(), gui2::build(), events::chat_handler::change_logging(), mp::check_addon_version_compatibility(), addons_client::connect(), addons_client::delete_remote_addon(), deprecate_wml_key_warning(), deprecated_renamed_wml_key_warning(), unit::describe_builtin_effect(), events::console_handler::do_control(), events::console_handler::do_controller(), events::console_handler::do_droid(), events::console_handler::do_idle(), events::menu_handler::do_search(), addons_client::download_addon(), gui2::tgame_load::evaluate_summary_string(), game_info::game_info(), ng::configure_engine::game_name_default(), mp::generate_user_description(), mp::initial_level_config(), addons_client::install_addon(), editor::context_manager::load_map(), gui2::tgui_definition::load_widget_definitions(), missing_mandatory_wml_key(), gui2::missing_widget(), ng::side_engine::new_config(), open_connection(), wb::manager::options_dlg(), mp::gamebrowser::populate_game_item_addons_installed(), mp::gamebrowser::populate_game_item_campaign_or_scenario_info(), mp::gamebrowser::populate_game_item_era_info(), ng::create_engine::prepare_for_saved_game(), turn_info::process_network_data(), ng::flg_manager::resolve_random(), events::menu_handler::save_map(), editor::map_context::save_map(), editor::map_context::save_scenario(), gui2::tunit_preview_pane::set_displayed_type(), location_palette_item::set_item_id(), editor::editor_map::set_starting_position_labels(), gui2::tmp_change_control::controller::show_sides_list(), gui2::tdepcheck_confirm_change::tdepcheck_confirm_change(), gui2::tlabel_settings::tlabel_settings(), play_controller::hotkey_handler::toggle_accelerated_speed(), gui2::twindow_builder::tresolution::tresolution(), mp_ui_alerts::turn_changed(), user_choice_manager::update_local_choice(), addons_client::upload_addon(), playsingle_controller::hotkey_handler::whiteboard_toggle(), and editor::wrap_exc().
std::string vgettext | ( | const char * | domain, |
const char * | msgid, | ||
const utils::string_map & | symbols | ||
) |
Definition at line 245 of file string_utils.cpp.
References translation::dgettext(), utils::interpolate_variables_into_string(), and game_logic::msg().
std::string vngettext | ( | const char * | sing, |
const char * | plur, | ||
int | n, | ||
const utils::string_map & | symbols | ||
) |
Definition at line 253 of file string_utils.cpp.
References _n(), utils::interpolate_variables_into_string(), and game_logic::msg().
Referenced by events::menu_handler::recall(), and campaign_controller::report_victory().
|
static |