xref: /freebsd/contrib/llvm-project/libcxx/include/__cxx03/codecvt (revision 700637cbb5e582861067a11aaca4d053546871d2)
1// -*- C++ -*-
2//===----------------------------------------------------------------------===//
3//
4// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
5// See https://llvm.org/LICENSE.txt for license information.
6// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7//
8//===----------------------------------------------------------------------===//
9
10#ifndef _LIBCPP___CXX03_CODECVT
11#define _LIBCPP___CXX03_CODECVT
12
13/*
14    codecvt synopsis
15
16namespace std
17{
18
19enum codecvt_mode
20{
21    consume_header = 4,
22    generate_header = 2,
23    little_endian = 1
24};
25
26template <class Elem, unsigned long Maxcode = 0x10ffff,
27          codecvt_mode Mode = (codecvt_mode)0>
28class codecvt_utf8
29    : public codecvt<Elem, char, mbstate_t>
30{
31    explicit codecvt_utf8(size_t refs = 0);
32    ~codecvt_utf8();
33};
34
35template <class Elem, unsigned long Maxcode = 0x10ffff,
36          codecvt_mode Mode = (codecvt_mode)0>
37class codecvt_utf16
38    : public codecvt<Elem, char, mbstate_t>
39{
40    explicit codecvt_utf16(size_t refs = 0);
41    ~codecvt_utf16();
42};
43
44template <class Elem, unsigned long Maxcode = 0x10ffff,
45          codecvt_mode Mode = (codecvt_mode)0>
46class codecvt_utf8_utf16
47    : public codecvt<Elem, char, mbstate_t>
48{
49    explicit codecvt_utf8_utf16(size_t refs = 0);
50    ~codecvt_utf8_utf16();
51};
52
53}  // std
54
55*/
56
57#include <__cxx03/__config>
58#include <__cxx03/__locale>
59#include <__cxx03/version>
60
61#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
62#  pragma GCC system_header
63#endif
64
65_LIBCPP_BEGIN_NAMESPACE_STD
66
67enum codecvt_mode { consume_header = 4, generate_header = 2, little_endian = 1 };
68
69// codecvt_utf8
70
71template <class _Elem>
72class __codecvt_utf8;
73
74#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
75template <>
76class _LIBCPP_EXPORTED_FROM_ABI __codecvt_utf8<wchar_t> : public codecvt<wchar_t, char, mbstate_t> {
77  unsigned long __maxcode_;
78  _LIBCPP_SUPPRESS_DEPRECATED_PUSH
79  codecvt_mode __mode_;
80  _LIBCPP_SUPPRESS_DEPRECATED_POP
81
82public:
83  typedef wchar_t intern_type;
84  typedef char extern_type;
85  typedef mbstate_t state_type;
86
87  _LIBCPP_SUPPRESS_DEPRECATED_PUSH
88  _LIBCPP_HIDE_FROM_ABI explicit __codecvt_utf8(size_t __refs, unsigned long __maxcode, codecvt_mode __mode)
89      : codecvt<wchar_t, char, mbstate_t>(__refs), __maxcode_(__maxcode), __mode_(__mode) {}
90  _LIBCPP_SUPPRESS_DEPRECATED_POP
91
92protected:
93  result do_out(state_type& __st,
94                const intern_type* __frm,
95                const intern_type* __frm_end,
96                const intern_type*& __frm_nxt,
97                extern_type* __to,
98                extern_type* __to_end,
99                extern_type*& __to_nxt) const override;
100  result do_in(state_type& __st,
101               const extern_type* __frm,
102               const extern_type* __frm_end,
103               const extern_type*& __frm_nxt,
104               intern_type* __to,
105               intern_type* __to_end,
106               intern_type*& __to_nxt) const override;
107  result do_unshift(state_type& __st, extern_type* __to, extern_type* __to_end, extern_type*& __to_nxt) const override;
108  int do_encoding() const _NOEXCEPT override;
109  bool do_always_noconv() const _NOEXCEPT override;
110  int do_length(state_type&, const extern_type* __frm, const extern_type* __end, size_t __mx) const override;
111  int do_max_length() const _NOEXCEPT override;
112};
113#endif // _LIBCPP_HAS_NO_WIDE_CHARACTERS
114
115_LIBCPP_SUPPRESS_DEPRECATED_PUSH
116template <>
117class _LIBCPP_EXPORTED_FROM_ABI __codecvt_utf8<char16_t> : public codecvt<char16_t, char, mbstate_t> {
118  unsigned long __maxcode_;
119  codecvt_mode __mode_;
120
121public:
122  typedef char16_t intern_type;
123  typedef char extern_type;
124  typedef mbstate_t state_type;
125
126  _LIBCPP_HIDE_FROM_ABI explicit __codecvt_utf8(size_t __refs, unsigned long __maxcode, codecvt_mode __mode)
127      : codecvt<char16_t, char, mbstate_t>(__refs), __maxcode_(__maxcode), __mode_(__mode) {}
128  _LIBCPP_SUPPRESS_DEPRECATED_POP
129
130protected:
131  result do_out(state_type& __st,
132                const intern_type* __frm,
133                const intern_type* __frm_end,
134                const intern_type*& __frm_nxt,
135                extern_type* __to,
136                extern_type* __to_end,
137                extern_type*& __to_nxt) const override;
138  result do_in(state_type& __st,
139               const extern_type* __frm,
140               const extern_type* __frm_end,
141               const extern_type*& __frm_nxt,
142               intern_type* __to,
143               intern_type* __to_end,
144               intern_type*& __to_nxt) const override;
145  result do_unshift(state_type& __st, extern_type* __to, extern_type* __to_end, extern_type*& __to_nxt) const override;
146  int do_encoding() const _NOEXCEPT override;
147  bool do_always_noconv() const _NOEXCEPT override;
148  int do_length(state_type&, const extern_type* __frm, const extern_type* __end, size_t __mx) const override;
149  int do_max_length() const _NOEXCEPT override;
150};
151
152_LIBCPP_SUPPRESS_DEPRECATED_PUSH
153template <>
154class _LIBCPP_EXPORTED_FROM_ABI __codecvt_utf8<char32_t> : public codecvt<char32_t, char, mbstate_t> {
155  unsigned long __maxcode_;
156  codecvt_mode __mode_;
157
158public:
159  typedef char32_t intern_type;
160  typedef char extern_type;
161  typedef mbstate_t state_type;
162
163  _LIBCPP_HIDE_FROM_ABI explicit __codecvt_utf8(size_t __refs, unsigned long __maxcode, codecvt_mode __mode)
164      : codecvt<char32_t, char, mbstate_t>(__refs), __maxcode_(__maxcode), __mode_(__mode) {}
165  _LIBCPP_SUPPRESS_DEPRECATED_POP
166
167protected:
168  result do_out(state_type& __st,
169                const intern_type* __frm,
170                const intern_type* __frm_end,
171                const intern_type*& __frm_nxt,
172                extern_type* __to,
173                extern_type* __to_end,
174                extern_type*& __to_nxt) const override;
175  result do_in(state_type& __st,
176               const extern_type* __frm,
177               const extern_type* __frm_end,
178               const extern_type*& __frm_nxt,
179               intern_type* __to,
180               intern_type* __to_end,
181               intern_type*& __to_nxt) const override;
182  result do_unshift(state_type& __st, extern_type* __to, extern_type* __to_end, extern_type*& __to_nxt) const override;
183  int do_encoding() const _NOEXCEPT override;
184  bool do_always_noconv() const _NOEXCEPT override;
185  int do_length(state_type&, const extern_type* __frm, const extern_type* __end, size_t __mx) const override;
186  int do_max_length() const _NOEXCEPT override;
187};
188
189_LIBCPP_SUPPRESS_DEPRECATED_PUSH
190template <class _Elem, unsigned long _Maxcode = 0x10ffff, codecvt_mode _Mode = (codecvt_mode)0>
191class _LIBCPP_TEMPLATE_VIS codecvt_utf8 : public __codecvt_utf8<_Elem> {
192public:
193  _LIBCPP_HIDE_FROM_ABI explicit codecvt_utf8(size_t __refs = 0) : __codecvt_utf8<_Elem>(__refs, _Maxcode, _Mode) {}
194
195  _LIBCPP_HIDE_FROM_ABI ~codecvt_utf8() {}
196};
197_LIBCPP_SUPPRESS_DEPRECATED_POP
198
199// codecvt_utf16
200
201template <class _Elem, bool _LittleEndian>
202class __codecvt_utf16;
203
204#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
205template <>
206class _LIBCPP_EXPORTED_FROM_ABI __codecvt_utf16<wchar_t, false> : public codecvt<wchar_t, char, mbstate_t> {
207  unsigned long __maxcode_;
208  _LIBCPP_SUPPRESS_DEPRECATED_PUSH
209  codecvt_mode __mode_;
210  _LIBCPP_SUPPRESS_DEPRECATED_POP
211
212public:
213  typedef wchar_t intern_type;
214  typedef char extern_type;
215  typedef mbstate_t state_type;
216
217  _LIBCPP_SUPPRESS_DEPRECATED_PUSH
218  _LIBCPP_HIDE_FROM_ABI explicit __codecvt_utf16(size_t __refs, unsigned long __maxcode, codecvt_mode __mode)
219      : codecvt<wchar_t, char, mbstate_t>(__refs), __maxcode_(__maxcode), __mode_(__mode) {}
220  _LIBCPP_SUPPRESS_DEPRECATED_POP
221
222protected:
223  result do_out(state_type& __st,
224                const intern_type* __frm,
225                const intern_type* __frm_end,
226                const intern_type*& __frm_nxt,
227                extern_type* __to,
228                extern_type* __to_end,
229                extern_type*& __to_nxt) const override;
230  result do_in(state_type& __st,
231               const extern_type* __frm,
232               const extern_type* __frm_end,
233               const extern_type*& __frm_nxt,
234               intern_type* __to,
235               intern_type* __to_end,
236               intern_type*& __to_nxt) const override;
237  result do_unshift(state_type& __st, extern_type* __to, extern_type* __to_end, extern_type*& __to_nxt) const override;
238  int do_encoding() const _NOEXCEPT override;
239  bool do_always_noconv() const _NOEXCEPT override;
240  int do_length(state_type&, const extern_type* __frm, const extern_type* __end, size_t __mx) const override;
241  int do_max_length() const _NOEXCEPT override;
242};
243
244template <>
245class _LIBCPP_EXPORTED_FROM_ABI __codecvt_utf16<wchar_t, true> : public codecvt<wchar_t, char, mbstate_t> {
246  unsigned long __maxcode_;
247  _LIBCPP_SUPPRESS_DEPRECATED_PUSH
248  codecvt_mode __mode_;
249  _LIBCPP_SUPPRESS_DEPRECATED_POP
250
251public:
252  typedef wchar_t intern_type;
253  typedef char extern_type;
254  typedef mbstate_t state_type;
255
256  _LIBCPP_SUPPRESS_DEPRECATED_PUSH
257  _LIBCPP_HIDE_FROM_ABI explicit __codecvt_utf16(size_t __refs, unsigned long __maxcode, codecvt_mode __mode)
258      : codecvt<wchar_t, char, mbstate_t>(__refs), __maxcode_(__maxcode), __mode_(__mode) {}
259  _LIBCPP_SUPPRESS_DEPRECATED_POP
260
261protected:
262  result do_out(state_type& __st,
263                const intern_type* __frm,
264                const intern_type* __frm_end,
265                const intern_type*& __frm_nxt,
266                extern_type* __to,
267                extern_type* __to_end,
268                extern_type*& __to_nxt) const override;
269  result do_in(state_type& __st,
270               const extern_type* __frm,
271               const extern_type* __frm_end,
272               const extern_type*& __frm_nxt,
273               intern_type* __to,
274               intern_type* __to_end,
275               intern_type*& __to_nxt) const override;
276  result do_unshift(state_type& __st, extern_type* __to, extern_type* __to_end, extern_type*& __to_nxt) const override;
277  int do_encoding() const _NOEXCEPT override;
278  bool do_always_noconv() const _NOEXCEPT override;
279  int do_length(state_type&, const extern_type* __frm, const extern_type* __end, size_t __mx) const override;
280  int do_max_length() const _NOEXCEPT override;
281};
282#endif // _LIBCPP_HAS_NO_WIDE_CHARACTERS
283
284_LIBCPP_SUPPRESS_DEPRECATED_PUSH
285template <>
286class _LIBCPP_EXPORTED_FROM_ABI __codecvt_utf16<char16_t, false> : public codecvt<char16_t, char, mbstate_t> {
287  unsigned long __maxcode_;
288  codecvt_mode __mode_;
289
290public:
291  typedef char16_t intern_type;
292  typedef char extern_type;
293  typedef mbstate_t state_type;
294
295  _LIBCPP_HIDE_FROM_ABI explicit __codecvt_utf16(size_t __refs, unsigned long __maxcode, codecvt_mode __mode)
296      : codecvt<char16_t, char, mbstate_t>(__refs), __maxcode_(__maxcode), __mode_(__mode) {}
297  _LIBCPP_SUPPRESS_DEPRECATED_POP
298
299protected:
300  result do_out(state_type& __st,
301                const intern_type* __frm,
302                const intern_type* __frm_end,
303                const intern_type*& __frm_nxt,
304                extern_type* __to,
305                extern_type* __to_end,
306                extern_type*& __to_nxt) const override;
307  result do_in(state_type& __st,
308               const extern_type* __frm,
309               const extern_type* __frm_end,
310               const extern_type*& __frm_nxt,
311               intern_type* __to,
312               intern_type* __to_end,
313               intern_type*& __to_nxt) const override;
314  result do_unshift(state_type& __st, extern_type* __to, extern_type* __to_end, extern_type*& __to_nxt) const override;
315  int do_encoding() const _NOEXCEPT override;
316  bool do_always_noconv() const _NOEXCEPT override;
317  int do_length(state_type&, const extern_type* __frm, const extern_type* __end, size_t __mx) const override;
318  int do_max_length() const _NOEXCEPT override;
319};
320
321_LIBCPP_SUPPRESS_DEPRECATED_PUSH
322template <>
323class _LIBCPP_EXPORTED_FROM_ABI __codecvt_utf16<char16_t, true> : public codecvt<char16_t, char, mbstate_t> {
324  unsigned long __maxcode_;
325  codecvt_mode __mode_;
326
327public:
328  typedef char16_t intern_type;
329  typedef char extern_type;
330  typedef mbstate_t state_type;
331
332  _LIBCPP_HIDE_FROM_ABI explicit __codecvt_utf16(size_t __refs, unsigned long __maxcode, codecvt_mode __mode)
333      : codecvt<char16_t, char, mbstate_t>(__refs), __maxcode_(__maxcode), __mode_(__mode) {}
334  _LIBCPP_SUPPRESS_DEPRECATED_POP
335
336protected:
337  result do_out(state_type& __st,
338                const intern_type* __frm,
339                const intern_type* __frm_end,
340                const intern_type*& __frm_nxt,
341                extern_type* __to,
342                extern_type* __to_end,
343                extern_type*& __to_nxt) const override;
344  result do_in(state_type& __st,
345               const extern_type* __frm,
346               const extern_type* __frm_end,
347               const extern_type*& __frm_nxt,
348               intern_type* __to,
349               intern_type* __to_end,
350               intern_type*& __to_nxt) const override;
351  result do_unshift(state_type& __st, extern_type* __to, extern_type* __to_end, extern_type*& __to_nxt) const override;
352  int do_encoding() const _NOEXCEPT override;
353  bool do_always_noconv() const _NOEXCEPT override;
354  int do_length(state_type&, const extern_type* __frm, const extern_type* __end, size_t __mx) const override;
355  int do_max_length() const _NOEXCEPT override;
356};
357
358_LIBCPP_SUPPRESS_DEPRECATED_PUSH
359template <>
360class _LIBCPP_EXPORTED_FROM_ABI __codecvt_utf16<char32_t, false> : public codecvt<char32_t, char, mbstate_t> {
361  unsigned long __maxcode_;
362  codecvt_mode __mode_;
363
364public:
365  typedef char32_t intern_type;
366  typedef char extern_type;
367  typedef mbstate_t state_type;
368
369  _LIBCPP_HIDE_FROM_ABI explicit __codecvt_utf16(size_t __refs, unsigned long __maxcode, codecvt_mode __mode)
370      : codecvt<char32_t, char, mbstate_t>(__refs), __maxcode_(__maxcode), __mode_(__mode) {}
371  _LIBCPP_SUPPRESS_DEPRECATED_POP
372
373protected:
374  result do_out(state_type& __st,
375                const intern_type* __frm,
376                const intern_type* __frm_end,
377                const intern_type*& __frm_nxt,
378                extern_type* __to,
379                extern_type* __to_end,
380                extern_type*& __to_nxt) const override;
381  result do_in(state_type& __st,
382               const extern_type* __frm,
383               const extern_type* __frm_end,
384               const extern_type*& __frm_nxt,
385               intern_type* __to,
386               intern_type* __to_end,
387               intern_type*& __to_nxt) const override;
388  result do_unshift(state_type& __st, extern_type* __to, extern_type* __to_end, extern_type*& __to_nxt) const override;
389  int do_encoding() const _NOEXCEPT override;
390  bool do_always_noconv() const _NOEXCEPT override;
391  int do_length(state_type&, const extern_type* __frm, const extern_type* __end, size_t __mx) const override;
392  int do_max_length() const _NOEXCEPT override;
393};
394
395_LIBCPP_SUPPRESS_DEPRECATED_PUSH
396template <>
397class _LIBCPP_EXPORTED_FROM_ABI __codecvt_utf16<char32_t, true> : public codecvt<char32_t, char, mbstate_t> {
398  unsigned long __maxcode_;
399  codecvt_mode __mode_;
400
401public:
402  typedef char32_t intern_type;
403  typedef char extern_type;
404  typedef mbstate_t state_type;
405
406  _LIBCPP_HIDE_FROM_ABI explicit __codecvt_utf16(size_t __refs, unsigned long __maxcode, codecvt_mode __mode)
407      : codecvt<char32_t, char, mbstate_t>(__refs), __maxcode_(__maxcode), __mode_(__mode) {}
408  _LIBCPP_SUPPRESS_DEPRECATED_POP
409
410protected:
411  result do_out(state_type& __st,
412                const intern_type* __frm,
413                const intern_type* __frm_end,
414                const intern_type*& __frm_nxt,
415                extern_type* __to,
416                extern_type* __to_end,
417                extern_type*& __to_nxt) const override;
418  result do_in(state_type& __st,
419               const extern_type* __frm,
420               const extern_type* __frm_end,
421               const extern_type*& __frm_nxt,
422               intern_type* __to,
423               intern_type* __to_end,
424               intern_type*& __to_nxt) const override;
425  result do_unshift(state_type& __st, extern_type* __to, extern_type* __to_end, extern_type*& __to_nxt) const override;
426  int do_encoding() const _NOEXCEPT override;
427  bool do_always_noconv() const _NOEXCEPT override;
428  int do_length(state_type&, const extern_type* __frm, const extern_type* __end, size_t __mx) const override;
429  int do_max_length() const _NOEXCEPT override;
430};
431
432_LIBCPP_SUPPRESS_DEPRECATED_PUSH
433template <class _Elem, unsigned long _Maxcode = 0x10ffff, codecvt_mode _Mode = (codecvt_mode)0>
434class _LIBCPP_TEMPLATE_VIS codecvt_utf16 : public __codecvt_utf16<_Elem, _Mode & little_endian> {
435public:
436  _LIBCPP_HIDE_FROM_ABI explicit codecvt_utf16(size_t __refs = 0)
437      : __codecvt_utf16 < _Elem,
438  _Mode & little_endian > (__refs, _Maxcode, _Mode) {}
439
440  _LIBCPP_HIDE_FROM_ABI ~codecvt_utf16() {}
441};
442_LIBCPP_SUPPRESS_DEPRECATED_POP
443
444// codecvt_utf8_utf16
445
446template <class _Elem>
447class __codecvt_utf8_utf16;
448
449#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
450template <>
451class _LIBCPP_EXPORTED_FROM_ABI __codecvt_utf8_utf16<wchar_t> : public codecvt<wchar_t, char, mbstate_t> {
452  unsigned long __maxcode_;
453  _LIBCPP_SUPPRESS_DEPRECATED_PUSH
454  codecvt_mode __mode_;
455  _LIBCPP_SUPPRESS_DEPRECATED_POP
456
457public:
458  typedef wchar_t intern_type;
459  typedef char extern_type;
460  typedef mbstate_t state_type;
461
462  _LIBCPP_SUPPRESS_DEPRECATED_PUSH
463  _LIBCPP_HIDE_FROM_ABI explicit __codecvt_utf8_utf16(size_t __refs, unsigned long __maxcode, codecvt_mode __mode)
464      : codecvt<wchar_t, char, mbstate_t>(__refs), __maxcode_(__maxcode), __mode_(__mode) {}
465  _LIBCPP_SUPPRESS_DEPRECATED_POP
466
467protected:
468  result do_out(state_type& __st,
469                const intern_type* __frm,
470                const intern_type* __frm_end,
471                const intern_type*& __frm_nxt,
472                extern_type* __to,
473                extern_type* __to_end,
474                extern_type*& __to_nxt) const override;
475  result do_in(state_type& __st,
476               const extern_type* __frm,
477               const extern_type* __frm_end,
478               const extern_type*& __frm_nxt,
479               intern_type* __to,
480               intern_type* __to_end,
481               intern_type*& __to_nxt) const override;
482  result do_unshift(state_type& __st, extern_type* __to, extern_type* __to_end, extern_type*& __to_nxt) const override;
483  int do_encoding() const _NOEXCEPT override;
484  bool do_always_noconv() const _NOEXCEPT override;
485  int do_length(state_type&, const extern_type* __frm, const extern_type* __end, size_t __mx) const override;
486  int do_max_length() const _NOEXCEPT override;
487};
488#endif // _LIBCPP_HAS_NO_WIDE_CHARACTERS
489
490_LIBCPP_SUPPRESS_DEPRECATED_PUSH
491template <>
492class _LIBCPP_EXPORTED_FROM_ABI __codecvt_utf8_utf16<char32_t> : public codecvt<char32_t, char, mbstate_t> {
493  unsigned long __maxcode_;
494  codecvt_mode __mode_;
495
496public:
497  typedef char32_t intern_type;
498  typedef char extern_type;
499  typedef mbstate_t state_type;
500
501  _LIBCPP_HIDE_FROM_ABI explicit __codecvt_utf8_utf16(size_t __refs, unsigned long __maxcode, codecvt_mode __mode)
502      : codecvt<char32_t, char, mbstate_t>(__refs), __maxcode_(__maxcode), __mode_(__mode) {}
503  _LIBCPP_SUPPRESS_DEPRECATED_POP
504
505protected:
506  result do_out(state_type& __st,
507                const intern_type* __frm,
508                const intern_type* __frm_end,
509                const intern_type*& __frm_nxt,
510                extern_type* __to,
511                extern_type* __to_end,
512                extern_type*& __to_nxt) const override;
513  result do_in(state_type& __st,
514               const extern_type* __frm,
515               const extern_type* __frm_end,
516               const extern_type*& __frm_nxt,
517               intern_type* __to,
518               intern_type* __to_end,
519               intern_type*& __to_nxt) const override;
520  result do_unshift(state_type& __st, extern_type* __to, extern_type* __to_end, extern_type*& __to_nxt) const override;
521  int do_encoding() const _NOEXCEPT override;
522  bool do_always_noconv() const _NOEXCEPT override;
523  int do_length(state_type&, const extern_type* __frm, const extern_type* __end, size_t __mx) const override;
524  int do_max_length() const _NOEXCEPT override;
525};
526
527_LIBCPP_SUPPRESS_DEPRECATED_PUSH
528template <>
529class _LIBCPP_EXPORTED_FROM_ABI __codecvt_utf8_utf16<char16_t> : public codecvt<char16_t, char, mbstate_t> {
530  unsigned long __maxcode_;
531  codecvt_mode __mode_;
532
533public:
534  typedef char16_t intern_type;
535  typedef char extern_type;
536  typedef mbstate_t state_type;
537
538  _LIBCPP_HIDE_FROM_ABI explicit __codecvt_utf8_utf16(size_t __refs, unsigned long __maxcode, codecvt_mode __mode)
539      : codecvt<char16_t, char, mbstate_t>(__refs), __maxcode_(__maxcode), __mode_(__mode) {}
540  _LIBCPP_SUPPRESS_DEPRECATED_POP
541
542protected:
543  result do_out(state_type& __st,
544                const intern_type* __frm,
545                const intern_type* __frm_end,
546                const intern_type*& __frm_nxt,
547                extern_type* __to,
548                extern_type* __to_end,
549                extern_type*& __to_nxt) const override;
550  result do_in(state_type& __st,
551               const extern_type* __frm,
552               const extern_type* __frm_end,
553               const extern_type*& __frm_nxt,
554               intern_type* __to,
555               intern_type* __to_end,
556               intern_type*& __to_nxt) const override;
557  result do_unshift(state_type& __st, extern_type* __to, extern_type* __to_end, extern_type*& __to_nxt) const override;
558  int do_encoding() const _NOEXCEPT override;
559  bool do_always_noconv() const _NOEXCEPT override;
560  int do_length(state_type&, const extern_type* __frm, const extern_type* __end, size_t __mx) const override;
561  int do_max_length() const _NOEXCEPT override;
562};
563
564_LIBCPP_SUPPRESS_DEPRECATED_PUSH
565template <class _Elem, unsigned long _Maxcode = 0x10ffff, codecvt_mode _Mode = (codecvt_mode)0>
566class _LIBCPP_TEMPLATE_VIS codecvt_utf8_utf16 : public __codecvt_utf8_utf16<_Elem> {
567public:
568  _LIBCPP_HIDE_FROM_ABI explicit codecvt_utf8_utf16(size_t __refs = 0)
569      : __codecvt_utf8_utf16<_Elem>(__refs, _Maxcode, _Mode) {}
570
571  _LIBCPP_HIDE_FROM_ABI ~codecvt_utf8_utf16() {}
572};
573_LIBCPP_SUPPRESS_DEPRECATED_POP
574
575_LIBCPP_END_NAMESPACE_STD
576
577#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES)
578#  include <__cxx03/atomic>
579#  include <__cxx03/cstddef>
580#  include <__cxx03/cstdlib>
581#  include <__cxx03/cstring>
582#  include <__cxx03/iosfwd>
583#  include <__cxx03/limits>
584#  include <__cxx03/mutex>
585#  include <__cxx03/new>
586#  include <__cxx03/stdexcept>
587#  include <__cxx03/type_traits>
588#  include <__cxx03/typeinfo>
589#endif
590
591#endif // _LIBCPP___CXX03_CODECVT
592