williamr@2
|
1 |
/*
|
williamr@4
|
2 |
* Portions Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). All rights reserved.
|
williamr@2
|
3 |
*
|
williamr@2
|
4 |
* Copyright (c) 1999
|
williamr@2
|
5 |
* Silicon Graphics Computer Systems, Inc.
|
williamr@2
|
6 |
*
|
williamr@4
|
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@4
|
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@4
|
19 |
*/
|
williamr@2
|
20 |
// WARNING: This is an internal header file, included by other C++
|
williamr@2
|
21 |
// standard library headers. You should not attempt to use this header
|
williamr@2
|
22 |
// file directly.
|
williamr@2
|
23 |
|
williamr@2
|
24 |
|
williamr@2
|
25 |
#ifndef _STLP_INTERNAL_CODECVT_H
|
williamr@2
|
26 |
#define _STLP_INTERNAL_CODECVT_H
|
williamr@2
|
27 |
|
williamr@4
|
28 |
#ifndef _STLP_C_LOCALE_H
|
williamr@2
|
29 |
# include <stl/c_locale.h>
|
williamr@4
|
30 |
#endif
|
williamr@4
|
31 |
|
williamr@4
|
32 |
#ifndef _STLP_INTERNAL_LOCALE_H
|
williamr@2
|
33 |
# include <stl/_locale.h>
|
williamr@4
|
34 |
#endif
|
williamr@4
|
35 |
|
williamr@4
|
36 |
#ifndef _STLP_INTERNAL_ALGOBASE_H
|
williamr@4
|
37 |
# include <stl/_algobase.h>
|
williamr@4
|
38 |
#endif
|
williamr@2
|
39 |
|
williamr@2
|
40 |
_STLP_BEGIN_NAMESPACE
|
williamr@2
|
41 |
|
williamr@2
|
42 |
class _STLP_CLASS_DECLSPEC codecvt_base {
|
williamr@2
|
43 |
public:
|
williamr@2
|
44 |
enum result {ok, partial, error, noconv};
|
williamr@2
|
45 |
};
|
williamr@2
|
46 |
|
williamr@2
|
47 |
template <class _InternT, class _ExternT, class _StateT>
|
williamr@2
|
48 |
class codecvt : public locale::facet, public codecvt_base {
|
williamr@4
|
49 |
public:
|
williamr@2
|
50 |
typedef _InternT intern_type;
|
williamr@2
|
51 |
typedef _ExternT extern_type;
|
williamr@2
|
52 |
typedef _StateT state_type;
|
williamr@4
|
53 |
|
williamr@4
|
54 |
#if defined (_STLP_MSVC) && (_STLP_MSVC < 1300)
|
williamr@4
|
55 |
/* For the moment VC6 do not support this facet default implementation
|
williamr@4
|
56 |
* because of the static locale::id instance. When VC6 see this definition
|
williamr@4
|
57 |
* it goes crasy with locale::id static instances and all the has_facet tests
|
williamr@4
|
58 |
* unit tests are failing.
|
williamr@4
|
59 |
*/
|
williamr@2
|
60 |
};
|
williamr@4
|
61 |
#else
|
williamr@4
|
62 |
explicit codecvt(size_t __refs = 0) : locale::facet(__refs) {}
|
williamr@4
|
63 |
|
williamr@4
|
64 |
result out(state_type& __state,
|
williamr@4
|
65 |
const intern_type* __from,
|
williamr@4
|
66 |
const intern_type* __from_end,
|
williamr@4
|
67 |
const intern_type*& __from_next,
|
williamr@4
|
68 |
extern_type* __to,
|
williamr@4
|
69 |
extern_type* __to_limit,
|
williamr@4
|
70 |
extern_type*& __to_next) const {
|
williamr@4
|
71 |
return do_out(__state,
|
williamr@4
|
72 |
__from, __from_end, __from_next,
|
williamr@4
|
73 |
__to, __to_limit, __to_next);
|
williamr@4
|
74 |
}
|
williamr@4
|
75 |
|
williamr@4
|
76 |
result unshift(state_type& __state,
|
williamr@4
|
77 |
extern_type* __to,
|
williamr@4
|
78 |
extern_type* __to_limit,
|
williamr@4
|
79 |
extern_type*& __to_next) const {
|
williamr@4
|
80 |
return do_unshift(__state, __to, __to_limit, __to_next);
|
williamr@4
|
81 |
}
|
williamr@4
|
82 |
|
williamr@4
|
83 |
result in(state_type& __state,
|
williamr@4
|
84 |
const extern_type* __from,
|
williamr@4
|
85 |
const extern_type* __from_end,
|
williamr@4
|
86 |
const extern_type*& __from_next,
|
williamr@4
|
87 |
intern_type* __to,
|
williamr@4
|
88 |
intern_type* __to_limit,
|
williamr@4
|
89 |
intern_type*& __to_next) const {
|
williamr@4
|
90 |
return do_in(__state,
|
williamr@4
|
91 |
__from, __from_end, __from_next,
|
williamr@4
|
92 |
__to, __to_limit, __to_next);
|
williamr@4
|
93 |
}
|
williamr@4
|
94 |
|
williamr@4
|
95 |
int encoding() const _STLP_NOTHROW { return do_encoding(); }
|
williamr@4
|
96 |
|
williamr@4
|
97 |
bool always_noconv() const _STLP_NOTHROW { return do_always_noconv(); }
|
williamr@4
|
98 |
|
williamr@4
|
99 |
int length(const state_type& __state,
|
williamr@4
|
100 |
const extern_type* __from,
|
williamr@4
|
101 |
const extern_type* __end,
|
williamr@4
|
102 |
size_t __max) const {
|
williamr@4
|
103 |
return do_length(__state, __from, __end, __max);
|
williamr@4
|
104 |
}
|
williamr@4
|
105 |
|
williamr@4
|
106 |
int max_length() const _STLP_NOTHROW { return do_max_length(); }
|
williamr@4
|
107 |
|
williamr@4
|
108 |
#if defined(__SYMBIAN32__WSD__)
|
williamr@4
|
109 |
static _STLP_STATIC_MEMBER_DECLSPEC locale::id& GetFacetLocaleId();
|
williamr@4
|
110 |
#elif defined (__SYMBIAN32__NO_STATIC_IMPORTS__)
|
williamr@4
|
111 |
static _STLP_STATIC_MEMBER_DECLSPEC locale::id& GetFacetLocaleId();
|
williamr@4
|
112 |
static locale::id id;
|
williamr@4
|
113 |
#else
|
williamr@4
|
114 |
// NOTE: Symbian doesn't support exporting static data.
|
williamr@4
|
115 |
// Users of this class should use GetFacetLocaleId() to access the data member id
|
williamr@4
|
116 |
static _STLP_STATIC_MEMBER_DECLSPEC locale::id id;
|
williamr@4
|
117 |
#endif
|
williamr@4
|
118 |
|
williamr@4
|
119 |
|
williamr@4
|
120 |
protected:
|
williamr@4
|
121 |
~codecvt() {}
|
williamr@4
|
122 |
|
williamr@4
|
123 |
virtual result do_out(state_type&,
|
williamr@4
|
124 |
const intern_type* __from,
|
williamr@4
|
125 |
const intern_type*,
|
williamr@4
|
126 |
const intern_type*& __from_next,
|
williamr@4
|
127 |
extern_type* __to,
|
williamr@4
|
128 |
extern_type*,
|
williamr@4
|
129 |
extern_type*& __to_next) const
|
williamr@4
|
130 |
{ __from_next = __from; __to_next = __to; return noconv; }
|
williamr@4
|
131 |
|
williamr@4
|
132 |
virtual result do_in (state_type&,
|
williamr@4
|
133 |
const extern_type* __from,
|
williamr@4
|
134 |
const extern_type*,
|
williamr@4
|
135 |
const extern_type*& __from_next,
|
williamr@4
|
136 |
intern_type* __to,
|
williamr@4
|
137 |
intern_type*,
|
williamr@4
|
138 |
intern_type*& __to_next) const
|
williamr@4
|
139 |
{ __from_next = __from; __to_next = __to; return noconv; }
|
williamr@4
|
140 |
|
williamr@4
|
141 |
virtual result do_unshift(state_type&,
|
williamr@4
|
142 |
extern_type* __to,
|
williamr@4
|
143 |
extern_type*,
|
williamr@4
|
144 |
extern_type*& __to_next) const
|
williamr@4
|
145 |
{ __to_next = __to; return noconv; }
|
williamr@4
|
146 |
|
williamr@4
|
147 |
virtual int do_encoding() const _STLP_NOTHROW
|
williamr@4
|
148 |
{ return 1; }
|
williamr@4
|
149 |
|
williamr@4
|
150 |
virtual bool do_always_noconv() const _STLP_NOTHROW
|
williamr@4
|
151 |
{ return true; }
|
williamr@4
|
152 |
|
williamr@4
|
153 |
virtual int do_length(const state_type&,
|
williamr@4
|
154 |
const extern_type* __from,
|
williamr@4
|
155 |
const extern_type* __end,
|
williamr@4
|
156 |
size_t __max) const
|
williamr@4
|
157 |
{ return (int)(min) ( __STATIC_CAST(size_t, (__end - __from)), __max); }
|
williamr@4
|
158 |
|
williamr@4
|
159 |
virtual int do_max_length() const _STLP_NOTHROW
|
williamr@4
|
160 |
{ return 1; }
|
williamr@4
|
161 |
|
williamr@4
|
162 |
private:
|
williamr@4
|
163 |
codecvt(const codecvt<intern_type, extern_type, state_type>&);
|
williamr@4
|
164 |
codecvt<intern_type, extern_type, state_type>& operator = (const codecvt<intern_type, extern_type, state_type>&);
|
williamr@4
|
165 |
};
|
williamr@4
|
166 |
|
williamr@4
|
167 |
# if defined (_STLP_EXPOSE_STREAM_IMPLEMENTATION) && !defined (_STLP_LINK_TIME_INSTANTIATION)
|
williamr@4
|
168 |
# if (_STLP_STATIC_TEMPLATE_DATA > 0)
|
williamr@4
|
169 |
# if !defined (__BORLANDC__) && !defined(__SYMBIAN32__WSD__)
|
williamr@4
|
170 |
template <class _InternT, class _ExternT, class _StateT>
|
williamr@4
|
171 |
locale::id codecvt<_InternT, _ExternT, _StateT>::id;
|
williamr@4
|
172 |
# endif
|
williamr@4
|
173 |
# endif
|
williamr@4
|
174 |
# endif
|
williamr@4
|
175 |
#endif
|
williamr@4
|
176 |
|
williamr@2
|
177 |
template <class _InternT, class _ExternT, class _StateT>
|
williamr@2
|
178 |
class codecvt_byname : public codecvt<_InternT, _ExternT, _StateT> {};
|
williamr@2
|
179 |
|
williamr@2
|
180 |
_STLP_TEMPLATE_NULL
|
williamr@4
|
181 |
class _STLP_CLASS_DECLSPEC codecvt<char, char, mbstate_t>
|
williamr@4
|
182 |
: public locale::facet, public codecvt_base
|
williamr@2
|
183 |
{
|
williamr@4
|
184 |
friend class _Locale_impl;
|
williamr@4
|
185 |
|
williamr@2
|
186 |
public:
|
williamr@2
|
187 |
typedef char intern_type;
|
williamr@2
|
188 |
typedef char extern_type;
|
williamr@2
|
189 |
typedef mbstate_t state_type;
|
williamr@2
|
190 |
|
williamr@4
|
191 |
explicit codecvt(size_t __refs = 0) : locale::facet(__refs) {}
|
williamr@2
|
192 |
|
williamr@4
|
193 |
result out(mbstate_t& __state,
|
williamr@2
|
194 |
const char* __from,
|
williamr@2
|
195 |
const char* __from_end,
|
williamr@2
|
196 |
const char*& __from_next,
|
williamr@2
|
197 |
char* __to,
|
williamr@4
|
198 |
char* __to_limit,
|
williamr@2
|
199 |
char*& __to_next) const {
|
williamr@4
|
200 |
return do_out(__state,
|
williamr@2
|
201 |
__from, __from_end, __from_next,
|
williamr@2
|
202 |
__to, __to_limit, __to_next);
|
williamr@2
|
203 |
}
|
williamr@2
|
204 |
|
williamr@2
|
205 |
result unshift(mbstate_t& __state,
|
williamr@2
|
206 |
char* __to, char* __to_limit, char*& __to_next) const
|
williamr@2
|
207 |
{ return do_unshift(__state, __to, __to_limit, __to_next); }
|
williamr@4
|
208 |
|
williamr@2
|
209 |
result in(state_type& __state,
|
williamr@2
|
210 |
const char* __from,
|
williamr@4
|
211 |
const char* __from_end,
|
williamr@2
|
212 |
const char*& __from_next,
|
williamr@4
|
213 |
char* __to,
|
williamr@4
|
214 |
char* __to_limit,
|
williamr@2
|
215 |
char*& __to_next) const {
|
williamr@2
|
216 |
return do_in(__state,
|
williamr@2
|
217 |
__from, __from_end, __from_next,
|
williamr@2
|
218 |
__to, __to_limit, __to_next);
|
williamr@2
|
219 |
}
|
williamr@2
|
220 |
|
williamr@2
|
221 |
int encoding() const _STLP_NOTHROW { return do_encoding(); }
|
williamr@2
|
222 |
|
williamr@2
|
223 |
bool always_noconv() const _STLP_NOTHROW { return do_always_noconv(); }
|
williamr@2
|
224 |
|
williamr@2
|
225 |
int length(const state_type& __state,
|
williamr@2
|
226 |
const char* __from, const char* __end,
|
williamr@2
|
227 |
size_t __max) const
|
williamr@2
|
228 |
{ return do_length(__state, __from, __end, __max); }
|
williamr@4
|
229 |
|
williamr@2
|
230 |
int max_length() const _STLP_NOTHROW { return do_max_length(); }
|
williamr@4
|
231 |
#if defined(__SYMBIAN32__WSD__)
|
williamr@4
|
232 |
static _STLP_STATIC_MEMBER_DECLSPEC locale::id& GetFacetLocaleId();
|
williamr@4
|
233 |
#elif defined (__SYMBIAN32__NO_STATIC_IMPORTS__)
|
williamr@4
|
234 |
static _STLP_STATIC_MEMBER_DECLSPEC locale::id& GetFacetLocaleId();
|
williamr@4
|
235 |
static locale::id id;
|
williamr@2
|
236 |
#else
|
williamr@4
|
237 |
// NOTE: Symbian doesn't support exporting static data.
|
williamr@4
|
238 |
// Users of this class should use GetFacetLocaleId() to access the data member id
|
williamr@4
|
239 |
static _STLP_STATIC_MEMBER_DECLSPEC locale::id id;
|
williamr@2
|
240 |
#endif
|
williamr@2
|
241 |
protected:
|
williamr@4
|
242 |
_STLP_DECLSPEC ~codecvt();
|
williamr@2
|
243 |
|
williamr@2
|
244 |
_STLP_DECLSPEC virtual result do_out(mbstate_t& /* __state */,
|
williamr@2
|
245 |
const char* __from,
|
williamr@2
|
246 |
const char* /* __from_end */,
|
williamr@2
|
247 |
const char*& __from_next,
|
williamr@2
|
248 |
char* __to,
|
williamr@2
|
249 |
char* /* __to_limit */,
|
williamr@2
|
250 |
char*& __to_next) const;
|
williamr@2
|
251 |
|
williamr@4
|
252 |
_STLP_DECLSPEC virtual result do_in (mbstate_t& /* __state */ ,
|
williamr@2
|
253 |
const char* __from,
|
williamr@2
|
254 |
const char* /* __from_end */,
|
williamr@2
|
255 |
const char*& __from_next,
|
williamr@2
|
256 |
char* __to,
|
williamr@2
|
257 |
char* /* __to_end */,
|
williamr@2
|
258 |
char*& __to_next) const;
|
williamr@2
|
259 |
|
williamr@4
|
260 |
_STLP_DECLSPEC virtual result do_unshift(mbstate_t& /* __state */,
|
williamr@2
|
261 |
char* __to,
|
williamr@2
|
262 |
char* /* __to_limit */,
|
williamr@2
|
263 |
char*& __to_next) const;
|
williamr@2
|
264 |
|
williamr@4
|
265 |
_STLP_DECLSPEC virtual int do_encoding() const _STLP_NOTHROW;
|
williamr@4
|
266 |
_STLP_DECLSPEC virtual bool do_always_noconv() const _STLP_NOTHROW;
|
williamr@4
|
267 |
_STLP_DECLSPEC virtual int do_length(const mbstate_t& __state,
|
williamr@4
|
268 |
const char* __from,
|
williamr@2
|
269 |
const char* __end,
|
williamr@2
|
270 |
size_t __max) const;
|
williamr@4
|
271 |
_STLP_DECLSPEC virtual int do_max_length() const _STLP_NOTHROW;
|
williamr@2
|
272 |
private:
|
williamr@2
|
273 |
codecvt(const codecvt<char, char, mbstate_t>&);
|
williamr@4
|
274 |
codecvt<char, char, mbstate_t>& operator =(const codecvt<char, char, mbstate_t>&);
|
williamr@2
|
275 |
};
|
williamr@2
|
276 |
|
williamr@2
|
277 |
# ifndef _STLP_NO_WCHAR_T
|
williamr@4
|
278 |
|
williamr@2
|
279 |
_STLP_TEMPLATE_NULL
|
williamr@4
|
280 |
class _STLP_CLASS_DECLSPEC codecvt<wchar_t, char, mbstate_t>
|
williamr@4
|
281 |
: public locale::facet, public codecvt_base
|
williamr@2
|
282 |
{
|
williamr@4
|
283 |
friend class _Locale_impl;
|
williamr@2
|
284 |
public:
|
williamr@2
|
285 |
typedef wchar_t intern_type;
|
williamr@2
|
286 |
typedef char extern_type;
|
williamr@2
|
287 |
typedef mbstate_t state_type;
|
williamr@2
|
288 |
|
williamr@4
|
289 |
explicit codecvt(size_t __refs = 0) : locale::facet(__refs) {}
|
williamr@2
|
290 |
|
williamr@4
|
291 |
result out(mbstate_t& __state,
|
williamr@2
|
292 |
const wchar_t* __from,
|
williamr@2
|
293 |
const wchar_t* __from_end,
|
williamr@2
|
294 |
const wchar_t*& __from_next,
|
williamr@2
|
295 |
char* __to,
|
williamr@2
|
296 |
char* __to_limit,
|
williamr@2
|
297 |
char*& __to_next) const {
|
williamr@2
|
298 |
return do_out(__state,
|
williamr@4
|
299 |
__from, __from_end, __from_next,
|
williamr@2
|
300 |
__to, __to_limit, __to_next);
|
williamr@2
|
301 |
}
|
williamr@2
|
302 |
|
williamr@2
|
303 |
result unshift(mbstate_t& __state,
|
williamr@2
|
304 |
char* __to, char* __to_limit, char*& __to_next) const {
|
williamr@2
|
305 |
return do_unshift(__state, __to, __to_limit, __to_next);
|
williamr@2
|
306 |
}
|
williamr@4
|
307 |
|
williamr@4
|
308 |
result in(mbstate_t& __state,
|
williamr@2
|
309 |
const char* __from,
|
williamr@4
|
310 |
const char* __from_end,
|
williamr@2
|
311 |
const char*& __from_next,
|
williamr@4
|
312 |
wchar_t* __to,
|
williamr@4
|
313 |
wchar_t* __to_limit,
|
williamr@2
|
314 |
wchar_t*& __to_next) const {
|
williamr@4
|
315 |
return do_in(__state,
|
williamr@2
|
316 |
__from, __from_end, __from_next,
|
williamr@4
|
317 |
__to, __to_limit, __to_next);
|
williamr@2
|
318 |
}
|
williamr@2
|
319 |
|
williamr@2
|
320 |
int encoding() const _STLP_NOTHROW { return do_encoding(); }
|
williamr@2
|
321 |
|
williamr@2
|
322 |
bool always_noconv() const _STLP_NOTHROW { return do_always_noconv(); }
|
williamr@2
|
323 |
|
williamr@4
|
324 |
int length(const mbstate_t& __state,
|
williamr@4
|
325 |
const char* __from, const char* __end,
|
williamr@4
|
326 |
size_t __max) const
|
williamr@2
|
327 |
{ return do_length(__state, __from, __end, __max); }
|
williamr@4
|
328 |
|
williamr@2
|
329 |
int max_length() const _STLP_NOTHROW { return do_max_length(); }
|
williamr@4
|
330 |
#if defined(__SYMBIAN32__WSD__)
|
williamr@4
|
331 |
static _STLP_STATIC_MEMBER_DECLSPEC locale::id& GetFacetLocaleId();
|
williamr@4
|
332 |
#elif defined (__SYMBIAN32__NO_STATIC_IMPORTS__)
|
williamr@4
|
333 |
static _STLP_STATIC_MEMBER_DECLSPEC locale::id& GetFacetLocaleId();
|
williamr@4
|
334 |
static locale::id id;
|
williamr@4
|
335 |
#else
|
williamr@4
|
336 |
// NOTE: Symbian doesn't support exporting static data.
|
williamr@4
|
337 |
// Users of this class should use GetFacetLocaleId() to access the data member id
|
williamr@4
|
338 |
static _STLP_STATIC_MEMBER_DECLSPEC locale::id id;
|
williamr@4
|
339 |
#endif
|
williamr@4
|
340 |
protected:
|
williamr@4
|
341 |
_STLP_DECLSPEC ~codecvt();
|
williamr@2
|
342 |
|
williamr@4
|
343 |
_STLP_DECLSPEC virtual result do_out(mbstate_t& __state,
|
williamr@2
|
344 |
const wchar_t* __from,
|
williamr@2
|
345 |
const wchar_t* __from_end,
|
williamr@2
|
346 |
const wchar_t*& __from_next,
|
williamr@2
|
347 |
char* __to,
|
williamr@2
|
348 |
char* __to_limit,
|
williamr@2
|
349 |
char*& __to_next) const;
|
williamr@2
|
350 |
|
williamr@4
|
351 |
_STLP_DECLSPEC virtual result do_in (mbstate_t& __state,
|
williamr@2
|
352 |
const char* __from,
|
williamr@2
|
353 |
const char* __from_end,
|
williamr@2
|
354 |
const char*& __from_next,
|
williamr@2
|
355 |
wchar_t* __to,
|
williamr@2
|
356 |
wchar_t* __to_limit,
|
williamr@2
|
357 |
wchar_t*& __to_next) const;
|
williamr@2
|
358 |
|
williamr@4
|
359 |
_STLP_DECLSPEC virtual result do_unshift(mbstate_t& __state,
|
williamr@4
|
360 |
char* __to,
|
williamr@2
|
361 |
char* __to_limit,
|
williamr@2
|
362 |
char*& __to_next) const;
|
williamr@2
|
363 |
|
williamr@4
|
364 |
_STLP_DECLSPEC virtual int do_encoding() const _STLP_NOTHROW;
|
williamr@2
|
365 |
|
williamr@4
|
366 |
_STLP_DECLSPEC virtual bool do_always_noconv() const _STLP_NOTHROW;
|
williamr@4
|
367 |
|
williamr@4
|
368 |
_STLP_DECLSPEC virtual int do_length(const mbstate_t& __state,
|
williamr@4
|
369 |
const char* __from,
|
williamr@2
|
370 |
const char* __end,
|
williamr@2
|
371 |
size_t __max) const;
|
williamr@2
|
372 |
|
williamr@4
|
373 |
_STLP_DECLSPEC virtual int do_max_length() const _STLP_NOTHROW;
|
williamr@2
|
374 |
|
williamr@2
|
375 |
private:
|
williamr@2
|
376 |
codecvt(const codecvt<wchar_t, char, mbstate_t>&);
|
williamr@4
|
377 |
codecvt<wchar_t, char, mbstate_t>& operator = (const codecvt<wchar_t, char, mbstate_t>&);
|
williamr@2
|
378 |
};
|
williamr@2
|
379 |
|
williamr@2
|
380 |
# endif
|
williamr@2
|
381 |
|
williamr@2
|
382 |
_STLP_TEMPLATE_NULL
|
williamr@2
|
383 |
class _STLP_CLASS_DECLSPEC codecvt_byname<char, char, mbstate_t>
|
williamr@2
|
384 |
: public codecvt<char, char, mbstate_t> {
|
williamr@2
|
385 |
public:
|
williamr@4
|
386 |
_STLP_DECLSPEC explicit codecvt_byname(const char* __name, size_t __refs = 0);
|
williamr@4
|
387 |
_STLP_DECLSPEC ~codecvt_byname();
|
williamr@2
|
388 |
private:
|
williamr@2
|
389 |
codecvt_byname(const codecvt_byname<char, char, mbstate_t>&);
|
williamr@4
|
390 |
codecvt_byname<char, char, mbstate_t>& operator =(const codecvt_byname<char, char, mbstate_t>&);
|
williamr@2
|
391 |
};
|
williamr@2
|
392 |
|
williamr@2
|
393 |
# ifndef _STLP_NO_WCHAR_T
|
williamr@2
|
394 |
_STLP_TEMPLATE_NULL
|
williamr@4
|
395 |
class _STLP_CLASS_DECLSPEC codecvt_byname<wchar_t, char, mbstate_t>
|
williamr@4
|
396 |
: public codecvt<wchar_t, char, mbstate_t>
|
williamr@2
|
397 |
{
|
williamr@2
|
398 |
public:
|
williamr@4
|
399 |
_STLP_DECLSPEC explicit codecvt_byname(const char * __name, size_t __refs = 0, _Locale_name_hint* __hint = 0);
|
williamr@2
|
400 |
|
williamr@2
|
401 |
protected:
|
williamr@4
|
402 |
_STLP_DECLSPEC ~codecvt_byname();
|
williamr@2
|
403 |
|
williamr@4
|
404 |
_STLP_DECLSPEC virtual result do_out(mbstate_t& __state,
|
williamr@2
|
405 |
const wchar_t* __from,
|
williamr@2
|
406 |
const wchar_t* __from_end,
|
williamr@2
|
407 |
const wchar_t*& __from_next,
|
williamr@2
|
408 |
char* __to,
|
williamr@2
|
409 |
char* __to_limit,
|
williamr@2
|
410 |
char*& __to_next) const;
|
williamr@2
|
411 |
|
williamr@4
|
412 |
_STLP_DECLSPEC virtual result do_in (mbstate_t& __state,
|
williamr@2
|
413 |
const char* __from,
|
williamr@2
|
414 |
const char* __from_end,
|
williamr@2
|
415 |
const char*& __from_next,
|
williamr@2
|
416 |
wchar_t* __to,
|
williamr@2
|
417 |
wchar_t* __to_limit,
|
williamr@2
|
418 |
wchar_t*& __to_next) const;
|
williamr@2
|
419 |
|
williamr@4
|
420 |
_STLP_DECLSPEC virtual result do_unshift(mbstate_t& __state,
|
williamr@4
|
421 |
char* __to,
|
williamr@2
|
422 |
char* __to_limit,
|
williamr@2
|
423 |
char*& __to_next) const;
|
williamr@2
|
424 |
|
williamr@4
|
425 |
_STLP_DECLSPEC virtual int do_encoding() const _STLP_NOTHROW;
|
williamr@2
|
426 |
|
williamr@4
|
427 |
_STLP_DECLSPEC virtual bool do_always_noconv() const _STLP_NOTHROW;
|
williamr@4
|
428 |
|
williamr@4
|
429 |
_STLP_DECLSPEC virtual int do_length(const mbstate_t& __state,
|
williamr@4
|
430 |
const char* __from,
|
williamr@2
|
431 |
const char* __end,
|
williamr@2
|
432 |
size_t __max) const;
|
williamr@2
|
433 |
|
williamr@4
|
434 |
_STLP_DECLSPEC virtual int do_max_length() const _STLP_NOTHROW;
|
williamr@2
|
435 |
|
williamr@2
|
436 |
private:
|
williamr@2
|
437 |
_Locale_ctype* _M_ctype;
|
williamr@2
|
438 |
codecvt_byname(const codecvt_byname<wchar_t, char, mbstate_t>&);
|
williamr@4
|
439 |
codecvt_byname<wchar_t, char, mbstate_t>& operator =(const codecvt_byname<wchar_t, char, mbstate_t>&);
|
williamr@2
|
440 |
};
|
williamr@2
|
441 |
|
williamr@2
|
442 |
# endif
|
williamr@2
|
443 |
|
williamr@2
|
444 |
_STLP_END_NAMESPACE
|
williamr@2
|
445 |
|
williamr@2
|
446 |
#endif /* _STLP_INTERNAL_CODECVT_H */
|
williamr@2
|
447 |
|
williamr@2
|
448 |
// Local Variables:
|
williamr@2
|
449 |
// mode:C++
|
williamr@2
|
450 |
// End:
|
williamr@2
|
451 |
|