This class represents a message that can be converted to a specific locale message. More...
#include <message.hpp>
Public Types | |
typedef CharType | char_type |
The character this message object is used with. More... | |
typedef std::basic_string < char_type > | string_type |
The string type this object can be used with. More... | |
typedef message_format< char_type > | facet_type |
The type of the facet the messages are fetched with. More... | |
Public Member Functions | |
basic_message () | |
Create default empty message. More... | |
basic_message (char_type const *id) | |
Create a simple message from 0 terminated string. More... | |
basic_message (char_type const *single, char_type const *plural, int n) | |
Create a simple plural form message from 0 terminated strings. More... | |
basic_message (char_type const *context, char_type const *id) | |
Create a simple message from 0 terminated strings, with context information. More... | |
basic_message (char_type const *context, char_type const *single, char_type const *plural, int n) | |
Create a simple plural form message from 0 terminated strings, with context. More... | |
basic_message (string_type const &id) | |
Create a simple message from a string. More... | |
basic_message (string_type const &single, string_type const &plural, int number) | |
Create a simple plural form message from strings. More... | |
basic_message (string_type const &context, string_type const &id) | |
Create a simple message from a string with context. More... | |
basic_message (string_type const &context, string_type const &single, string_type const &plural, int number) | |
Create a simple plural form message from strings. More... | |
basic_message (basic_message const &other) | |
Copy an object. More... | |
basic_message const & | operator= (basic_message const &other) |
Assign other message object to this one. More... | |
void | swap (basic_message &other) |
Swap two message objects. More... | |
operator string_type () const | |
Message class can be explicitly converted to string class. More... | |
string_type | str () const |
Translate message to a string in the default global locale, using default domain. More... | |
string_type | str (std::locale const &locale) const |
Translate message to a string in the locale locale, using default domain. More... | |
string_type | str (std::locale const &locale, std::string const &domain_id) const |
Translate message to a string using locale locale and message domain domain_id. More... | |
string_type | str (std::string const &domain_id) const |
Translate message to a string using the default locale and message domain domain_id. More... | |
string_type | str (std::locale const &loc, int id) const |
Translate message to a string using locale loc and message domain index id. More... | |
void | write (std::basic_ostream< char_type > &out) const |
Translate message and write to stream out, using imbued locale and domain set to the stream. More... | |
This class represents a message that can be converted to a specific locale message.
It holds the original ASCII string that is queried in the dictionary when converting to the output string. The created string may be UTF-8, UTF-16, UTF-32 or other 8-bit encoded string according to the target character type and locale encoding.