libstdc++
std::messages< _CharT > Class Template Reference

#include <locale_facets_nonio.h>

Inheritance diagram for std::messages< _CharT >:
[legend]

Public Types

typedef int catalog
 
typedef _CharT char_type
 
typedef basic_string< _CharT > string_type
 

Public Member Functions

 messages (__c_locale __cloc, const char *__s, size_t __refs=0)
 
 messages (size_t __refs=0)
 
void close (catalog __c) const
 
string_type get (catalog __c, int __set, int __msgid, const string_type &__s) const
 
catalog open (const basic_string< char > &, const locale &, const char *) const
 
catalog open (const basic_string< char > &__s, const locale &__loc) const
 

Static Public Attributes

static locale::id id
 

Protected Member Functions

virtual ~messages ()
 
string_type _M_convert_from_char (char *) const
 
char * _M_convert_to_char (const string_type &__msg) const
 
virtual void do_close (catalog) const
 
void do_close (catalog) const
 
void do_close (catalog) const
 
string do_get (catalog, int, int, const string &) const
 
virtual string_type do_get (catalog, int, int, const string_type &__dfault) const
 
wstring do_get (catalog, int, int, const wstring &) const
 
virtual catalog do_open (const basic_string< char > &, const locale &) const
 
messages< char >::catalog do_open (const basic_string< char > &, const locale &) const
 
messages< wchar_t >::catalog do_open (const basic_string< char > &, const locale &) const
 

Static Protected Member Functions

static __c_locale _S_clone_c_locale (__c_locale &__cloc) throw ()
 
static void _S_create_c_locale (__c_locale &__cloc, const char *__s, __c_locale __old=0)
 
static void _S_destroy_c_locale (__c_locale &__cloc)
 
static __c_locale _S_get_c_locale ()
 
static const char * _S_get_c_name () throw ()
 
static __c_locale _S_lc_ctype_c_locale (__c_locale __cloc, const char *__s)
 

Protected Attributes

__c_locale _M_c_locale_messages
 
const char * _M_name_messages
 

Detailed Description

template<typename _CharT>
class std::messages< _CharT >

Primary class template messages.

This facet encapsulates the code to retrieve messages from message catalogs. The only thing defined by the standard for this facet is the interface. All underlying functionality is implementation-defined.

This library currently implements 3 versions of the message facet. The first version (gnu) is a wrapper around gettext, provided by libintl. The second version (ieee) is a wrapper around catgets. The final version (default) does no actual translation. These implementations are only provided for char and wchar_t instantiations.

The messages template uses protected virtual functions to provide the actual results. The public accessors forward the call to the virtual functions. These virtual functions are hooks for developers to implement the behavior they require from the messages facet.

Definition at line 1855 of file locale_facets_nonio.h.

Member Typedef Documentation

◆ catalog

typedef int std::messages_base::catalog
inherited

Definition at line 1828 of file locale_facets_nonio.h.

◆ char_type

template<typename _CharT>
typedef _CharT std::messages< _CharT >::char_type

Public typedefs.

Definition at line 1861 of file locale_facets_nonio.h.

◆ string_type

template<typename _CharT>
typedef basic_string<_CharT> std::messages< _CharT >::string_type

Public typedefs.

Definition at line 1862 of file locale_facets_nonio.h.

Constructor & Destructor Documentation

◆ messages() [1/2]

template<typename _CharT>
std::messages< _CharT >::messages ( size_t __refs = 0)
explicit

Constructor performs initialization.

This is the constructor provided by the standard.

Parameters
__refsPassed to the base facet class.

Definition at line 44 of file messages_members.h.

References std::locale::facet::facet().

◆ messages() [2/2]

template<typename _CharT>
std::messages< _CharT >::messages ( __c_locale __cloc,
const char * __s,
size_t __refs = 0 )
explicit

Internal constructor. Not for general use.

This is a constructor for use by the library itself to set up new locales.

Parameters
__clocThe C locale.
__sThe name of a locale.
__refsRefcount to pass to the base class.

Definition at line 50 of file messages_members.h.

References std::locale::facet::facet().

◆ ~messages()

template<typename _CharT>
std::messages< _CharT >::~messages ( )
protectedvirtual

Destructor.

Definition at line 79 of file messages_members.h.

Member Function Documentation

◆ _M_convert_from_char()

template<typename _CharT>
string_type std::messages< _CharT >::_M_convert_from_char ( char * ) const
inlineprotected

Definition at line 2016 of file locale_facets_nonio.h.

◆ _M_convert_to_char()

template<typename _CharT>
char * std::messages< _CharT >::_M_convert_to_char ( const string_type & __msg) const
inlineprotected

Definition at line 2008 of file locale_facets_nonio.h.

◆ close()

template<typename _CharT>
void std::messages< _CharT >::close ( catalog __c) const
inline

Definition at line 1957 of file locale_facets_nonio.h.

◆ do_close()

template<typename _CharT>
void std::messages< _CharT >::do_close ( catalog ) const
protectedvirtual

Definition at line 99 of file messages_members.h.

◆ do_get()

string std::messages< char >::do_get ( catalog ,
int ,
int ,
const string &  ) const
protected

Specializations for required instantiations.

◆ do_open()

template<typename _CharT>
messages< _CharT >::catalog std::messages< _CharT >::do_open ( const basic_string< char > & __s,
const locale &  ) const
protectedvirtual

Definition at line 88 of file messages_members.h.

◆ get()

template<typename _CharT>
string_type std::messages< _CharT >::get ( catalog __c,
int __set,
int __msgid,
const string_type & __s ) const
inline

Definition at line 1946 of file locale_facets_nonio.h.

◆ open() [1/2]

template<typename _CharT>
messages< _CharT >::catalog std::messages< _CharT >::open ( const basic_string< char > & __s,
const locale & __loc,
const char * __dir ) const

Definition at line 70 of file messages_members.h.

◆ open() [2/2]

template<typename _CharT>
catalog std::messages< _CharT >::open ( const basic_string< char > & __s,
const locale & __loc ) const
inline

Definition at line 1910 of file locale_facets_nonio.h.

Member Data Documentation

◆ _M_c_locale_messages

template<typename _CharT>
__c_locale std::messages< _CharT >::_M_c_locale_messages
protected

Definition at line 1868 of file locale_facets_nonio.h.

◆ _M_name_messages

template<typename _CharT>
const char* std::messages< _CharT >::_M_name_messages
protected

Definition at line 1869 of file locale_facets_nonio.h.

◆ id

template<typename _CharT>
locale::id std::messages< _CharT >::id
static

Numpunct facet id.

Definition at line 1873 of file locale_facets_nonio.h.


The documentation for this class was generated from the following files: