Attempt to represent the S^2->S^3 header reorganisation as a series of "hg rename" operations
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.
20 // WARNING: This is an internal header file, included by other C++
21 // standard library headers. You should not attempt to use this header
25 #ifndef _STLP_INTERNAL_CODECVT_H
26 #define _STLP_INTERNAL_CODECVT_H
28 # ifndef _STLP_C_LOCALE_H
29 # include <stl/c_locale.h>
31 # ifndef _STLP_INTERNAL_LOCALE_H
32 # include <stl/_locale.h>
37 class _STLP_CLASS_DECLSPEC codecvt_base {
39 enum result {ok, partial, error, noconv};
42 template <class _InternT, class _ExternT, class _StateT>
43 class codecvt : public locale::facet, public codecvt_base {
44 typedef _InternT intern_type;
45 typedef _ExternT extern_type;
46 typedef _StateT state_type;
49 template <class _InternT, class _ExternT, class _StateT>
50 class codecvt_byname : public codecvt<_InternT, _ExternT, _StateT> {};
54 class codecvt<char, char, mbstate_t> : public locale::facet, public codecvt_base
56 class _STLP_CLASS_DECLSPEC codecvt<char, char, mbstate_t> : public locale::facet, public codecvt_base
61 typedef char intern_type;
62 typedef char extern_type;
63 typedef mbstate_t state_type;
65 explicit codecvt(size_t __refs = 0) : _BaseFacet(__refs) {}
67 result out(state_type& __state,
69 const char* __from_end,
70 const char*& __from_next,
73 char*& __to_next) const {
74 return do_out(__state,
75 __from, __from_end, __from_next,
76 __to, __to_limit, __to_next);
79 result unshift(mbstate_t& __state,
80 char* __to, char* __to_limit, char*& __to_next) const
81 { return do_unshift(__state, __to, __to_limit, __to_next); }
83 result in(state_type& __state,
85 const char* __from_end,
86 const char*& __from_next,
89 char*& __to_next) const {
91 __from, __from_end, __from_next,
92 __to, __to_limit, __to_next);
95 int encoding() const _STLP_NOTHROW { return do_encoding(); }
97 bool always_noconv() const _STLP_NOTHROW { return do_always_noconv(); }
99 int length(const state_type& __state,
100 const char* __from, const char* __end,
102 { return do_length(__state, __from, __end, __max); }
104 int max_length() const _STLP_NOTHROW { return do_max_length(); }
106 #if defined(__LIBSTD_CPP_SYMBIAN32_WSD__) || defined(_STLP_LIBSTD_CPP_NO_STATIC_VAR_)
107 _STLP_STATIC_MEMBER_DECLSPEC static locale::id& GetFacetLocaleId();
109 _STLP_STATIC_MEMBER_DECLSPEC static locale::id id;
113 _STLP_DECLSPEC ~codecvt();
115 _STLP_DECLSPEC virtual result do_out(mbstate_t& /* __state */,
117 const char* /* __from_end */,
118 const char*& __from_next,
120 char* /* __to_limit */,
121 char*& __to_next) const;
123 _STLP_DECLSPEC virtual result do_in (mbstate_t& /* __state */ ,
125 const char* /* __from_end */,
126 const char*& __from_next,
128 char* /* __to_end */,
129 char*& __to_next) const;
131 _STLP_DECLSPEC virtual result do_unshift(mbstate_t& /* __state */,
133 char* /* __to_limit */,
134 char*& __to_next) const;
136 _STLP_DECLSPEC virtual int do_encoding() const _STLP_NOTHROW;
137 _STLP_DECLSPEC virtual bool do_always_noconv() const _STLP_NOTHROW;
138 _STLP_DECLSPEC virtual int do_length(const mbstate_t& __state,
142 _STLP_DECLSPEC virtual int do_max_length() const _STLP_NOTHROW;
144 codecvt(const codecvt<char, char, mbstate_t>&);
145 codecvt<char, char, mbstate_t>& operator =(const codecvt<char, char, mbstate_t>&);
148 # ifndef _STLP_NO_WCHAR_T
151 #if defined(__LIBSTD_CPP_SYMBIAN32_WSD__) || defined(_STLP_LIBSTD_CPP_NO_STATIC_VAR_)
152 class codecvt<wchar_t, char, mbstate_t> : public locale::facet, public codecvt_base
154 class _STLP_CLASS_DECLSPEC codecvt<wchar_t, char, mbstate_t> : public locale::facet, public codecvt_base
157 friend class _Locale;
159 typedef wchar_t intern_type;
160 typedef char extern_type;
161 typedef mbstate_t state_type;
163 explicit codecvt(size_t __refs = 0) : _BaseFacet(__refs) {}
165 result out(mbstate_t& __state,
166 const wchar_t* __from,
167 const wchar_t* __from_end,
168 const wchar_t*& __from_next,
171 char*& __to_next) const {
172 return do_out(__state,
173 __from, __from_end, __from_next,
174 __to, __to_limit, __to_next);
177 result unshift(mbstate_t& __state,
178 char* __to, char* __to_limit, char*& __to_next) const {
179 return do_unshift(__state, __to, __to_limit, __to_next);
182 result in(mbstate_t& __state,
184 const char* __from_end,
185 const char*& __from_next,
188 wchar_t*& __to_next) const {
189 return do_in(__state,
190 __from, __from_end, __from_next,
191 __to, __to_limit, __to_next);
194 int encoding() const _STLP_NOTHROW { return do_encoding(); }
196 bool always_noconv() const _STLP_NOTHROW { return do_always_noconv(); }
198 int length(const mbstate_t& __state,
202 { return do_length(__state, __from, __end, __max); }
204 int max_length() const _STLP_NOTHROW { return do_max_length(); }
206 #if defined(__LIBSTD_CPP_SYMBIAN32_WSD__) || defined(_STLP_LIBSTD_CPP_NO_STATIC_VAR_)
207 _STLP_STATIC_MEMBER_DECLSPEC static locale::id& GetFacetLocaleId();
209 _STLP_STATIC_MEMBER_DECLSPEC static locale::id id;
213 _STLP_DECLSPEC ~codecvt();
215 _STLP_DECLSPEC virtual result do_out(mbstate_t& __state,
216 const wchar_t* __from,
217 const wchar_t* __from_end,
218 const wchar_t*& __from_next,
221 char*& __to_next) const;
223 _STLP_DECLSPEC virtual result do_in (mbstate_t& __state,
225 const char* __from_end,
226 const char*& __from_next,
229 wchar_t*& __to_next) const;
231 _STLP_DECLSPEC virtual result do_unshift(mbstate_t& __state,
234 char*& __to_next) const;
236 _STLP_DECLSPEC virtual int do_encoding() const _STLP_NOTHROW;
238 _STLP_DECLSPEC virtual bool do_always_noconv() const _STLP_NOTHROW;
240 _STLP_DECLSPEC virtual int do_length(const mbstate_t& __state,
245 _STLP_DECLSPEC virtual int do_max_length() const _STLP_NOTHROW;
248 codecvt(const codecvt<wchar_t, char, mbstate_t>&);
249 codecvt<wchar_t, char, mbstate_t>& operator = (const codecvt<wchar_t, char, mbstate_t>&);
255 class _STLP_CLASS_DECLSPEC codecvt_byname<char, char, mbstate_t>
256 : public codecvt<char, char, mbstate_t> {
258 explicit _STLP_DECLSPEC codecvt_byname(const char* __name, size_t __refs = 0);
261 codecvt_byname(const codecvt_byname<char, char, mbstate_t>&);
262 codecvt_byname<char, char, mbstate_t>& operator =(const codecvt_byname<char, char, mbstate_t>&);
265 # ifndef _STLP_NO_WCHAR_T
267 class codecvt_byname<wchar_t, char, mbstate_t>
268 : public codecvt<wchar_t, char, mbstate_t>
271 explicit _STLP_DECLSPEC codecvt_byname(const char * __name, size_t __refs = 0);
274 _STLP_DECLSPEC ~codecvt_byname();
276 _STLP_DECLSPEC virtual result do_out(mbstate_t& __state,
277 const wchar_t* __from,
278 const wchar_t* __from_end,
279 const wchar_t*& __from_next,
282 char*& __to_next) const;
284 _STLP_DECLSPEC virtual result do_in (mbstate_t& __state,
286 const char* __from_end,
287 const char*& __from_next,
290 wchar_t*& __to_next) const;
292 _STLP_DECLSPEC virtual result do_unshift(mbstate_t& __state,
295 char*& __to_next) const;
297 _STLP_DECLSPEC virtual int do_encoding() const _STLP_NOTHROW;
299 _STLP_DECLSPEC virtual bool do_always_noconv() const _STLP_NOTHROW;
301 _STLP_DECLSPEC virtual int do_length(const mbstate_t& __state,
306 _STLP_DECLSPEC virtual int do_max_length() const _STLP_NOTHROW;
309 _Locale_ctype* _M_ctype;
310 codecvt_byname(const codecvt_byname<wchar_t, char, mbstate_t>&);
311 codecvt_byname<wchar_t, char, mbstate_t>& operator =(const codecvt_byname<wchar_t, char, mbstate_t>&);
318 #endif /* _STLP_INTERNAL_CODECVT_H */