2 * Portions Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 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_INTERNAL_STRING_H
38 # include <stl/_string.h>
50 template <class _CharT> class messages {};
52 _STLP_MOVE_TO_PRIV_NAMESPACE
54 _STLP_MOVE_TO_STD_NAMESPACE
57 class _STLP_CLASS_DECLSPEC messages<char> : public locale::facet, public messages_base {
58 friend class _Locale_impl;
60 typedef messages_base::catalog catalog;
61 typedef char char_type;
62 typedef string string_type;
64 _STLP_DECLSPEC explicit messages(size_t __refs = 0);
66 catalog open(const string& __fn, const locale& __loc) const
67 { return do_open(__fn, __loc); }
68 string_type get(catalog __c, int __set, int __msgid,
69 const string_type& __dfault) const
70 { return do_get(__c, __set, __msgid, __dfault); }
71 inline void close(catalog __c) const
74 #if defined(__SYMBIAN32__WSD__)
75 static _STLP_STATIC_MEMBER_DECLSPEC locale::id& GetFacetLocaleId();
76 #elif defined (__SYMBIAN32__NO_STATIC_IMPORTS__)
77 static _STLP_STATIC_MEMBER_DECLSPEC locale::id& GetFacetLocaleId();
80 // NOTE: Symbian doesn't support exporting static data.
81 // Users of this class should use GetFacetLocaleId() to access the data member id
82 static _STLP_STATIC_MEMBER_DECLSPEC locale::id id;
86 _STLP_DECLSPEC messages(_STLP_PRIV _Messages*);
89 _STLP_DECLSPEC messages(size_t, _Locale_messages*);
90 _STLP_DECLSPEC ~messages();
93 _STLP_DECLSPEC virtual catalog do_open(const string& __fn, const locale& __loc) const;
94 _STLP_DECLSPEC virtual string_type do_get(catalog __c, int __set, int __msgid,
95 const string_type& __dfault) const;
96 _STLP_DECLSPEC virtual void do_close(catalog __c) const;
98 void _M_initialize(const char* __name);
101 _STLP_PRIV _Messages* _M_impl;
104 #if !defined (_STLP_NO_WCHAR_T)
107 class _STLP_CLASS_DECLSPEC messages<wchar_t> : public locale::facet, public messages_base {
108 friend class _Locale_impl;
110 typedef messages_base::catalog catalog;
111 typedef wchar_t char_type;
112 typedef wstring string_type;
114 explicit messages(size_t __refs = 0);
116 inline catalog open(const string& __fn, const locale& __loc) const
117 { return do_open(__fn, __loc); }
118 inline string_type get(catalog __c, int __set, int __msgid,
119 const string_type& __dfault) const
120 { return do_get(__c, __set, __msgid, __dfault); }
121 inline void close(catalog __c) const
124 #if defined(__SYMBIAN32__WSD__)
125 static _STLP_STATIC_MEMBER_DECLSPEC locale::id& GetFacetLocaleId();
126 #elif defined (__SYMBIAN32__NO_STATIC_IMPORTS__)
127 static _STLP_STATIC_MEMBER_DECLSPEC locale::id& GetFacetLocaleId();
128 static locale::id id;
130 // NOTE: Symbian doesn't support exporting static data.
131 // Users of this class should use GetFacetLocaleId() to access the data member id
132 static _STLP_STATIC_MEMBER_DECLSPEC locale::id id;
136 _STLP_DECLSPEC messages(_STLP_PRIV _Messages*);
139 _STLP_DECLSPEC messages(size_t, _Locale_messages*);
140 _STLP_DECLSPEC ~messages();
142 _STLP_DECLSPEC virtual catalog do_open(const string& __fn, const locale& __loc) const;
143 _STLP_DECLSPEC virtual string_type do_get(catalog __c, int __set, int __msgid,
144 const string_type& __dfault) const;
145 _STLP_DECLSPEC virtual void do_close(catalog __c) const;
147 void _M_initialize(const char* __name);
150 _STLP_PRIV _Messages* _M_impl;
155 template <class _CharT> class messages_byname {};
158 class _STLP_CLASS_DECLSPEC messages_byname<char> : public messages<char> {
160 typedef messages_base::catalog catalog;
161 typedef string string_type;
163 _STLP_DECLSPEC explicit messages_byname(const char* __name, size_t __refs = 0, _Locale_name_hint* __hint = 0);
169 typedef messages_byname<char> _Self;
170 //explicitely defined as private to avoid warnings:
171 messages_byname(_Self const&);
172 _Self& operator = (_Self const&);
175 #if !defined (_STLP_NO_WCHAR_T)
177 class _STLP_CLASS_DECLSPEC messages_byname<wchar_t> : public messages<wchar_t> {
179 typedef messages_base::catalog catalog;
180 typedef wstring string_type;
182 _STLP_DECLSPEC explicit messages_byname(const char* __name, size_t __refs = 0, _Locale_name_hint* __hint = 0);
188 typedef messages_byname<wchar_t> _Self;
189 //explicitely defined as private to avoid warnings:
190 messages_byname(_Self const&);
191 _Self& operator = (_Self const&);
197 #endif /* _STLP_INTERNAL_MESSAGES_H */