Overview
Message catalogs are basically string tables used by the operating systems to store system messages.
Details
Message catalogs are stored under language specific subdirectories, under msg folder of the Operating system. There various tools such as gentext or gencat to create catalogs.
Topics messages_base messages
messages_base
This is a base classes messages facet. It defines the following member inherited by all the derived classes.
int catalog
messages
The messages standard facet is used to read individual strings from a message catalog.
Syntax
template<class CharT>class messages:public facet, public message_base
CharT can be char and whcar_t. It's aliased as member char_type. It represents the type of the characters in the sequence to interpret.
Specializations
//narrow string representations of messages messages<char> //wide string representations of messages
messages<wchar_t>
Fields
Name | Description |
---|---|
locale::id id | the identifier of the facet. Represents the messages category of the facet. |
types
Name | Description |
---|---|
char_type | Represents the character type. It's a typedef for CharT . |
string_type | Represents string type corresponding to the character type. It's a typedef for basic_string<charT> |
Constructor
Name | Description |
---|---|
messages(size_t refs = 0) | Creates a messages facet and forwards the starting reference count refs to the base class constructor, locale::facet::facet() |
Methods
Name | Description |
---|---|
catalog open (const string& name, const locale& loc) | Opens the message catalog by name to access messages and returns an object that uniquely identifies the catalog when calling member messages::get. Returns negative number upon failures. |
char_type get (catalog cat, int set, int msgid, const string_type& def ) | Retrieves the message identified by set, msgid, and def in the catalog cat. If the message is not found, def is returned. |
void close (catalog cat) | Closes the opened catalog identified by cat. |
Example |
No comments:
Post a Comment