Helper class for translatable strings. More...
#include <tstring.hpp>
Classes | |
class | walker |
Public Member Functions | |
t_string_base () | |
~t_string_base () | |
Default implementation, but defined out-of-line for efficiency reasons. More... | |
t_string_base (const t_string_base &) | |
Default implementation, but defined out-of-line for efficiency reasons. More... | |
t_string_base (t_string_base &&) noexcept=default | |
t_string_base (const std::string &string) | |
t_string_base (std::string &&string) | |
t_string_base (const std::string &string, const std::string &textdomain) | |
t_string_base (const std::string &sing, const std::string &pl, int count, const std::string &textdomain) | |
t_string_base (const char *string) | |
std::string | to_serialized () const |
t_string_base & | operator= (const t_string_base &) |
Default implementation, but defined out-of-line for efficiency reasons. More... | |
t_string_base & | operator= (t_string_base &&) noexcept=default |
t_string_base & | operator= (const std::string &) |
t_string_base & | operator= (const char *) |
t_string_base | operator+ (const t_string_base &) const |
t_string_base | operator+ (const std::string &) const |
t_string_base | operator+ (const char *) const |
t_string_base & | operator+= (const t_string_base &) |
t_string_base & | operator+= (const std::string &) |
t_string_base & | operator+= (const char *) |
bool | operator== (const t_string_base &) const |
bool | operator== (const std::string &) const |
bool | operator== (const char *string) const |
bool | operator!= (const t_string_base &that) const |
bool | operator!= (const std::string &that) const |
bool | operator!= (const char *that) const |
bool | operator< (const t_string_base &string) 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 |
std::size_t | hash_value () const |
Static Public Member Functions | |
static t_string_base | from_serialized (const std::string &string) |
Private Attributes | |
std::string | value_ |
std::string | translated_value_ |
unsigned | translation_timestamp_ |
bool | translatable_ |
bool | last_untranslatable_ |
Static Private Attributes | |
static std::vector< std::string > | id_to_textdomain |
static std::map< std::string, unsigned int > | textdomain_to_id |
Friends | |
class | walker |
Helper class for translatable strings.
Definition at line 26 of file tstring.hpp.
t_string_base::t_string_base | ( | ) |
Definition at line 220 of file tstring.cpp.
Referenced by from_serialized().
t_string_base::~t_string_base | ( | ) |
Default implementation, but defined out-of-line for efficiency reasons.
Definition at line 229 of file tstring.cpp.
t_string_base::t_string_base | ( | const t_string_base & | string | ) |
Default implementation, but defined out-of-line for efficiency reasons.
Definition at line 233 of file tstring.cpp.
|
defaultnoexcept |
t_string_base::t_string_base | ( | const std::string & | string | ) |
Definition at line 242 of file tstring.cpp.
t_string_base::t_string_base | ( | std::string && | string | ) |
Definition at line 251 of file tstring.cpp.
t_string_base::t_string_base | ( | const std::string & | string, |
const std::string & | textdomain | ||
) |
Definition at line 260 of file tstring.cpp.
References empty(), id, id_to_textdomain, textdomain_to_id, translatable_, and value_.
t_string_base::t_string_base | ( | const std::string & | sing, |
const std::string & | pl, | ||
int | count, | ||
const std::string & | textdomain | ||
) |
Definition at line 289 of file tstring.cpp.
References c, data, id, id_to_textdomain, textdomain_to_id, translatable_, and value_.
t_string_base::t_string_base | ( | const char * | string | ) |
Definition at line 331 of file tstring.cpp.
std::string t_string_base::base_str | ( | ) | const |
|
inline |
|
inline |
Definition at line 103 of file tstring.hpp.
References value_.
Referenced by t_string::empty(), from_serialized(), operator+=(), and t_string_base().
|
static |
Definition at line 340 of file tstring.cpp.
References empty(), t_string_base(), translatable_, and w.
Referenced by t_string::from_serialized().
std::size_t t_string_base::hash_value | ( | ) | const |
Definition at line 47 of file tstring.cpp.
References last_untranslatable_, translatable_, and value_.
Referenced by hash_value().
|
inline |
Definition at line 106 of file tstring.hpp.
References str().
|
inline |
Definition at line 98 of file tstring.hpp.
References operator==().
|
inline |
Definition at line 96 of file tstring.hpp.
References operator==().
|
inline |
Definition at line 94 of file tstring.hpp.
References operator==().
t_string_base t_string_base::operator+ | ( | const char * | string | ) | const |
Definition at line 445 of file tstring.cpp.
t_string_base t_string_base::operator+ | ( | const std::string & | string | ) | const |
Definition at line 438 of file tstring.cpp.
t_string_base t_string_base::operator+ | ( | const t_string_base & | string | ) | const |
Definition at line 431 of file tstring.cpp.
t_string_base & t_string_base::operator+= | ( | const char * | string | ) |
Definition at line 521 of file tstring.cpp.
References last_untranslatable_, translatable_, translated_value_, and value_.
t_string_base & t_string_base::operator+= | ( | const std::string & | string | ) |
Definition at line 495 of file tstring.cpp.
References empty(), last_untranslatable_, translatable_, translated_value_, and value_.
t_string_base & t_string_base::operator+= | ( | const t_string_base & | string | ) |
Definition at line 452 of file tstring.cpp.
References last_untranslatable_, translatable_, translated_value_, and value_.
bool t_string_base::operator< | ( | const t_string_base & | string | ) | const |
Definition at line 562 of file tstring.cpp.
References value_.
t_string_base & t_string_base::operator= | ( | const char * | string | ) |
Definition at line 420 of file tstring.cpp.
References last_untranslatable_, translatable_, translated_value_, translation_timestamp_, and value_.
t_string_base & t_string_base::operator= | ( | const std::string & | string | ) |
Definition at line 409 of file tstring.cpp.
References last_untranslatable_, translatable_, translated_value_, translation_timestamp_, and value_.
t_string_base & t_string_base::operator= | ( | const t_string_base & | string | ) |
Default implementation, but defined out-of-line for efficiency reasons.
Definition at line 398 of file tstring.cpp.
References last_untranslatable_, translatable_, translated_value_, translation_timestamp_, and value_.
|
defaultnoexcept |
bool t_string_base::operator== | ( | const char * | string | ) | const |
Definition at line 557 of file tstring.cpp.
References translatable_, and value_.
bool t_string_base::operator== | ( | const std::string & | that | ) | const |
Definition at line 552 of file tstring.cpp.
References translatable_, and value_.
bool t_string_base::operator== | ( | const t_string_base & | that | ) | const |
Definition at line 547 of file tstring.cpp.
References translatable_, and value_.
Referenced by operator!=().
|
inline |
const std::string & t_string_base::str | ( | ) | const |
Definition at line 567 of file tstring.cpp.
References translation::dsgettext(), translation::dsngettext(), language_counter, translatable_, translated_value_, translation_timestamp_, value_, and w.
Referenced by c_str(), operator const std::string &(), size(), and t_string::str().
std::string t_string_base::to_serialized | ( | ) | const |
Definition at line 375 of file tstring.cpp.
References last_untranslatable_, translatable_, value(), value_, and w.
Referenced by t_string::to_serialized().
|
inline |
Definition at line 109 of file tstring.hpp.
References translatable_.
Referenced by t_string::translatable().
|
inline |
Definition at line 113 of file tstring.hpp.
References value_.
Referenced by to_serialized(), and t_string::value().
|
friend |
Definition at line 57 of file tstring.hpp.
|
inlinestaticprivate |
Definition at line 123 of file tstring.hpp.
Referenced by t_string_base(), and t_string_base::walker::update().
|
private |
Definition at line 122 of file tstring.hpp.
Referenced by hash_value(), operator+=(), operator=(), and to_serialized().
|
inlinestaticprivate |
Definition at line 124 of file tstring.hpp.
Referenced by t_string_base().
|
private |
Definition at line 122 of file tstring.hpp.
Referenced by from_serialized(), hash_value(), operator+=(), operator=(), operator==(), str(), t_string_base(), to_serialized(), translatable(), and t_string_base::walker::update().
|
mutableprivate |
Definition at line 120 of file tstring.hpp.
Referenced by operator+=(), operator=(), and str().
|
mutableprivate |
Definition at line 121 of file tstring.hpp.
Referenced by operator=(), and str().
|
private |
Definition at line 119 of file tstring.hpp.
Referenced by empty(), hash_value(), operator+=(), operator<(), operator=(), operator==(), str(), t_string_base(), to_serialized(), and value().