Back to home page

EIC code displayed by LXR

 
 

    


Warning, /include/c++/v1/__cxx03/codecvt is written in an unsupported language. File is not indexed.

0001 // -*- C++ -*-
0002 //===----------------------------------------------------------------------===//
0003 //
0004 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
0005 // See https://llvm.org/LICENSE.txt for license information.
0006 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
0007 //
0008 //===----------------------------------------------------------------------===//
0009 
0010 #ifndef _LIBCPP___CXX03_CODECVT
0011 #define _LIBCPP___CXX03_CODECVT
0012 
0013 /*
0014     codecvt synopsis
0015 
0016 namespace std
0017 {
0018 
0019 enum codecvt_mode
0020 {
0021     consume_header = 4,
0022     generate_header = 2,
0023     little_endian = 1
0024 };
0025 
0026 template <class Elem, unsigned long Maxcode = 0x10ffff,
0027           codecvt_mode Mode = (codecvt_mode)0>
0028 class codecvt_utf8
0029     : public codecvt<Elem, char, mbstate_t>
0030 {
0031     explicit codecvt_utf8(size_t refs = 0);
0032     ~codecvt_utf8();
0033 };
0034 
0035 template <class Elem, unsigned long Maxcode = 0x10ffff,
0036           codecvt_mode Mode = (codecvt_mode)0>
0037 class codecvt_utf16
0038     : public codecvt<Elem, char, mbstate_t>
0039 {
0040     explicit codecvt_utf16(size_t refs = 0);
0041     ~codecvt_utf16();
0042 };
0043 
0044 template <class Elem, unsigned long Maxcode = 0x10ffff,
0045           codecvt_mode Mode = (codecvt_mode)0>
0046 class codecvt_utf8_utf16
0047     : public codecvt<Elem, char, mbstate_t>
0048 {
0049     explicit codecvt_utf8_utf16(size_t refs = 0);
0050     ~codecvt_utf8_utf16();
0051 };
0052 
0053 }  // std
0054 
0055 */
0056 
0057 #include <__cxx03/__config>
0058 #include <__cxx03/__locale>
0059 #include <__cxx03/version>
0060 
0061 #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
0062 #  pragma GCC system_header
0063 #endif
0064 
0065 #if _LIBCPP_STD_VER < 26 || defined(_LIBCPP_BUILDING_LIBRARY) || defined(_LIBCPP_ENABLE_CXX26_REMOVED_CODECVT)
0066 
0067 _LIBCPP_BEGIN_NAMESPACE_STD
0068 
0069 enum _LIBCPP_DEPRECATED_IN_CXX17 codecvt_mode { consume_header = 4, generate_header = 2, little_endian = 1 };
0070 
0071 // codecvt_utf8
0072 
0073 template <class _Elem>
0074 class __codecvt_utf8;
0075 
0076 #  ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
0077 template <>
0078 class _LIBCPP_EXPORTED_FROM_ABI __codecvt_utf8<wchar_t> : public codecvt<wchar_t, char, mbstate_t> {
0079   unsigned long __maxcode_;
0080   _LIBCPP_SUPPRESS_DEPRECATED_PUSH
0081   codecvt_mode __mode_;
0082   _LIBCPP_SUPPRESS_DEPRECATED_POP
0083 
0084 public:
0085   typedef wchar_t intern_type;
0086   typedef char extern_type;
0087   typedef mbstate_t state_type;
0088 
0089   _LIBCPP_SUPPRESS_DEPRECATED_PUSH
0090   _LIBCPP_HIDE_FROM_ABI explicit __codecvt_utf8(size_t __refs, unsigned long __maxcode, codecvt_mode __mode)
0091       : codecvt<wchar_t, char, mbstate_t>(__refs), __maxcode_(__maxcode), __mode_(__mode) {}
0092   _LIBCPP_SUPPRESS_DEPRECATED_POP
0093 
0094 protected:
0095   result do_out(state_type& __st,
0096                 const intern_type* __frm,
0097                 const intern_type* __frm_end,
0098                 const intern_type*& __frm_nxt,
0099                 extern_type* __to,
0100                 extern_type* __to_end,
0101                 extern_type*& __to_nxt) const override;
0102   result do_in(state_type& __st,
0103                const extern_type* __frm,
0104                const extern_type* __frm_end,
0105                const extern_type*& __frm_nxt,
0106                intern_type* __to,
0107                intern_type* __to_end,
0108                intern_type*& __to_nxt) const override;
0109   result do_unshift(state_type& __st, extern_type* __to, extern_type* __to_end, extern_type*& __to_nxt) const override;
0110   int do_encoding() const _NOEXCEPT override;
0111   bool do_always_noconv() const _NOEXCEPT override;
0112   int do_length(state_type&, const extern_type* __frm, const extern_type* __end, size_t __mx) const override;
0113   int do_max_length() const _NOEXCEPT override;
0114 };
0115 #  endif // _LIBCPP_HAS_NO_WIDE_CHARACTERS
0116 
0117 _LIBCPP_SUPPRESS_DEPRECATED_PUSH
0118 template <>
0119 class _LIBCPP_EXPORTED_FROM_ABI __codecvt_utf8<char16_t> : public codecvt<char16_t, char, mbstate_t> {
0120   unsigned long __maxcode_;
0121   codecvt_mode __mode_;
0122 
0123 public:
0124   typedef char16_t intern_type;
0125   typedef char extern_type;
0126   typedef mbstate_t state_type;
0127 
0128   _LIBCPP_HIDE_FROM_ABI explicit __codecvt_utf8(size_t __refs, unsigned long __maxcode, codecvt_mode __mode)
0129       : codecvt<char16_t, char, mbstate_t>(__refs), __maxcode_(__maxcode), __mode_(__mode) {}
0130   _LIBCPP_SUPPRESS_DEPRECATED_POP
0131 
0132 protected:
0133   result do_out(state_type& __st,
0134                 const intern_type* __frm,
0135                 const intern_type* __frm_end,
0136                 const intern_type*& __frm_nxt,
0137                 extern_type* __to,
0138                 extern_type* __to_end,
0139                 extern_type*& __to_nxt) const override;
0140   result do_in(state_type& __st,
0141                const extern_type* __frm,
0142                const extern_type* __frm_end,
0143                const extern_type*& __frm_nxt,
0144                intern_type* __to,
0145                intern_type* __to_end,
0146                intern_type*& __to_nxt) const override;
0147   result do_unshift(state_type& __st, extern_type* __to, extern_type* __to_end, extern_type*& __to_nxt) const override;
0148   int do_encoding() const _NOEXCEPT override;
0149   bool do_always_noconv() const _NOEXCEPT override;
0150   int do_length(state_type&, const extern_type* __frm, const extern_type* __end, size_t __mx) const override;
0151   int do_max_length() const _NOEXCEPT override;
0152 };
0153 
0154 _LIBCPP_SUPPRESS_DEPRECATED_PUSH
0155 template <>
0156 class _LIBCPP_EXPORTED_FROM_ABI __codecvt_utf8<char32_t> : public codecvt<char32_t, char, mbstate_t> {
0157   unsigned long __maxcode_;
0158   codecvt_mode __mode_;
0159 
0160 public:
0161   typedef char32_t intern_type;
0162   typedef char extern_type;
0163   typedef mbstate_t state_type;
0164 
0165   _LIBCPP_HIDE_FROM_ABI explicit __codecvt_utf8(size_t __refs, unsigned long __maxcode, codecvt_mode __mode)
0166       : codecvt<char32_t, char, mbstate_t>(__refs), __maxcode_(__maxcode), __mode_(__mode) {}
0167   _LIBCPP_SUPPRESS_DEPRECATED_POP
0168 
0169 protected:
0170   result do_out(state_type& __st,
0171                 const intern_type* __frm,
0172                 const intern_type* __frm_end,
0173                 const intern_type*& __frm_nxt,
0174                 extern_type* __to,
0175                 extern_type* __to_end,
0176                 extern_type*& __to_nxt) const override;
0177   result do_in(state_type& __st,
0178                const extern_type* __frm,
0179                const extern_type* __frm_end,
0180                const extern_type*& __frm_nxt,
0181                intern_type* __to,
0182                intern_type* __to_end,
0183                intern_type*& __to_nxt) const override;
0184   result do_unshift(state_type& __st, extern_type* __to, extern_type* __to_end, extern_type*& __to_nxt) const override;
0185   int do_encoding() const _NOEXCEPT override;
0186   bool do_always_noconv() const _NOEXCEPT override;
0187   int do_length(state_type&, const extern_type* __frm, const extern_type* __end, size_t __mx) const override;
0188   int do_max_length() const _NOEXCEPT override;
0189 };
0190 
0191 _LIBCPP_SUPPRESS_DEPRECATED_PUSH
0192 template <class _Elem, unsigned long _Maxcode = 0x10ffff, codecvt_mode _Mode = (codecvt_mode)0>
0193 class _LIBCPP_TEMPLATE_VIS _LIBCPP_DEPRECATED_IN_CXX17 codecvt_utf8 : public __codecvt_utf8<_Elem> {
0194 public:
0195   _LIBCPP_HIDE_FROM_ABI explicit codecvt_utf8(size_t __refs = 0) : __codecvt_utf8<_Elem>(__refs, _Maxcode, _Mode) {}
0196 
0197   _LIBCPP_HIDE_FROM_ABI ~codecvt_utf8() {}
0198 };
0199 _LIBCPP_SUPPRESS_DEPRECATED_POP
0200 
0201 // codecvt_utf16
0202 
0203 template <class _Elem, bool _LittleEndian>
0204 class __codecvt_utf16;
0205 
0206 #  ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
0207 template <>
0208 class _LIBCPP_EXPORTED_FROM_ABI __codecvt_utf16<wchar_t, false> : public codecvt<wchar_t, char, mbstate_t> {
0209   unsigned long __maxcode_;
0210   _LIBCPP_SUPPRESS_DEPRECATED_PUSH
0211   codecvt_mode __mode_;
0212   _LIBCPP_SUPPRESS_DEPRECATED_POP
0213 
0214 public:
0215   typedef wchar_t intern_type;
0216   typedef char extern_type;
0217   typedef mbstate_t state_type;
0218 
0219   _LIBCPP_SUPPRESS_DEPRECATED_PUSH
0220   _LIBCPP_HIDE_FROM_ABI explicit __codecvt_utf16(size_t __refs, unsigned long __maxcode, codecvt_mode __mode)
0221       : codecvt<wchar_t, char, mbstate_t>(__refs), __maxcode_(__maxcode), __mode_(__mode) {}
0222   _LIBCPP_SUPPRESS_DEPRECATED_POP
0223 
0224 protected:
0225   result do_out(state_type& __st,
0226                 const intern_type* __frm,
0227                 const intern_type* __frm_end,
0228                 const intern_type*& __frm_nxt,
0229                 extern_type* __to,
0230                 extern_type* __to_end,
0231                 extern_type*& __to_nxt) const override;
0232   result do_in(state_type& __st,
0233                const extern_type* __frm,
0234                const extern_type* __frm_end,
0235                const extern_type*& __frm_nxt,
0236                intern_type* __to,
0237                intern_type* __to_end,
0238                intern_type*& __to_nxt) const override;
0239   result do_unshift(state_type& __st, extern_type* __to, extern_type* __to_end, extern_type*& __to_nxt) const override;
0240   int do_encoding() const _NOEXCEPT override;
0241   bool do_always_noconv() const _NOEXCEPT override;
0242   int do_length(state_type&, const extern_type* __frm, const extern_type* __end, size_t __mx) const override;
0243   int do_max_length() const _NOEXCEPT override;
0244 };
0245 
0246 template <>
0247 class _LIBCPP_EXPORTED_FROM_ABI __codecvt_utf16<wchar_t, true> : public codecvt<wchar_t, char, mbstate_t> {
0248   unsigned long __maxcode_;
0249   _LIBCPP_SUPPRESS_DEPRECATED_PUSH
0250   codecvt_mode __mode_;
0251   _LIBCPP_SUPPRESS_DEPRECATED_POP
0252 
0253 public:
0254   typedef wchar_t intern_type;
0255   typedef char extern_type;
0256   typedef mbstate_t state_type;
0257 
0258   _LIBCPP_SUPPRESS_DEPRECATED_PUSH
0259   _LIBCPP_HIDE_FROM_ABI explicit __codecvt_utf16(size_t __refs, unsigned long __maxcode, codecvt_mode __mode)
0260       : codecvt<wchar_t, char, mbstate_t>(__refs), __maxcode_(__maxcode), __mode_(__mode) {}
0261   _LIBCPP_SUPPRESS_DEPRECATED_POP
0262 
0263 protected:
0264   result do_out(state_type& __st,
0265                 const intern_type* __frm,
0266                 const intern_type* __frm_end,
0267                 const intern_type*& __frm_nxt,
0268                 extern_type* __to,
0269                 extern_type* __to_end,
0270                 extern_type*& __to_nxt) const override;
0271   result do_in(state_type& __st,
0272                const extern_type* __frm,
0273                const extern_type* __frm_end,
0274                const extern_type*& __frm_nxt,
0275                intern_type* __to,
0276                intern_type* __to_end,
0277                intern_type*& __to_nxt) const override;
0278   result do_unshift(state_type& __st, extern_type* __to, extern_type* __to_end, extern_type*& __to_nxt) const override;
0279   int do_encoding() const _NOEXCEPT override;
0280   bool do_always_noconv() const _NOEXCEPT override;
0281   int do_length(state_type&, const extern_type* __frm, const extern_type* __end, size_t __mx) const override;
0282   int do_max_length() const _NOEXCEPT override;
0283 };
0284 #  endif // _LIBCPP_HAS_NO_WIDE_CHARACTERS
0285 
0286 _LIBCPP_SUPPRESS_DEPRECATED_PUSH
0287 template <>
0288 class _LIBCPP_EXPORTED_FROM_ABI __codecvt_utf16<char16_t, false> : public codecvt<char16_t, char, mbstate_t> {
0289   unsigned long __maxcode_;
0290   codecvt_mode __mode_;
0291 
0292 public:
0293   typedef char16_t intern_type;
0294   typedef char extern_type;
0295   typedef mbstate_t state_type;
0296 
0297   _LIBCPP_HIDE_FROM_ABI explicit __codecvt_utf16(size_t __refs, unsigned long __maxcode, codecvt_mode __mode)
0298       : codecvt<char16_t, char, mbstate_t>(__refs), __maxcode_(__maxcode), __mode_(__mode) {}
0299   _LIBCPP_SUPPRESS_DEPRECATED_POP
0300 
0301 protected:
0302   result do_out(state_type& __st,
0303                 const intern_type* __frm,
0304                 const intern_type* __frm_end,
0305                 const intern_type*& __frm_nxt,
0306                 extern_type* __to,
0307                 extern_type* __to_end,
0308                 extern_type*& __to_nxt) const override;
0309   result do_in(state_type& __st,
0310                const extern_type* __frm,
0311                const extern_type* __frm_end,
0312                const extern_type*& __frm_nxt,
0313                intern_type* __to,
0314                intern_type* __to_end,
0315                intern_type*& __to_nxt) const override;
0316   result do_unshift(state_type& __st, extern_type* __to, extern_type* __to_end, extern_type*& __to_nxt) const override;
0317   int do_encoding() const _NOEXCEPT override;
0318   bool do_always_noconv() const _NOEXCEPT override;
0319   int do_length(state_type&, const extern_type* __frm, const extern_type* __end, size_t __mx) const override;
0320   int do_max_length() const _NOEXCEPT override;
0321 };
0322 
0323 _LIBCPP_SUPPRESS_DEPRECATED_PUSH
0324 template <>
0325 class _LIBCPP_EXPORTED_FROM_ABI __codecvt_utf16<char16_t, true> : public codecvt<char16_t, char, mbstate_t> {
0326   unsigned long __maxcode_;
0327   codecvt_mode __mode_;
0328 
0329 public:
0330   typedef char16_t intern_type;
0331   typedef char extern_type;
0332   typedef mbstate_t state_type;
0333 
0334   _LIBCPP_HIDE_FROM_ABI explicit __codecvt_utf16(size_t __refs, unsigned long __maxcode, codecvt_mode __mode)
0335       : codecvt<char16_t, char, mbstate_t>(__refs), __maxcode_(__maxcode), __mode_(__mode) {}
0336   _LIBCPP_SUPPRESS_DEPRECATED_POP
0337 
0338 protected:
0339   result do_out(state_type& __st,
0340                 const intern_type* __frm,
0341                 const intern_type* __frm_end,
0342                 const intern_type*& __frm_nxt,
0343                 extern_type* __to,
0344                 extern_type* __to_end,
0345                 extern_type*& __to_nxt) const override;
0346   result do_in(state_type& __st,
0347                const extern_type* __frm,
0348                const extern_type* __frm_end,
0349                const extern_type*& __frm_nxt,
0350                intern_type* __to,
0351                intern_type* __to_end,
0352                intern_type*& __to_nxt) const override;
0353   result do_unshift(state_type& __st, extern_type* __to, extern_type* __to_end, extern_type*& __to_nxt) const override;
0354   int do_encoding() const _NOEXCEPT override;
0355   bool do_always_noconv() const _NOEXCEPT override;
0356   int do_length(state_type&, const extern_type* __frm, const extern_type* __end, size_t __mx) const override;
0357   int do_max_length() const _NOEXCEPT override;
0358 };
0359 
0360 _LIBCPP_SUPPRESS_DEPRECATED_PUSH
0361 template <>
0362 class _LIBCPP_EXPORTED_FROM_ABI __codecvt_utf16<char32_t, false> : public codecvt<char32_t, char, mbstate_t> {
0363   unsigned long __maxcode_;
0364   codecvt_mode __mode_;
0365 
0366 public:
0367   typedef char32_t intern_type;
0368   typedef char extern_type;
0369   typedef mbstate_t state_type;
0370 
0371   _LIBCPP_HIDE_FROM_ABI explicit __codecvt_utf16(size_t __refs, unsigned long __maxcode, codecvt_mode __mode)
0372       : codecvt<char32_t, char, mbstate_t>(__refs), __maxcode_(__maxcode), __mode_(__mode) {}
0373   _LIBCPP_SUPPRESS_DEPRECATED_POP
0374 
0375 protected:
0376   result do_out(state_type& __st,
0377                 const intern_type* __frm,
0378                 const intern_type* __frm_end,
0379                 const intern_type*& __frm_nxt,
0380                 extern_type* __to,
0381                 extern_type* __to_end,
0382                 extern_type*& __to_nxt) const override;
0383   result do_in(state_type& __st,
0384                const extern_type* __frm,
0385                const extern_type* __frm_end,
0386                const extern_type*& __frm_nxt,
0387                intern_type* __to,
0388                intern_type* __to_end,
0389                intern_type*& __to_nxt) const override;
0390   result do_unshift(state_type& __st, extern_type* __to, extern_type* __to_end, extern_type*& __to_nxt) const override;
0391   int do_encoding() const _NOEXCEPT override;
0392   bool do_always_noconv() const _NOEXCEPT override;
0393   int do_length(state_type&, const extern_type* __frm, const extern_type* __end, size_t __mx) const override;
0394   int do_max_length() const _NOEXCEPT override;
0395 };
0396 
0397 _LIBCPP_SUPPRESS_DEPRECATED_PUSH
0398 template <>
0399 class _LIBCPP_EXPORTED_FROM_ABI __codecvt_utf16<char32_t, true> : public codecvt<char32_t, char, mbstate_t> {
0400   unsigned long __maxcode_;
0401   codecvt_mode __mode_;
0402 
0403 public:
0404   typedef char32_t intern_type;
0405   typedef char extern_type;
0406   typedef mbstate_t state_type;
0407 
0408   _LIBCPP_HIDE_FROM_ABI explicit __codecvt_utf16(size_t __refs, unsigned long __maxcode, codecvt_mode __mode)
0409       : codecvt<char32_t, char, mbstate_t>(__refs), __maxcode_(__maxcode), __mode_(__mode) {}
0410   _LIBCPP_SUPPRESS_DEPRECATED_POP
0411 
0412 protected:
0413   result do_out(state_type& __st,
0414                 const intern_type* __frm,
0415                 const intern_type* __frm_end,
0416                 const intern_type*& __frm_nxt,
0417                 extern_type* __to,
0418                 extern_type* __to_end,
0419                 extern_type*& __to_nxt) const override;
0420   result do_in(state_type& __st,
0421                const extern_type* __frm,
0422                const extern_type* __frm_end,
0423                const extern_type*& __frm_nxt,
0424                intern_type* __to,
0425                intern_type* __to_end,
0426                intern_type*& __to_nxt) const override;
0427   result do_unshift(state_type& __st, extern_type* __to, extern_type* __to_end, extern_type*& __to_nxt) const override;
0428   int do_encoding() const _NOEXCEPT override;
0429   bool do_always_noconv() const _NOEXCEPT override;
0430   int do_length(state_type&, const extern_type* __frm, const extern_type* __end, size_t __mx) const override;
0431   int do_max_length() const _NOEXCEPT override;
0432 };
0433 
0434 _LIBCPP_SUPPRESS_DEPRECATED_PUSH
0435 template <class _Elem, unsigned long _Maxcode = 0x10ffff, codecvt_mode _Mode = (codecvt_mode)0>
0436 class _LIBCPP_TEMPLATE_VIS
0437 _LIBCPP_DEPRECATED_IN_CXX17 codecvt_utf16 : public __codecvt_utf16<_Elem, _Mode & little_endian> {
0438 public:
0439   _LIBCPP_HIDE_FROM_ABI explicit codecvt_utf16(size_t __refs = 0)
0440       : __codecvt_utf16<_Elem, _Mode & little_endian>(__refs, _Maxcode, _Mode) {}
0441 
0442   _LIBCPP_HIDE_FROM_ABI ~codecvt_utf16() {}
0443 };
0444 _LIBCPP_SUPPRESS_DEPRECATED_POP
0445 
0446 // codecvt_utf8_utf16
0447 
0448 template <class _Elem>
0449 class __codecvt_utf8_utf16;
0450 
0451 #  ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
0452 template <>
0453 class _LIBCPP_EXPORTED_FROM_ABI __codecvt_utf8_utf16<wchar_t> : public codecvt<wchar_t, char, mbstate_t> {
0454   unsigned long __maxcode_;
0455   _LIBCPP_SUPPRESS_DEPRECATED_PUSH
0456   codecvt_mode __mode_;
0457   _LIBCPP_SUPPRESS_DEPRECATED_POP
0458 
0459 public:
0460   typedef wchar_t intern_type;
0461   typedef char extern_type;
0462   typedef mbstate_t state_type;
0463 
0464   _LIBCPP_SUPPRESS_DEPRECATED_PUSH
0465   _LIBCPP_HIDE_FROM_ABI explicit __codecvt_utf8_utf16(size_t __refs, unsigned long __maxcode, codecvt_mode __mode)
0466       : codecvt<wchar_t, char, mbstate_t>(__refs), __maxcode_(__maxcode), __mode_(__mode) {}
0467   _LIBCPP_SUPPRESS_DEPRECATED_POP
0468 
0469 protected:
0470   result do_out(state_type& __st,
0471                 const intern_type* __frm,
0472                 const intern_type* __frm_end,
0473                 const intern_type*& __frm_nxt,
0474                 extern_type* __to,
0475                 extern_type* __to_end,
0476                 extern_type*& __to_nxt) const override;
0477   result do_in(state_type& __st,
0478                const extern_type* __frm,
0479                const extern_type* __frm_end,
0480                const extern_type*& __frm_nxt,
0481                intern_type* __to,
0482                intern_type* __to_end,
0483                intern_type*& __to_nxt) const override;
0484   result do_unshift(state_type& __st, extern_type* __to, extern_type* __to_end, extern_type*& __to_nxt) const override;
0485   int do_encoding() const _NOEXCEPT override;
0486   bool do_always_noconv() const _NOEXCEPT override;
0487   int do_length(state_type&, const extern_type* __frm, const extern_type* __end, size_t __mx) const override;
0488   int do_max_length() const _NOEXCEPT override;
0489 };
0490 #  endif // _LIBCPP_HAS_NO_WIDE_CHARACTERS
0491 
0492 _LIBCPP_SUPPRESS_DEPRECATED_PUSH
0493 template <>
0494 class _LIBCPP_EXPORTED_FROM_ABI __codecvt_utf8_utf16<char32_t> : public codecvt<char32_t, char, mbstate_t> {
0495   unsigned long __maxcode_;
0496   codecvt_mode __mode_;
0497 
0498 public:
0499   typedef char32_t intern_type;
0500   typedef char extern_type;
0501   typedef mbstate_t state_type;
0502 
0503   _LIBCPP_HIDE_FROM_ABI explicit __codecvt_utf8_utf16(size_t __refs, unsigned long __maxcode, codecvt_mode __mode)
0504       : codecvt<char32_t, char, mbstate_t>(__refs), __maxcode_(__maxcode), __mode_(__mode) {}
0505   _LIBCPP_SUPPRESS_DEPRECATED_POP
0506 
0507 protected:
0508   result do_out(state_type& __st,
0509                 const intern_type* __frm,
0510                 const intern_type* __frm_end,
0511                 const intern_type*& __frm_nxt,
0512                 extern_type* __to,
0513                 extern_type* __to_end,
0514                 extern_type*& __to_nxt) const override;
0515   result do_in(state_type& __st,
0516                const extern_type* __frm,
0517                const extern_type* __frm_end,
0518                const extern_type*& __frm_nxt,
0519                intern_type* __to,
0520                intern_type* __to_end,
0521                intern_type*& __to_nxt) const override;
0522   result do_unshift(state_type& __st, extern_type* __to, extern_type* __to_end, extern_type*& __to_nxt) const override;
0523   int do_encoding() const _NOEXCEPT override;
0524   bool do_always_noconv() const _NOEXCEPT override;
0525   int do_length(state_type&, const extern_type* __frm, const extern_type* __end, size_t __mx) const override;
0526   int do_max_length() const _NOEXCEPT override;
0527 };
0528 
0529 _LIBCPP_SUPPRESS_DEPRECATED_PUSH
0530 template <>
0531 class _LIBCPP_EXPORTED_FROM_ABI __codecvt_utf8_utf16<char16_t> : public codecvt<char16_t, char, mbstate_t> {
0532   unsigned long __maxcode_;
0533   codecvt_mode __mode_;
0534 
0535 public:
0536   typedef char16_t intern_type;
0537   typedef char extern_type;
0538   typedef mbstate_t state_type;
0539 
0540   _LIBCPP_HIDE_FROM_ABI explicit __codecvt_utf8_utf16(size_t __refs, unsigned long __maxcode, codecvt_mode __mode)
0541       : codecvt<char16_t, char, mbstate_t>(__refs), __maxcode_(__maxcode), __mode_(__mode) {}
0542   _LIBCPP_SUPPRESS_DEPRECATED_POP
0543 
0544 protected:
0545   result do_out(state_type& __st,
0546                 const intern_type* __frm,
0547                 const intern_type* __frm_end,
0548                 const intern_type*& __frm_nxt,
0549                 extern_type* __to,
0550                 extern_type* __to_end,
0551                 extern_type*& __to_nxt) const override;
0552   result do_in(state_type& __st,
0553                const extern_type* __frm,
0554                const extern_type* __frm_end,
0555                const extern_type*& __frm_nxt,
0556                intern_type* __to,
0557                intern_type* __to_end,
0558                intern_type*& __to_nxt) const override;
0559   result do_unshift(state_type& __st, extern_type* __to, extern_type* __to_end, extern_type*& __to_nxt) const override;
0560   int do_encoding() const _NOEXCEPT override;
0561   bool do_always_noconv() const _NOEXCEPT override;
0562   int do_length(state_type&, const extern_type* __frm, const extern_type* __end, size_t __mx) const override;
0563   int do_max_length() const _NOEXCEPT override;
0564 };
0565 
0566 _LIBCPP_SUPPRESS_DEPRECATED_PUSH
0567 template <class _Elem, unsigned long _Maxcode = 0x10ffff, codecvt_mode _Mode = (codecvt_mode)0>
0568 class _LIBCPP_TEMPLATE_VIS _LIBCPP_DEPRECATED_IN_CXX17 codecvt_utf8_utf16 : public __codecvt_utf8_utf16<_Elem> {
0569 public:
0570   _LIBCPP_HIDE_FROM_ABI explicit codecvt_utf8_utf16(size_t __refs = 0)
0571       : __codecvt_utf8_utf16<_Elem>(__refs, _Maxcode, _Mode) {}
0572 
0573   _LIBCPP_HIDE_FROM_ABI ~codecvt_utf8_utf16() {}
0574 };
0575 _LIBCPP_SUPPRESS_DEPRECATED_POP
0576 
0577 _LIBCPP_END_NAMESPACE_STD
0578 
0579 #endif // _LIBCPP_STD_VER < 26 || defined(_LIBCPP_BUILDING_LIBRARY) || defined(_LIBCPP_ENABLE_CXX26_REMOVED_CODECVT)
0580 
0581 #if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
0582 #  include <__cxx03/atomic>
0583 #  include <__cxx03/concepts>
0584 #  include <__cxx03/cstddef>
0585 #  include <__cxx03/cstdlib>
0586 #  include <__cxx03/cstring>
0587 #  include <__cxx03/initializer_list>
0588 #  include <__cxx03/iosfwd>
0589 #  include <__cxx03/limits>
0590 #  include <__cxx03/mutex>
0591 #  include <__cxx03/new>
0592 #  include <__cxx03/stdexcept>
0593 #  include <__cxx03/type_traits>
0594 #  include <__cxx03/typeinfo>
0595 #endif
0596 
0597 #endif // _LIBCPP___CXX03_CODECVT