A qualified UTF-8 string value that requires translation. More...
#include <value-types.hh>
Public Member Functions | |
Message (const char *source, Qualifier qualifier=Q_NEUTRAL) throw () | |
Constructs a new defined message. | |
Message (Qualifier qualifier=Q_UNK) throw () | |
Constructs a new undefined or empty message. | |
virtual int | compare (const value_base &other) const throw () |
virtual ustring | get_string (const ustring &format=ustring()) const throw () |
Returns a localized text representation of the value. | |
Public Attributes | |
ustring | value |
The untranslated message, if defined. | |
Protected Member Functions | |
virtual ustring | do_get_string (const ustring &format) const throw () |
Returns a localized text representation of a defined value. |
A qualified UTF-8 string value that requires translation.
Messages are compared by collation order.
Elemental::Message::Message | ( | const char * | source, | |
Qualifier | qualifier = Q_NEUTRAL | |||
) | throw () |
Constructs a new defined message.
source | The untranslated message. | |
qualifier | The qualification of the message. |
Elemental::Message::Message | ( | Qualifier | qualifier = Q_UNK |
) | throw () |
Constructs a new undefined or empty message.
qualifier | The qualification of the message. |
virtual ustring Elemental::Message::do_get_string | ( | const ustring & | format | ) | const throw () [protected, virtual] |
Returns a localized text representation of a defined value.
Derived classes must implement this function to produce a text representation based on the format. It will be called by get_string(), which will then decorate its output as appropriate for the current qualifier. If has_value() is false
, the behavior is undefined.
format | A compose-style format string. Derived classes may define the number of argument references expected in the string; the default is one. If format is empty, a minimal default should be used. |
Implements Elemental::value_base.
virtual ustring Elemental::Message::get_string | ( | const ustring & | format = ustring() |
) | const throw () [virtual] |
Returns a localized text representation of the value.
format | An optional compose-style format string with which to output the value. If not otherwise specified, the value is argument reference %1 . |
Reimplemented from Elemental::value_base.