williamr@2
|
1 |
/*
|
williamr@2
|
2 |
* © Portions copyright (c) 2006-2007 Nokia Corporation. All rights reserved.
|
williamr@2
|
3 |
*
|
williamr@2
|
4 |
* Copyright (c) 1999
|
williamr@2
|
5 |
* Silicon Graphics Computer Systems, Inc.
|
williamr@2
|
6 |
*
|
williamr@2
|
7 |
* Copyright (c) 1999
|
williamr@2
|
8 |
* Boris Fomitchev
|
williamr@2
|
9 |
*
|
williamr@2
|
10 |
* This material is provided "as is", with absolutely no warranty expressed
|
williamr@2
|
11 |
* or implied. Any use is at your own risk.
|
williamr@2
|
12 |
*
|
williamr@2
|
13 |
* Permission to use or copy this software for any purpose is hereby granted
|
williamr@2
|
14 |
* without fee, provided the above notices are retained on all copies.
|
williamr@2
|
15 |
* Permission to modify the code and to distribute modified code is granted,
|
williamr@2
|
16 |
* provided the above notices are retained, and a notice that the code was
|
williamr@2
|
17 |
* modified is included with the above copyright notice.
|
williamr@2
|
18 |
*
|
williamr@2
|
19 |
*/
|
williamr@2
|
20 |
|
williamr@2
|
21 |
// WARNING: This is an internal header file, included by other C++
|
williamr@2
|
22 |
// standard library headers. You should not attempt to use this header
|
williamr@2
|
23 |
// file directly.
|
williamr@2
|
24 |
|
williamr@2
|
25 |
|
williamr@2
|
26 |
#ifndef _STLP_INTERNAL_MESSAGES_H
|
williamr@2
|
27 |
#define _STLP_INTERNAL_MESSAGES_H
|
williamr@2
|
28 |
|
williamr@2
|
29 |
#ifndef _STLP_IOS_BASE_H
|
williamr@2
|
30 |
# include <stl/_ios_base.h>
|
williamr@2
|
31 |
#endif
|
williamr@2
|
32 |
|
williamr@2
|
33 |
# ifndef _STLP_C_LOCALE_H
|
williamr@2
|
34 |
# include <stl/c_locale.h>
|
williamr@2
|
35 |
# endif
|
williamr@2
|
36 |
|
williamr@2
|
37 |
#ifndef _STLP_STRING_H
|
williamr@2
|
38 |
# include <stl/_string.h>
|
williamr@2
|
39 |
#endif
|
williamr@2
|
40 |
|
williamr@2
|
41 |
_STLP_BEGIN_NAMESPACE
|
williamr@2
|
42 |
|
williamr@2
|
43 |
// messages facets
|
williamr@2
|
44 |
|
williamr@2
|
45 |
class messages_base {
|
williamr@2
|
46 |
public:
|
williamr@2
|
47 |
typedef int catalog;
|
williamr@2
|
48 |
};
|
williamr@2
|
49 |
|
williamr@2
|
50 |
template <class _CharT> class messages {};
|
williamr@2
|
51 |
|
williamr@2
|
52 |
class _Messages;
|
williamr@2
|
53 |
|
williamr@2
|
54 |
_STLP_TEMPLATE_NULL
|
williamr@2
|
55 |
#ifdef __SYMBIAN32__
|
williamr@2
|
56 |
class messages<char> : public locale::facet, public messages_base
|
williamr@2
|
57 |
#else
|
williamr@2
|
58 |
class _STLP_CLASS_DECLSPEC messages<char> : public locale::facet, public messages_base
|
williamr@2
|
59 |
#endif
|
williamr@2
|
60 |
{
|
williamr@2
|
61 |
friend class _Locale;
|
williamr@2
|
62 |
public:
|
williamr@2
|
63 |
typedef messages_base::catalog catalog;
|
williamr@2
|
64 |
typedef char char_type;
|
williamr@2
|
65 |
typedef string string_type;
|
williamr@2
|
66 |
|
williamr@2
|
67 |
_STLP_DECLSPEC explicit messages(size_t __refs = 0);
|
williamr@2
|
68 |
|
williamr@2
|
69 |
catalog open(const string& __fn, const locale& __loc) const
|
williamr@2
|
70 |
{ return do_open(__fn, __loc); }
|
williamr@2
|
71 |
string_type get(catalog __c, int __set, int __msgid,
|
williamr@2
|
72 |
const string_type& __dfault) const
|
williamr@2
|
73 |
{ return do_get(__c, __set, __msgid, __dfault); }
|
williamr@2
|
74 |
inline void close(catalog __c) const
|
williamr@2
|
75 |
{ do_close(__c); }
|
williamr@2
|
76 |
|
williamr@2
|
77 |
#if defined(__LIBSTD_CPP_SYMBIAN32_WSD__) || defined(_STLP_LIBSTD_CPP_NO_STATIC_VAR_)
|
williamr@2
|
78 |
_STLP_STATIC_MEMBER_DECLSPEC static locale::id& GetFacetLocaleId();
|
williamr@2
|
79 |
#else
|
williamr@2
|
80 |
_STLP_STATIC_MEMBER_DECLSPEC static locale::id id;
|
williamr@2
|
81 |
#endif
|
williamr@2
|
82 |
|
williamr@2
|
83 |
_STLP_DECLSPEC messages(_Messages*);
|
williamr@2
|
84 |
|
williamr@2
|
85 |
protected:
|
williamr@2
|
86 |
_STLP_DECLSPEC messages(size_t, _Locale_messages*);
|
williamr@2
|
87 |
_STLP_DECLSPEC ~messages();
|
williamr@2
|
88 |
|
williamr@2
|
89 |
_STLP_DECLSPEC virtual catalog do_open(const string& __fn, const locale& __loc) const;
|
williamr@2
|
90 |
_STLP_DECLSPEC virtual string_type do_get(catalog __c, int __set, int __msgid,
|
williamr@2
|
91 |
const string_type& __dfault) const;
|
williamr@2
|
92 |
_STLP_DECLSPEC virtual void do_close(catalog __c) const;
|
williamr@2
|
93 |
|
williamr@2
|
94 |
void _M_initialize(const char* __name);
|
williamr@2
|
95 |
|
williamr@2
|
96 |
private:
|
williamr@2
|
97 |
_Messages* _M_impl;
|
williamr@2
|
98 |
};
|
williamr@2
|
99 |
|
williamr@2
|
100 |
# if !defined (_STLP_NO_WCHAR_T)
|
williamr@2
|
101 |
|
williamr@2
|
102 |
_STLP_TEMPLATE_NULL
|
williamr@2
|
103 |
#ifdef __SYMBIAN32__
|
williamr@2
|
104 |
class messages<wchar_t> : public locale::facet, public messages_base
|
williamr@2
|
105 |
#else
|
williamr@2
|
106 |
class _STLP_CLASS_DECLSPEC messages<wchar_t> : public locale::facet, public messages_base
|
williamr@2
|
107 |
#endif
|
williamr@2
|
108 |
{
|
williamr@2
|
109 |
friend class _Locale;
|
williamr@2
|
110 |
public:
|
williamr@2
|
111 |
typedef messages_base::catalog catalog;
|
williamr@2
|
112 |
typedef wchar_t char_type;
|
williamr@2
|
113 |
typedef wstring string_type;
|
williamr@2
|
114 |
|
williamr@2
|
115 |
_STLP_DECLSPEC explicit messages(size_t __refs = 0);
|
williamr@2
|
116 |
|
williamr@2
|
117 |
inline catalog open(const string& __fn, const locale& __loc) const
|
williamr@2
|
118 |
{ return do_open(__fn, __loc); }
|
williamr@2
|
119 |
inline string_type get(catalog __c, int __set, int __msgid,
|
williamr@2
|
120 |
const string_type& __dfault) const
|
williamr@2
|
121 |
{ return do_get(__c, __set, __msgid, __dfault); }
|
williamr@2
|
122 |
inline void close(catalog __c) const
|
williamr@2
|
123 |
{ do_close(__c); }
|
williamr@2
|
124 |
|
williamr@2
|
125 |
#if defined(__LIBSTD_CPP_SYMBIAN32_WSD__) || defined(_STLP_LIBSTD_CPP_NO_STATIC_VAR_)
|
williamr@2
|
126 |
_STLP_STATIC_MEMBER_DECLSPEC static locale::id& GetFacetLocaleId();
|
williamr@2
|
127 |
#else
|
williamr@2
|
128 |
_STLP_STATIC_MEMBER_DECLSPEC static locale::id id;
|
williamr@2
|
129 |
#endif
|
williamr@2
|
130 |
|
williamr@2
|
131 |
_STLP_DECLSPEC messages(_Messages*);
|
williamr@2
|
132 |
|
williamr@2
|
133 |
protected:
|
williamr@2
|
134 |
|
williamr@2
|
135 |
_STLP_DECLSPEC messages(size_t, _Locale_messages*);
|
williamr@2
|
136 |
_STLP_DECLSPEC ~messages();
|
williamr@2
|
137 |
|
williamr@2
|
138 |
_STLP_DECLSPEC virtual catalog do_open(const string& __fn, const locale& __loc) const;
|
williamr@2
|
139 |
_STLP_DECLSPEC virtual string_type do_get(catalog __c, int __set, int __msgid,
|
williamr@2
|
140 |
const string_type& __dfault) const;
|
williamr@2
|
141 |
_STLP_DECLSPEC virtual void do_close(catalog __c) const;
|
williamr@2
|
142 |
|
williamr@2
|
143 |
void _M_initialize(const char* __name);
|
williamr@2
|
144 |
|
williamr@2
|
145 |
private:
|
williamr@2
|
146 |
_Messages* _M_impl;
|
williamr@2
|
147 |
};
|
williamr@2
|
148 |
|
williamr@2
|
149 |
# endif /* WCHAR_T */
|
williamr@2
|
150 |
|
williamr@2
|
151 |
template <class _CharT> class messages_byname {};
|
williamr@2
|
152 |
|
williamr@2
|
153 |
_STLP_TEMPLATE_NULL
|
williamr@2
|
154 |
class _STLP_CLASS_DECLSPEC messages_byname<char> : public messages<char> {
|
williamr@2
|
155 |
public:
|
williamr@2
|
156 |
typedef messages_base::catalog catalog;
|
williamr@2
|
157 |
typedef string string_type;
|
williamr@2
|
158 |
|
williamr@2
|
159 |
_STLP_DECLSPEC explicit messages_byname(const char* __name, size_t __refs = 0);
|
williamr@2
|
160 |
|
williamr@2
|
161 |
protected:
|
williamr@2
|
162 |
_STLP_DECLSPEC ~messages_byname();
|
williamr@2
|
163 |
};
|
williamr@2
|
164 |
|
williamr@2
|
165 |
# ifndef _STLP_NO_WCHAR_T
|
williamr@2
|
166 |
_STLP_TEMPLATE_NULL
|
williamr@2
|
167 |
class _STLP_CLASS_DECLSPEC messages_byname<wchar_t> : public messages<wchar_t> {
|
williamr@2
|
168 |
public:
|
williamr@2
|
169 |
typedef messages_base::catalog catalog;
|
williamr@2
|
170 |
typedef wstring string_type;
|
williamr@2
|
171 |
|
williamr@2
|
172 |
_STLP_DECLSPEC explicit messages_byname(const char* __name, size_t __refs = 0);
|
williamr@2
|
173 |
|
williamr@2
|
174 |
protected:
|
williamr@2
|
175 |
_STLP_DECLSPEC ~messages_byname();
|
williamr@2
|
176 |
};
|
williamr@2
|
177 |
# endif /* WCHAR_T */
|
williamr@2
|
178 |
|
williamr@2
|
179 |
_STLP_END_NAMESPACE
|
williamr@2
|
180 |
|
williamr@2
|
181 |
#endif /* _STLP_INTERNAL_MESSAGES_H */
|
williamr@2
|
182 |
|
williamr@2
|
183 |
// Local Variables:
|
williamr@2
|
184 |
// mode:C++
|
williamr@2
|
185 |
// End:
|
williamr@2
|
186 |
|