![]() |
OpendTect-6_4
6.4
|
Public Member Functions | |
uiString () | |
uiString (const uiString &) | |
no copy, ref counted More... | |
~uiString () | |
uiString & | set (const char *) |
bool | isSet () const |
bool | isEmpty () const |
void | setEmpty () |
uiString & | toLower (bool yn=true) |
bool | operator! () const |
uiString & | operator= (const uiString &) |
no copy, ref counted More... | |
bool | operator> (const uiString &b) const |
bool | operator< (const uiString &b) const |
int | size () const |
template<class T > | |
uiString & | arg (const T &var) |
uiString & | arg (const uiString &) |
uiString & | append (const char *, bool withnewline=false) |
uiString & | append (const OD::String &, bool withnewline=false) |
uiString & | append (const uiString &, bool withnewline=false) |
const OD::String & | getFullString (BufferString *=0) const |
wchar_t * | createWCharString () const |
const char * | getOriginalString () const |
const ::QString & | getQString () const |
const ::QString & | fillQString (QString &) const |
void | getHexEncoded (BufferString &) const |
bool | setFromHexEncoded (const char *) |
uiString (const char *) | |
uiString (const OD::String &) | |
uiString & | operator= (const char *) |
uiString & | operator= (const OD::String &) |
bool | operator== (const uiString &b) const |
Don't use, will force crash. Only here to keep TypeSet happy. More... | |
bool | operator!= (const uiString &b) const |
Don't use, will force crash. Only here to keep TypeSet happy. More... | |
bool | isEqualTo (const uiString &oth) const |
Do use, but only if unavoidable. More... | |
void | makeIndependent () |
If data is shared, I'll get an own copy. More... | |
uiString (const char *original, const char *context, const char *application, const char *disambiguation, int pluralnr) | |
void | setFrom (const ::QString &) |
void | addLegacyVersion (const uiString &) |
bool | translate (const ::QTranslator &,::QString &) const |
Returns true if the translation succeeded. More... | |
uiString & | addSpace (int nr=1) |
Static Public Member Functions | |
static const uiString & | emptyString () |
static const char * | sODLocalizationApplication () |
static uiString | getOrderString (int) |
Private Member Functions | |
bool | isCacheValid () const |
Reads hex-data and sets the translated str. More... | |
const ::QString & | getQStringInternal () const |
Static Private Member Functions | |
static uiString | tr (const char *text, const char *disambiguation=0, int pluralnr=-1) |
static uiString | legacyTr (const char *text, const char *disambiguation=0, int pluralnr=-1) |
Private Attributes | |
uiStringData * | data_ |
Threads::Lock | datalock_ |
Protects data_ variable. More... | |
Static Private Attributes | |
static const uiString | emptystring_ |
Friends | |
class | uiStringData |
String that is able to hold wide character strings for the user interface. These strings can be in different encodings and should only be used to pass text to the ui.
The string may have an original string encoded in ASCI characters, but that should only be used for object names and similar.
If the string holds N arguments, these can be replaced by arguments:
Will result in the string "4 plus 5 is 9"
The translation in OpendTect is done using Qt's subsystem for localization. A class that wishes to enable localization should:
uiString::uiString | ( | ) |
uiString::uiString | ( | const uiString & | ) |
no copy, ref counted
uiString::~uiString | ( | ) |
uiString::uiString | ( | const char * | ) |
uiString::uiString | ( | const OD::String & | ) |
uiString::uiString | ( | const char * | original, |
const char * | context, | ||
const char * | application, | ||
const char * | disambiguation, | ||
int | pluralnr | ||
) |
void uiString::addLegacyVersion | ( | const uiString & | ) |
If this string was previously known by another origial string, it can be added here. This is normally done with the legacyTr function.
uiString& uiString::addSpace | ( | int | nr = 1 | ) |
uiString& uiString::append | ( | const char * | , |
bool | withnewline = false |
||
) |
append() functions are used to concatenate entire sentences. Otherwise you'll be in trouble because you will not know in what order args end up after translation. 'withnewline' will only add one if the first string is not empty.
uiString& uiString::append | ( | const OD::String & | , |
bool | withnewline = false |
||
) |
|
inline |
wchar_t* uiString::createWCharString | ( | ) | const |
The translation. Result becomes owner's and should be deleted using the [] operator.
|
inlinestatic |
const :: QString& uiString::fillQString | ( | QString & | ) | const |
Fully thread-safe. Returns input
const OD::String& uiString::getFullString | ( | BufferString * | = 0 | ) | const |
Results: Full string, without translation result is in a thread-safe static buffer, so copy the result before calling again. If BufferString is given, it will be filled, and static buffer won't be used.
void uiString::getHexEncoded | ( | BufferString & | ) | const |
Encodes translated string into a const char* buffer that can has only 0-9 A-F
|
static |
const char* uiString::getOriginalString | ( | ) | const |
const :: QString& uiString::getQString | ( | ) | const |
Returns reference, so could be unsafe
|
private |
|
private |
Reads hex-data and sets the translated str.
bool uiString::isEmpty | ( | ) | const |
bool uiString::isEqualTo | ( | const uiString & | oth | ) | const |
Do use, but only if unavoidable.
|
inline |
|
inlinestaticprivate |
void uiString::makeIndependent | ( | ) |
If data is shared, I'll get an own copy.
|
inline |
|
inline |
Don't use, will force crash. Only here to keep TypeSet happy.
bool uiString::operator< | ( | const uiString & | b | ) | const |
uiString& uiString::operator= | ( | const char * | ) |
uiString& uiString::operator= | ( | const OD::String & | ) |
Don't use. May be depreciated. Use toUiString("My text") function instead.
bool uiString::operator== | ( | const uiString & | b | ) | const |
Don't use, will force crash. Only here to keep TypeSet happy.
bool uiString::operator> | ( | const uiString & | b | ) | const |
uiString& uiString::set | ( | const char * | ) |
void uiString::setEmpty | ( | ) |
void uiString::setFrom | ( | const ::QString & | ) |
Set the translated text no further translation will be done.
bool uiString::setFromHexEncoded | ( | const char * | ) |
int uiString::size | ( | ) | const |
|
inlinestatic |
uiString& uiString::toLower | ( | bool | yn = true | ) |
Set output to lowercase, if allowed by language This is applied before eventual arguments.
|
inlinestaticprivate |
bool uiString::translate | ( | const ::QTranslator & | , |
::QString & | |||
) | const |
Returns true if the translation succeeded.
|
friend |
|
mutableprivate |
|
mutableprivate |
Protects data_ variable.
|
staticprivate |
Generated at 12/02/2019 10:57:16 for the OpendTect seismic interpretation project. Copyright (C): dGB Beheer B. V. 2019