40 #pragma GCC system_header
42 _GLIBCXX_BEGIN_NAMESPACE(std)
66 template<
typename _InternT,
typename _ExternT,
typename _StateT>
72 typedef codecvt_base::result result;
73 typedef _InternT intern_type;
74 typedef _ExternT extern_type;
75 typedef _StateT state_type;
116 const intern_type* __from_end,
const intern_type*& __from_next,
117 extern_type* __to, extern_type* __to_end,
118 extern_type*& __to_next)
const
120 return this->do_out(__state, __from, __from_end, __from_next,
121 __to, __to_end, __to_next);
155 extern_type*& __to_next)
const
156 {
return this->do_unshift(__state, __to,__to_end,__to_next); }
196 const extern_type* __from_end,
const extern_type*& __from_next,
197 intern_type* __to, intern_type* __to_end,
198 intern_type*& __to_next)
const
200 return this->do_in(__state, __from, __from_end, __from_next,
201 __to, __to_end, __to_next);
205 encoding()
const throw()
206 {
return this->do_encoding(); }
209 always_noconv()
const throw()
210 {
return this->do_always_noconv(); }
213 length(state_type& __state,
const extern_type* __from,
214 const extern_type* __end,
size_t __max)
const
215 {
return this->do_length(__state, __from, __end, __max); }
218 max_length()
const throw()
219 {
return this->do_max_length(); }
223 __codecvt_abstract_base(
size_t __refs = 0) : locale::facet(__refs) { }
226 ~__codecvt_abstract_base() { }
236 do_out(state_type& __state,
const intern_type* __from,
237 const intern_type* __from_end,
const intern_type*& __from_next,
238 extern_type* __to, extern_type* __to_end,
239 extern_type*& __to_next)
const = 0;
242 do_unshift(state_type& __state, extern_type* __to,
243 extern_type* __to_end, extern_type*& __to_next)
const = 0;
246 do_in(state_type& __state,
const extern_type* __from,
247 const extern_type* __from_end,
const extern_type*& __from_next,
248 intern_type* __to, intern_type* __to_end,
249 intern_type*& __to_next)
const = 0;
252 do_encoding()
const throw() = 0;
255 do_always_noconv() const throw() = 0;
258 do_length(state_type&, const extern_type* __from,
259 const extern_type* __end,
size_t __max) const = 0;
262 do_max_length() const throw() = 0;
267 template<typename _InternT, typename _ExternT, typename _StateT>
273 typedef codecvt_base::result result;
274 typedef _InternT intern_type;
275 typedef _ExternT extern_type;
276 typedef _StateT state_type;
279 __c_locale _M_c_locale_codecvt;
289 codecvt(__c_locale __cloc,
size_t __refs = 0);
296 do_out(state_type& __state,
const intern_type* __from,
297 const intern_type* __from_end,
const intern_type*& __from_next,
298 extern_type* __to, extern_type* __to_end,
299 extern_type*& __to_next)
const;
302 do_unshift(state_type& __state, extern_type* __to,
303 extern_type* __to_end, extern_type*& __to_next)
const;
306 do_in(state_type& __state,
const extern_type* __from,
307 const extern_type* __from_end,
const extern_type*& __from_next,
308 intern_type* __to, intern_type* __to_end,
309 intern_type*& __to_next)
const;
312 do_encoding()
const throw();
315 do_always_noconv()
const throw();
318 do_length(state_type&,
const extern_type* __from,
319 const extern_type* __end,
size_t __max)
const;
322 do_max_length()
const throw();
325 template<
typename _InternT,
typename _ExternT,
typename _StateT>
335 typedef char intern_type;
336 typedef char extern_type;
337 typedef mbstate_t state_type;
340 __c_locale _M_c_locale_codecvt;
349 codecvt(__c_locale __cloc,
size_t __refs = 0);
356 do_out(state_type& __state,
const intern_type* __from,
357 const intern_type* __from_end,
const intern_type*& __from_next,
358 extern_type* __to, extern_type* __to_end,
359 extern_type*& __to_next)
const;
362 do_unshift(state_type& __state, extern_type* __to,
363 extern_type* __to_end, extern_type*& __to_next)
const;
366 do_in(state_type& __state,
const extern_type* __from,
367 const extern_type* __from_end,
const extern_type*& __from_next,
368 intern_type* __to, intern_type* __to_end,
369 intern_type*& __to_next)
const;
372 do_encoding()
const throw();
375 do_always_noconv()
const throw();
378 do_length(state_type&,
const extern_type* __from,
379 const extern_type* __end,
size_t __max)
const;
382 do_max_length()
const throw();
385 #ifdef _GLIBCXX_USE_WCHAR_T
393 typedef wchar_t intern_type;
394 typedef char extern_type;
395 typedef mbstate_t state_type;
398 __c_locale _M_c_locale_codecvt;
407 codecvt(__c_locale __cloc,
size_t __refs = 0);
414 do_out(state_type& __state,
const intern_type* __from,
415 const intern_type* __from_end,
const intern_type*& __from_next,
416 extern_type* __to, extern_type* __to_end,
417 extern_type*& __to_next)
const;
420 do_unshift(state_type& __state,
421 extern_type* __to, extern_type* __to_end,
422 extern_type*& __to_next)
const;
425 do_in(state_type& __state,
426 const extern_type* __from,
const extern_type* __from_end,
427 const extern_type*& __from_next,
428 intern_type* __to, intern_type* __to_end,
429 intern_type*& __to_next)
const;
432 int do_encoding()
const throw();
435 bool do_always_noconv()
const throw();
438 int do_length(state_type&,
const extern_type* __from,
439 const extern_type* __end,
size_t __max)
const;
442 do_max_length()
const throw();
444 #endif //_GLIBCXX_USE_WCHAR_T
447 template<
typename _InternT,
typename _ExternT,
typename _StateT>
455 if (__builtin_strcmp(__s,
"C") != 0
456 && __builtin_strcmp(__s,
"POSIX") != 0)
458 this->_S_destroy_c_locale(this->_M_c_locale_codecvt);
459 this->_S_create_c_locale(this->_M_c_locale_codecvt, __s);
471 #if _GLIBCXX_EXTERN_TEMPLATE
476 use_facet<codecvt<char, char, mbstate_t> >(
const locale&);
480 has_facet<codecvt<char, char, mbstate_t> >(
const locale&);
482 #ifdef _GLIBCXX_USE_WCHAR_T
487 use_facet<codecvt<wchar_t, char, mbstate_t> >(
const locale&);
491 has_facet<codecvt<wchar_t, char, mbstate_t> >(
const locale&);
495 _GLIBCXX_END_NAMESPACE
result out(state_type &__state, const intern_type *__from, const intern_type *__from_end, const intern_type *&__from_next, extern_type *__to, extern_type *__to_end, extern_type *&__to_next) const
Convert from internal to external character set.
result unshift(state_type &__state, extern_type *__to, extern_type *__to_end, extern_type *&__to_next) const
Reset conversion state.
Extension to use iconv for dealing with character encodings.
class codecvt<char, char, mbstate_t> specialization.
class codecvt_byname [22.2.1.6].
Localization functionality base class.
result in(state_type &__state, const extern_type *__from, const extern_type *__from_end, const extern_type *&__from_next, intern_type *__to, intern_type *__to_end, intern_type *&__to_next) const
Convert from external to internal character set.
Empty base class for codecvt facet [22.2.1.5].
Container class for localization functionality.
class codecvt [22.2.1.5]. NB: Generic, mostly useless implementation.
class codecvt<wchar_t, char, mbstate_t> specialization.
Common base for codecvt functions.