2 * © Portions copyright (c) 2006-2007 Nokia Corporation. All rights reserved.
5 * Silicon Graphics Computer Systems, Inc.
10 * This material is provided "as is", with absolutely no warranty expressed
11 * or implied. Any use is at your own risk.
13 * Permission to use or copy this software for any purpose is hereby granted
14 * without fee, provided the above notices are retained on all copies.
15 * Permission to modify the code and to distribute modified code is granted,
16 * provided the above notices are retained, and a notice that the code was
17 * modified is included with the above copyright notice.
21 // WARNING: This is an internal header file, included by other C++
22 // standard library headers. You should not attempt to use this header
26 #ifndef _STLP_INTERNAL_MESSAGES_H
27 #define _STLP_INTERNAL_MESSAGES_H
29 #ifndef _STLP_IOS_BASE_H
30 # include <stl/_ios_base.h>
33 # ifndef _STLP_C_LOCALE_H
34 # include <stl/c_locale.h>
37 #ifndef _STLP_STRING_H
38 # include <stl/_string.h>
50 template <class _CharT> class messages {};
56 class messages<char> : public locale::facet, public messages_base
58 class _STLP_CLASS_DECLSPEC messages<char> : public locale::facet, public messages_base
63 typedef messages_base::catalog catalog;
64 typedef char char_type;
65 typedef string string_type;
67 _STLP_DECLSPEC explicit messages(size_t __refs = 0);
69 catalog open(const string& __fn, const locale& __loc) const
70 { return do_open(__fn, __loc); }
71 string_type get(catalog __c, int __set, int __msgid,
72 const string_type& __dfault) const
73 { return do_get(__c, __set, __msgid, __dfault); }
74 inline void close(catalog __c) const
77 #if defined(__LIBSTD_CPP_SYMBIAN32_WSD__) || defined(_STLP_LIBSTD_CPP_NO_STATIC_VAR_)
78 _STLP_STATIC_MEMBER_DECLSPEC static locale::id& GetFacetLocaleId();
80 _STLP_STATIC_MEMBER_DECLSPEC static locale::id id;
83 _STLP_DECLSPEC messages(_Messages*);
86 _STLP_DECLSPEC messages(size_t, _Locale_messages*);
87 _STLP_DECLSPEC ~messages();
89 _STLP_DECLSPEC virtual catalog do_open(const string& __fn, const locale& __loc) const;
90 _STLP_DECLSPEC virtual string_type do_get(catalog __c, int __set, int __msgid,
91 const string_type& __dfault) const;
92 _STLP_DECLSPEC virtual void do_close(catalog __c) const;
94 void _M_initialize(const char* __name);
100 # if !defined (_STLP_NO_WCHAR_T)
104 class messages<wchar_t> : public locale::facet, public messages_base
106 class _STLP_CLASS_DECLSPEC messages<wchar_t> : public locale::facet, public messages_base
109 friend class _Locale;
111 typedef messages_base::catalog catalog;
112 typedef wchar_t char_type;
113 typedef wstring string_type;
115 _STLP_DECLSPEC explicit messages(size_t __refs = 0);
117 inline catalog open(const string& __fn, const locale& __loc) const
118 { return do_open(__fn, __loc); }
119 inline string_type get(catalog __c, int __set, int __msgid,
120 const string_type& __dfault) const
121 { return do_get(__c, __set, __msgid, __dfault); }
122 inline void close(catalog __c) const
125 #if defined(__LIBSTD_CPP_SYMBIAN32_WSD__) || defined(_STLP_LIBSTD_CPP_NO_STATIC_VAR_)
126 _STLP_STATIC_MEMBER_DECLSPEC static locale::id& GetFacetLocaleId();
128 _STLP_STATIC_MEMBER_DECLSPEC static locale::id id;
131 _STLP_DECLSPEC messages(_Messages*);
135 _STLP_DECLSPEC messages(size_t, _Locale_messages*);
136 _STLP_DECLSPEC ~messages();
138 _STLP_DECLSPEC virtual catalog do_open(const string& __fn, const locale& __loc) const;
139 _STLP_DECLSPEC virtual string_type do_get(catalog __c, int __set, int __msgid,
140 const string_type& __dfault) const;
141 _STLP_DECLSPEC virtual void do_close(catalog __c) const;
143 void _M_initialize(const char* __name);
149 # endif /* WCHAR_T */
151 template <class _CharT> class messages_byname {};
154 class _STLP_CLASS_DECLSPEC messages_byname<char> : public messages<char> {
156 typedef messages_base::catalog catalog;
157 typedef string string_type;
159 _STLP_DECLSPEC explicit messages_byname(const char* __name, size_t __refs = 0);
162 _STLP_DECLSPEC ~messages_byname();
165 # ifndef _STLP_NO_WCHAR_T
167 class _STLP_CLASS_DECLSPEC messages_byname<wchar_t> : public messages<wchar_t> {
169 typedef messages_base::catalog catalog;
170 typedef wstring string_type;
172 _STLP_DECLSPEC explicit messages_byname(const char* __name, size_t __refs = 0);
175 _STLP_DECLSPEC ~messages_byname();
177 # endif /* WCHAR_T */
181 #endif /* _STLP_INTERNAL_MESSAGES_H */