std::messages_byname (3) - Linux Manuals
std::messages_byname: std::messages_byname
NAME
std::messages_byname - std::messages_byname
Synopsis
Defined in header <locale>
template< class CharT >
class messages_byname : public std::messages<CharT>;
std::messages_byname is a std::messages facet which encapsulates retrieval of strings from message catalogs of the locale specified at its construction.
Two specializations are provided by the standard library
Defined in header <locale>
std::messages_byname<char> narrow/multibyte message catalog access
std::messages_byname<wchar_t> wide string message catalog access
Member types
Member type Definition
catalog std::messages_base<CharT>::catalog
string_type std::basic_string<CharT>
Member functions
constructor (public member function)
destructor (protected member function)
std::messages_byname::messages_byname
explicit messages_byname( const char* name, std::size_t refs = 0 );
explicit messages_byname( const std::string& name, std::size_t refs = 0 ); (since C++11)
Constructs a new std::messages_byname facet for a locale with name.
refs is used for resource management: if refs == 0, the implementation destroys the facet, when the last std::locale object holding it is destroyed. Otherwise, the object is not destroyed.
Parameters
name - the name of the locale
refs - the number of references that link to the facet
std::messages_byname::~messages_byname
protected:
~messages_byname();
Destroys the facet.
Inherited from std::messages
Member types
Member type Definition
char_type charT
string_type std::basic_string<charT>
Member objects
Member name Type
id (static) std::locale::id
Member functions
open (public member function of std::messages<CharT>)
get (public member function of std::messages<CharT>)
close (public member function of std::messages<CharT>)
Protected member functions
do_open opens a named message catalog
[virtual]
do_get retrieves a message from an open message catalog
[virtual]
do_close closes a message catalog
[virtual]
Example
// Run this code
Possible output:
See also
messages (class template)