OpenXcom
1.0
Open-source clone of the original X-Com
|
A string that is already translated. More...
#include <LocalizedText.h>
Public Member Functions | |
LocalizedText (const std::wstring &) | |
Create from existing unicode string. More... | |
LocalizedText () | |
Create the empty string. | |
operator std::wstring const & () const OX_REQUIRED_RESULT | |
Return constant wide string. More... | |
std::string | asUTF8 () const OX_REQUIRED_RESULT |
Return the UTF-8 representation of this string. More... | |
const wchar_t * | c_str () const OX_REQUIRED_RESULT |
Get a pointer to underlying wchat_t data. | |
LocalizedText | arg (std::wstring const &) const OX_REQUIRED_RESULT |
Replace next argument. More... | |
LocalizedText & | arg (std::wstring const &) OX_REQUIRED_RESULT |
Replace next argument. More... | |
template<typename T > | |
LocalizedText | arg (T) const OX_REQUIRED_RESULT |
Replace next argument. More... | |
template<typename T > | |
LocalizedText & | arg (T) OX_REQUIRED_RESULT |
Replace next argument. More... | |
A string that is already translated.
Using this class allows argument substitution in the translated strings.
|
inline |
Create from existing unicode string.
Create a LocalizedText from a localized std::wstring.
LocalizedText OpenXcom::LocalizedText::arg | ( | std::wstring const & | val | ) | const |
Replace next argument.
Replace the next argument placeholder with val.
val | The value to place in the next placeholder's position. |
LocalizedText & OpenXcom::LocalizedText::arg | ( | std::wstring const & | val | ) |
Replace next argument.
Replace the next argument placeholder with val.
val | The value to place in the next placeholder's position. |
LocalizedText OpenXcom::LocalizedText::arg | ( | T | val | ) | const |
Replace next argument.
Replace the next argument placeholder with val.
T | The type of the replacement value. It should be streamable to std::owstringstream. |
val | The value to place in the next placeholder's position. |
LocalizedText & OpenXcom::LocalizedText::arg | ( | T | val | ) |
Replace next argument.
Replace the next argument placeholder with val.
T | The type of the replacement value. It should be streamable to std::owstringstream. |
val | The value to place in the next placeholder's position. |
std::string OpenXcom::LocalizedText::asUTF8 | ( | ) | const |
Return the UTF-8 representation of this string.
|
inline |
Return constant wide string.
Typecast to constant std::wstring reference.
This is used to avoid copying when the string will not change.