3 * Silicon Graphics Computer Systems, Inc.
8 * This material is provided "as is", with absolutely no warranty expressed
9 * or implied. Any use is at your own risk.
11 * Permission to use or copy this software for any purpose is hereby granted
12 * without fee, provided the above notices are retained on all copies.
13 * Permission to modify the code and to distribute modified code is granted,
14 * provided the above notices are retained, and a notice that the code was
15 * modified is included with the above copyright notice.
19 // WARNING: This is an internal header file, included by other C++
20 // standard library headers. You should not attempt to use this header
24 #ifndef _STLP_INTERNAL_MESSAGES_H
25 #define _STLP_INTERNAL_MESSAGES_H
27 #ifndef _STLP_IOS_BASE_H
28 # include <stl/_ios_base.h>
31 #ifndef _STLP_C_LOCALE_H
32 # include <stl/c_locale.h>
35 #ifndef _STLP_INTERNAL_STRING_H
36 # include <stl/_string.h>
48 template <class _CharT> class messages {};
50 _STLP_MOVE_TO_PRIV_NAMESPACE
52 _STLP_MOVE_TO_STD_NAMESPACE
55 class _STLP_CLASS_DECLSPEC messages<char> : public locale::facet, public messages_base {
56 friend class _Locale_impl;
58 typedef messages_base::catalog catalog;
59 typedef char char_type;
60 typedef string string_type;
62 explicit messages(size_t __refs = 0);
64 catalog open(const string& __fn, const locale& __loc) const
65 { return do_open(__fn, __loc); }
66 string_type get(catalog __c, int __set, int __msgid,
67 const string_type& __dfault) const
68 { return do_get(__c, __set, __msgid, __dfault); }
69 inline void close(catalog __c) const
72 static _STLP_STATIC_MEMBER_DECLSPEC locale::id id;
75 messages(_STLP_PRIV _Messages*);
78 messages(size_t, _Locale_messages*);
81 virtual catalog do_open(const string& __fn, const locale& __loc) const;
82 virtual string_type do_get(catalog __c, int __set, int __msgid,
83 const string_type& __dfault) const;
84 virtual void do_close(catalog __c) const;
86 void _M_initialize(const char* __name);
89 _STLP_PRIV _Messages* _M_impl;
92 #if !defined (_STLP_NO_WCHAR_T)
95 class _STLP_CLASS_DECLSPEC messages<wchar_t> : public locale::facet, public messages_base {
96 friend class _Locale_impl;
98 typedef messages_base::catalog catalog;
99 typedef wchar_t char_type;
100 typedef wstring string_type;
102 explicit messages(size_t __refs = 0);
104 inline catalog open(const string& __fn, const locale& __loc) const
105 { return do_open(__fn, __loc); }
106 inline string_type get(catalog __c, int __set, int __msgid,
107 const string_type& __dfault) const
108 { return do_get(__c, __set, __msgid, __dfault); }
109 inline void close(catalog __c) const
112 static _STLP_STATIC_MEMBER_DECLSPEC locale::id id;
115 messages(_STLP_PRIV _Messages*);
118 messages(size_t, _Locale_messages*);
121 virtual catalog do_open(const string& __fn, const locale& __loc) const;
122 virtual string_type do_get(catalog __c, int __set, int __msgid,
123 const string_type& __dfault) const;
124 virtual void do_close(catalog __c) const;
126 void _M_initialize(const char* __name);
129 _STLP_PRIV _Messages* _M_impl;
134 template <class _CharT> class messages_byname {};
137 class _STLP_CLASS_DECLSPEC messages_byname<char> : public messages<char> {
139 typedef messages_base::catalog catalog;
140 typedef string string_type;
142 explicit messages_byname(const char* __name, size_t __refs = 0, _Locale_name_hint* __hint = 0);
148 typedef messages_byname<char> _Self;
149 //explicitely defined as private to avoid warnings:
150 messages_byname(_Self const&);
151 _Self& operator = (_Self const&);
154 #if !defined (_STLP_NO_WCHAR_T)
156 class _STLP_CLASS_DECLSPEC messages_byname<wchar_t> : public messages<wchar_t> {
158 typedef messages_base::catalog catalog;
159 typedef wstring string_type;
161 explicit messages_byname(const char* __name, size_t __refs = 0, _Locale_name_hint* __hint = 0);
167 typedef messages_byname<wchar_t> _Self;
168 //explicitely defined as private to avoid warnings:
169 messages_byname(_Self const&);
170 _Self& operator = (_Self const&);
176 #endif /* _STLP_INTERNAL_MESSAGES_H */