The Battle for Wesnoth  1.13.10+dev
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Classes | Namespaces | Macros | Functions | Variables
string_utils.cpp File Reference
#include "formula/string_utils.hpp"
#include "config.hpp"
#include "log.hpp"
#include "formula/formula.hpp"
#include "gettext.hpp"
Include dependency graph for string_utils.cpp:

Go to the source code of this file.

Classes

class  utils::string_map_variable_set< T >
 

Namespaces

 utils
 

Macros

#define GETTEXT_DOMAIN   "wesnoth-lib"
 
#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 std::map< std::string, std::string > *const symbols)
 
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 utils::format_conjunct_list (const t_string &empty, const std::vector< t_string > &elems)
 Format a conjunctive list. More...
 
std::string utils::format_disjunct_list (const t_string &empty, const std::vector< t_string > &elems)
 Format a disjunctive list. 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)
 
std::string vngettext (const char *domain, const char *sing, const char *plur, int n, const utils::string_map &symbols)
 

Variables

static lg::log_domain log_engine ("engine")
 

Macro Definition Documentation

#define ERR_NG   LOG_STREAM(err, log_engine)

Definition at line 26 of file string_utils.cpp.

Referenced by do_interpolation().

#define GETTEXT_DOMAIN   "wesnoth-lib"

Definition at line 16 of file string_utils.cpp.

Function Documentation

static std::string do_interpolation ( const std::string &  str,
const variable_set set 
)
static
static bool two_dots ( char  a,
char  b 
)
static

Definition at line 28 of file string_utils.cpp.

Referenced by do_interpolation().

std::string vgettext ( const char *  msgid,
const utils::string_map symbols 
)

Definition at line 283 of file string_utils.cpp.

References _(), utils::interpolate_variables_into_string(), and wfl::msg().

Referenced by ad_hoc_addon_fetch_session(), gui2::dialogs::preferences_dialog::add_hotkey_callback(), unit::add_modification(), gui2::chatbox::add_whisper_sent(), gui2::build(), events::chat_handler::change_logging(), mp::game_info::check_addon_version_compatibility(), addons_client::connect(), gui2::dialogs::addon_manager::delete_addon(), addons_client::delete_remote_addon(), gui2::dialogs::depcheck_confirm_change::depcheck_confirm_change(), deprecate_wml_key_warning(), deprecated_renamed_wml_key_warning(), unit::describe_builtin_effect(), addons_client::do_check_before_overwriting_addon(), 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::dialogs::game_load::evaluate_summary_string(), gui2::dialogs::addon_manager::execute_default_action(), mp::game_info::game_info(), ng::configure_engine::game_name_default(), gui2::dialogs::generate_user_description(), mp::initial_level_config(), addons_client::install_addon(), gui2::dialogs::label_settings::label_settings(), editor::context_manager::load_map(), gui2::gui_definition::load_widget_definitions(), missing_mandatory_wml_key(), gui2::missing_widget(), ng::side_engine::new_config(), gui2::dialogs::file_dialog::on_dir_create_cmd(), gui2::dialogs::file_dialog::on_file_delete_cmd(), open_connection(), wb::manager::options_dlg(), gui2::parse_linked_group_definitions(), gui2::dialogs::mp_change_control::pre_show(), ng::create_engine::prepare_for_saved_game(), turn_info::process_network_data(), gui2::chatbox::process_room_join(), gui2::chatbox::process_room_part(), gui2::dialogs::file_dialog::process_submit_common(), ng::flg_manager::resolve_random(), events::menu_handler::save_map(), editor::map_context::save_map(), editor::map_context::save_scenario(), gui2::chatbox::search_create_window(), gui2::unit_preview_pane::set_displayed_type(), gui2::unit_preview_pane::set_displayed_unit(), location_palette_item::set_item_id(), editor::editor_map::set_starting_position_labels(), preferences::show_wesnothd_server_search(), play_controller::hotkey_handler::toggle_accelerated_speed(), mp_ui_alerts::turn_changed(), gui2::dialogs::mp_lobby::update_gamelist_header(), 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 
)
std::string vngettext ( const char *  sing,
const char *  plur,
int  n,
const utils::string_map symbols 
)

Definition at line 298 of file string_utils.cpp.

References _n(), utils::interpolate_variables_into_string(), and wfl::msg().

std::string vngettext ( const char *  domain,
const char *  sing,
const char *  plur,
int  n,
const utils::string_map symbols 
)

Variable Documentation

lg::log_domain log_engine("engine")
static