std::messages< _CharT > Class Template Reference

Facet for handling message catalogs. More...

#include <locale_facets.h>

Inheritance diagram for std::messages< _CharT >:

std::locale::facet std::messages_base std::messages_byname< _CharT > List of all members.

Public Types

typedef _CharT char_type
 Public typedefs.
typedef basic_string< _CharT > string_type

Public Member Functions

 messages (size_t __refs=0)
 Constructor performs initialization.
 messages (__c_locale __cloc, const char *__s, size_t __refs=0)
 Internal constructor. Not for general use.
catalog open (const basic_string< char > &__s, const locale &__loc) const
catalog open (const basic_string< char > &, const locale &, const char *) const
string_type get (catalog __c, int __set, int __msgid, const string_type &__s) const
void close (catalog __c) const
template<>
string do_get (catalog, int, int, const string &) const

Static Public Attributes

static locale::id id
 Numpunct facet id.

Protected Member Functions

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

Protected Attributes

__c_locale _M_c_locale_messages
const char * _M_name_messages

Detailed Description

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

Facet for handling message catalogs.

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 4317 of file locale_facets.h.


Member Typedef Documentation

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

Public typedefs.

Reimplemented in std::messages_byname< _CharT >.

Definition at line 4323 of file locale_facets.h.

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

Reimplemented in std::messages_byname< _CharT >.

Definition at line 4324 of file locale_facets.h.


Constructor & Destructor Documentation

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

Constructor performs initialization.

This is the constructor provided by the standard.

Parameters:
refs Passed to the base facet class.

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:
cloc The "C" locale.
s The name of a locale.
refs Refcount to pass to the base class.

template<typename _CharT>
virtual std::messages< _CharT >::~messages (  )  [protected, virtual]

Destructor.


Member Function Documentation

template<typename _CharT>
string_type std::messages< _CharT >::_M_convert_from_char ( char *   )  const [inline, protected]

Definition at line 4478 of file locale_facets.h.

References std::locale::facet::locale.

template<typename _CharT>
char* std::messages< _CharT >::_M_convert_to_char ( const string_type __msg  )  const [inline, protected]

Definition at line 4470 of file locale_facets.h.

References std::basic_string< _CharT, _Traits, _Alloc >::c_str().

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

Definition at line 4419 of file locale_facets.h.

References std::messages< _CharT >::do_close().

template<typename _CharT>
virtual void std::messages< _CharT >::do_close ( catalog   )  const [protected, virtual]

Referenced by std::messages< _CharT >::close().

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

template<typename _CharT>
virtual string_type std::messages< _CharT >::do_get ( catalog  ,
int  ,
int  ,
const string_type __dfault 
) const [protected, virtual]

Referenced by std::messages< _CharT >::get().

template<typename _CharT>
virtual catalog std::messages< _CharT >::do_open ( const basic_string< char > &  ,
const locale  
) const [protected, virtual]

Referenced by std::messages< _CharT >::open().

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

Definition at line 4408 of file locale_facets.h.

References std::messages< _CharT >::do_get().

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

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

Definition at line 4372 of file locale_facets.h.

References std::messages< _CharT >::do_open().


Member Data Documentation

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

Definition at line 4330 of file locale_facets.h.

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

Definition at line 4331 of file locale_facets.h.

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

Numpunct facet id.

Definition at line 4335 of file locale_facets.h.


The documentation for this class was generated from the following file:
Generated on Tue Feb 2 16:59:03 2010 for GNU C++ STL by  doxygen 1.4.7