The Battle for Wesnoth  1.19.5+dev
Public Types | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | List of all members
t_string Class Reference

#include <tstring.hpp>

Public Types

typedef t_string_base base
 
typedef t_string_base::walker walker
 

Public Member Functions

 t_string ()
 Default implementation, but defined out-of-line for efficiency reasons. More...
 
 ~t_string ()
 Default implementation, but defined out-of-line for efficiency reasons. More...
 
 t_string (const t_string &)
 Default implementation, but defined out-of-line for efficiency reasons. More...
 
 t_string (t_string &&) noexcept=default
 
t_stringoperator= (const t_string &)
 Default implementation, but defined out-of-line for efficiency reasons. More...
 
t_stringoperator= (t_string &&) noexcept=default
 
 t_string (const base &)
 
 t_string (const char *)
 
 t_string (const std::string &)
 
 t_string (std::string &&)
 
 t_string (const std::string &str, const std::string &textdomain)
 
 t_string (const std::string &sing, const std::string &pl, int count, const std::string &textdomain)
 
t_stringoperator= (const char *o)
 
std::string to_serialized () const
 
 operator const t_string_base & () const
 
t_string operator+ (const t_string &o) const
 
t_string operator+ (const std::string &o) const
 
t_string operator+ (const char *o) const
 
t_stringoperator+= (const t_string &o)
 
t_stringoperator+= (const std::string &o)
 
t_stringoperator+= (const char *o)
 
bool operator== (const t_string &o) const
 
bool operator== (const std::string &o) const
 
bool operator== (const char *o) const
 
bool operator!= (const t_string &o) const
 
bool operator!= (const std::string &o) const
 
bool operator!= (const char *o) const
 
bool operator< (const t_string &o) const
 
bool empty () const
 
std::string::size_type size () const
 
 operator const std::string & () const
 
const std::string & str () const
 
const char * c_str () const
 
bool translatable () const
 
const std::string & value () const
 
std::string base_str () const
 
const t_string_baseget () const
 
void swap (t_string &other)
 

Static Public Member Functions

static t_string from_serialized (const std::string &string)
 
static void add_textdomain (const std::string &name, const std::string &path)
 
static void reset_translations ()
 

Private Member Functions

template<typename T >
void increase_impl (const T &other)
 

Private Attributes

std::shared_ptr< const t_string_baseval_
 

Detailed Description

Definition at line 130 of file tstring.hpp.

Member Typedef Documentation

◆ base

Definition at line 133 of file tstring.hpp.

◆ walker

Definition at line 134 of file tstring.hpp.

Constructor & Destructor Documentation

◆ t_string() [1/9]

t_string::t_string ( )

Default implementation, but defined out-of-line for efficiency reasons.

Definition at line 600 of file tstring.cpp.

Referenced by from_serialized().

◆ ~t_string()

t_string::~t_string ( )

Default implementation, but defined out-of-line for efficiency reasons.

Definition at line 605 of file tstring.cpp.

◆ t_string() [2/9]

t_string::t_string ( const t_string o)

Default implementation, but defined out-of-line for efficiency reasons.

Definition at line 609 of file tstring.cpp.

◆ t_string() [3/9]

t_string::t_string ( t_string &&  )
defaultnoexcept

◆ t_string() [4/9]

t_string::t_string ( const base o)

Definition at line 614 of file tstring.cpp.

◆ t_string() [5/9]

t_string::t_string ( const char *  o)

Definition at line 619 of file tstring.cpp.

◆ t_string() [6/9]

t_string::t_string ( const std::string &  o)

Definition at line 624 of file tstring.cpp.

◆ t_string() [7/9]

t_string::t_string ( std::string &&  o)

Definition at line 629 of file tstring.cpp.

◆ t_string() [8/9]

t_string::t_string ( const std::string &  str,
const std::string &  textdomain 
)

Definition at line 634 of file tstring.cpp.

◆ t_string() [9/9]

t_string::t_string ( const std::string &  sing,
const std::string &  pl,
int  count,
const std::string &  textdomain 
)

Definition at line 639 of file tstring.cpp.

Member Function Documentation

◆ add_textdomain()

void t_string::add_textdomain ( const std::string &  name,
const std::string &  path 
)
static

Definition at line 657 of file tstring.cpp.

References translation::bind_textdomain(), LOG_CF, and game_config::path.

Referenced by init_textdomains().

◆ base_str()

std::string t_string::base_str ( ) const
inline

◆ c_str()

const char* t_string::c_str ( ) const
inline

Definition at line 199 of file tstring.hpp.

References t_string_base::c_str(), and get().

Referenced by append_special_note().

◆ empty()

bool t_string::empty ( ) const
inline

Definition at line 194 of file tstring.hpp.

References t_string_base::empty(), and get().

Referenced by achievement::achievement(), unit::add_modification(), add_name(), unit::add_trait_description(), append_special_note(), attack_type::apply_modification(), attack_type::attack_type(), gui2::styled_widget::calculate_best_size(), terrain_label::calculate_shroud(), gui2::image::can_mouse_focus(), gui2::label::can_mouse_focus(), gui2::rich_label::can_mouse_focus(), team::change_team(), terrain_type::description(), gui2::text_shape::draw(), terrain_type::editor_name(), events::menu_handler::end_turn(), unit::generate_name(), gui2::styled_widget::get_best_text_size(), gui2::rich_label::get_label(), gui2::slider::get_value_label(), gui2::gui_definition::gui_definition(), gui2::dialogs::unit_create::list_item_clicked(), team_builder::objectives(), help::terrain_topic_generator::operator()(), gui2::styled_widget::place(), gui2::dialogs::game_stats::pre_show(), gui2::dialogs::unit_attack::pre_show(), gui2::dialogs::unit_list::pre_show(), gui2::dialogs::unit_recall::pre_show(), gui2::dialogs::unit_recruit::pre_show(), help::print_behavior_description(), terrain_label::recalculate(), gui2::styled_widget::request_reduce_height(), gui2::styled_widget::request_reduce_width(), gui2::unit_preview_pane::set_displayed_type(), gui2::unit_preview_pane::set_displayed_unit(), gui2::styled_widget::set_tooltip(), team::side_name(), team::side_name_tstr(), gui2::styled_widget::signal_handler_show_helptip(), gui2::styled_widget::signal_handler_show_tooltip(), attack_type::special_tooltips(), gui2::styled_widget::styled_widget(), gui2::styled_widget_definition::styled_widget_definition(), terrain_type::terrain_type(), unit_type::unit_description(), unit_race::unit_race(), attack_type::weapon_specials(), and config_attribute_value::write_if_not_empty().

◆ from_serialized()

static t_string t_string::from_serialized ( const std::string &  string)
inlinestatic

◆ get()

const t_string_base& t_string::get ( ) const
inline

◆ increase_impl()

template<typename T >
void t_string::increase_impl ( const T &  other)
inlineprivate

Definition at line 172 of file tstring.hpp.

References get(), nw, and val_.

Referenced by operator+=().

◆ operator const std::string &()

t_string::operator const std::string & ( ) const
inline

Definition at line 197 of file tstring.hpp.

References get().

◆ operator const t_string_base &()

t_string::operator const t_string_base & ( ) const
inline

Definition at line 164 of file tstring.hpp.

References get().

◆ operator!=() [1/3]

bool t_string::operator!= ( const char *  o) const
inline

Definition at line 190 of file tstring.hpp.

References operator==().

◆ operator!=() [2/3]

bool t_string::operator!= ( const std::string &  o) const
inline

Definition at line 189 of file tstring.hpp.

References operator==().

◆ operator!=() [3/3]

bool t_string::operator!= ( const t_string o) const
inline

Definition at line 188 of file tstring.hpp.

References operator==().

◆ operator+() [1/3]

t_string t_string::operator+ ( const char *  o) const
inline

Definition at line 168 of file tstring.hpp.

References get().

◆ operator+() [2/3]

t_string t_string::operator+ ( const std::string &  o) const
inline

Definition at line 167 of file tstring.hpp.

References get().

◆ operator+() [3/3]

t_string t_string::operator+ ( const t_string o) const
inline

Definition at line 166 of file tstring.hpp.

References get().

◆ operator+=() [1/3]

t_string& t_string::operator+= ( const char *  o)
inline

Definition at line 182 of file tstring.hpp.

References increase_impl().

◆ operator+=() [2/3]

t_string& t_string::operator+= ( const std::string &  o)
inline

Definition at line 181 of file tstring.hpp.

References increase_impl().

◆ operator+=() [3/3]

t_string& t_string::operator+= ( const t_string o)
inline

Definition at line 180 of file tstring.hpp.

References get(), and increase_impl().

◆ operator<()

bool t_string::operator< ( const t_string o) const
inline

Definition at line 192 of file tstring.hpp.

References get().

◆ operator=() [1/3]

t_string & t_string::operator= ( const char *  o)

Definition at line 650 of file tstring.cpp.

References swap().

◆ operator=() [2/3]

t_string & t_string::operator= ( const t_string o)

Default implementation, but defined out-of-line for efficiency reasons.

Definition at line 644 of file tstring.cpp.

References val_.

◆ operator=() [3/3]

t_string& t_string::operator= ( t_string &&  )
defaultnoexcept

◆ operator==() [1/3]

bool t_string::operator== ( const char *  o) const
inline

Definition at line 186 of file tstring.hpp.

References get().

◆ operator==() [2/3]

bool t_string::operator== ( const std::string &  o) const
inline

Definition at line 185 of file tstring.hpp.

References get().

◆ operator==() [3/3]

bool t_string::operator== ( const t_string o) const
inline

Definition at line 184 of file tstring.hpp.

References get().

Referenced by operator!=().

◆ reset_translations()

void t_string::reset_translations ( )
static

Definition at line 665 of file tstring.cpp.

References language_counter.

Referenced by game_launcher::change_language().

◆ size()

std::string::size_type t_string::size ( ) const
inline

Definition at line 195 of file tstring.hpp.

References get(), and t_string_base::size().

Referenced by gui2::text_shape::draw().

◆ str()

const std::string& t_string::str ( ) const
inline

◆ swap()

void t_string::swap ( t_string other)
inline

Definition at line 208 of file tstring.hpp.

References val_.

Referenced by operator=(), and swap().

◆ to_serialized()

std::string t_string::to_serialized ( ) const
inline

Definition at line 162 of file tstring.hpp.

References get(), and t_string_base::to_serialized().

Referenced by ng::connect_engine::connect_engine().

◆ translatable()

bool t_string::translatable ( ) const
inline

Definition at line 200 of file tstring.hpp.

References get(), and t_string_base::translatable().

Referenced by config_attribute_value::operator=(), and team::team_info::read().

◆ value()

const std::string& t_string::value ( ) const
inline

Definition at line 201 of file tstring.hpp.

References get(), and t_string_base::value().

Member Data Documentation

◆ val_

std::shared_ptr<const t_string_base> t_string::val_
private

Definition at line 212 of file tstring.hpp.

Referenced by get(), increase_impl(), operator=(), and swap().


The documentation for this class was generated from the following files: