The Battle for Wesnoth  1.15.0-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_stringoperator= (const t_string &)
 Default implementation, but defined out-of-line for efficiency reasons. More...
 
 t_string (const base &)
 
 t_string (const char *)
 
 t_string (const 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 123 of file tstring.hpp.

Member Typedef Documentation

◆ base

Definition at line 126 of file tstring.hpp.

◆ walker

Definition at line 127 of file tstring.hpp.

Constructor & Destructor Documentation

◆ t_string() [1/7]

t_string::t_string ( )

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

Definition at line 594 of file tstring.cpp.

◆ ~t_string()

t_string::~t_string ( )

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

Definition at line 599 of file tstring.cpp.

◆ t_string() [2/7]

t_string::t_string ( const t_string o)

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

Definition at line 603 of file tstring.cpp.

◆ t_string() [3/7]

t_string::t_string ( const base o)

Definition at line 608 of file tstring.cpp.

◆ t_string() [4/7]

t_string::t_string ( const char *  o)

Definition at line 613 of file tstring.cpp.

◆ t_string() [5/7]

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

Definition at line 618 of file tstring.cpp.

◆ t_string() [6/7]

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

Definition at line 623 of file tstring.cpp.

◆ t_string() [7/7]

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

Definition at line 628 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 646 of file tstring.cpp.

References translation::bind_textdomain(), and LOG_CF.

Referenced by init_textdomains().

◆ base_str()

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

Definition at line 190 of file tstring.hpp.

References base_str(), name, and path.

Referenced by attack_info(), base_str(), terrain_type::operator==(), and gui2::addon_list::select_addon().

◆ c_str()

const char* t_string::c_str ( ) const
inline

◆ empty()

bool t_string::empty ( ) const
inline

◆ 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 160 of file tstring.hpp.

References nw, and val_.

◆ operator const std::string &()

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

Definition at line 185 of file tstring.hpp.

◆ operator const t_string_base &()

t_string::operator const t_string_base & ( ) const
inline

Definition at line 152 of file tstring.hpp.

◆ operator!=() [1/3]

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

Definition at line 176 of file tstring.hpp.

References t_string_base::operator==().

◆ operator!=() [2/3]

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

Definition at line 177 of file tstring.hpp.

References t_string_base::operator==().

◆ operator!=() [3/3]

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

Definition at line 178 of file tstring.hpp.

References t_string_base::operator==().

◆ operator+() [1/3]

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

Definition at line 154 of file tstring.hpp.

References get().

◆ operator+() [2/3]

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

Definition at line 155 of file tstring.hpp.

◆ operator+() [3/3]

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

Definition at line 156 of file tstring.hpp.

◆ operator+=() [1/3]

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

Definition at line 168 of file tstring.hpp.

References get().

◆ operator+=() [2/3]

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

Definition at line 169 of file tstring.hpp.

◆ operator+=() [3/3]

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

Definition at line 170 of file tstring.hpp.

◆ operator<()

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

Definition at line 180 of file tstring.hpp.

References get().

◆ operator=() [1/2]

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

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

Definition at line 633 of file tstring.cpp.

References val_.

◆ operator=() [2/2]

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

Definition at line 639 of file tstring.cpp.

References swap().

◆ operator==() [1/3]

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

Definition at line 172 of file tstring.hpp.

References get().

◆ operator==() [2/3]

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

Definition at line 173 of file tstring.hpp.

◆ operator==() [3/3]

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

Definition at line 174 of file tstring.hpp.

◆ reset_translations()

void t_string::reset_translations ( )
static

Definition at line 654 of file tstring.cpp.

References language_counter.

Referenced by gui2::dialogs::title_screen::pre_show().

◆ size()

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

◆ str()

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

◆ swap()

void t_string::swap ( t_string other)
inline

Definition at line 196 of file tstring.hpp.

References val_, and val_.

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

◆ to_serialized()

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

Definition at line 150 of file tstring.hpp.

References to_serialized().

Referenced by ng::connect_engine::connect_engine(), and to_serialized().

◆ translatable()

bool t_string::translatable ( ) const
inline

Definition at line 188 of file tstring.hpp.

References translatable().

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

◆ value()

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

Definition at line 189 of file tstring.hpp.

References value().

Referenced by value().

Member Data Documentation

◆ val_

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

Definition at line 200 of file tstring.hpp.

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


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