40 #pragma GCC system_header
42 namespace std _GLIBCXX_VISIBILITY(default)
44 _GLIBCXX_BEGIN_NAMESPACE_VERSION
68 template<
typename _InternT,
typename _ExternT,
typename _StateT>
74 typedef codecvt_base::result result;
75 typedef _InternT intern_type;
76 typedef _ExternT extern_type;
77 typedef _StateT state_type;
118 const intern_type* __from_end,
const intern_type*& __from_next,
119 extern_type* __to, extern_type* __to_end,
120 extern_type*& __to_next)
const
122 return this->
do_out(__state, __from, __from_end, __from_next,
123 __to, __to_end, __to_next);
157 extern_type*& __to_next)
const
158 {
return this->do_unshift(__state, __to,__to_end,__to_next); }
198 const extern_type* __from_end,
const extern_type*& __from_next,
199 intern_type* __to, intern_type* __to_end,
200 intern_type*& __to_next)
const
202 return this->do_in(__state, __from, __from_end, __from_next,
203 __to, __to_end, __to_next);
207 encoding()
const throw()
208 {
return this->do_encoding(); }
211 always_noconv()
const throw()
212 {
return this->do_always_noconv(); }
215 length(state_type& __state,
const extern_type* __from,
216 const extern_type* __end,
size_t __max)
const
217 {
return this->do_length(__state, __from, __end, __max); }
220 max_length()
const throw()
221 {
return this->do_max_length(); }
225 __codecvt_abstract_base(
size_t __refs = 0) : locale::
facet(__refs) { }
228 ~__codecvt_abstract_base() { }
238 do_out(state_type& __state,
const intern_type* __from,
239 const intern_type* __from_end,
const intern_type*& __from_next,
240 extern_type* __to, extern_type* __to_end,
241 extern_type*& __to_next)
const = 0;
244 do_unshift(state_type& __state, extern_type* __to,
245 extern_type* __to_end, extern_type*& __to_next)
const = 0;
248 do_in(state_type& __state,
const extern_type* __from,
249 const extern_type* __from_end,
const extern_type*& __from_next,
250 intern_type* __to, intern_type* __to_end,
251 intern_type*& __to_next)
const = 0;
254 do_encoding()
const throw() = 0;
257 do_always_noconv() const throw() = 0;
260 do_length(state_type&, const extern_type* __from,
261 const extern_type* __end,
size_t __max) const = 0;
264 do_max_length() const throw() = 0;
276 template<typename _InternT, typename _ExternT, typename _StateT>
282 typedef codecvt_base::result result;
283 typedef _InternT intern_type;
284 typedef _ExternT extern_type;
285 typedef _StateT state_type;
288 __c_locale _M_c_locale_codecvt;
298 codecvt(__c_locale __cloc,
size_t __refs = 0);
305 do_out(state_type& __state,
const intern_type* __from,
306 const intern_type* __from_end,
const intern_type*& __from_next,
307 extern_type* __to, extern_type* __to_end,
308 extern_type*& __to_next)
const;
311 do_unshift(state_type& __state, extern_type* __to,
312 extern_type* __to_end, extern_type*& __to_next)
const;
315 do_in(state_type& __state,
const extern_type* __from,
316 const extern_type* __from_end,
const extern_type*& __from_next,
317 intern_type* __to, intern_type* __to_end,
318 intern_type*& __to_next)
const;
321 do_encoding()
const throw();
324 do_always_noconv()
const throw();
327 do_length(state_type&,
const extern_type* __from,
328 const extern_type* __end,
size_t __max)
const;
331 do_max_length()
const throw();
334 template<
typename _InternT,
typename _ExternT,
typename _StateT>
344 typedef char intern_type;
345 typedef char extern_type;
346 typedef mbstate_t state_type;
349 __c_locale _M_c_locale_codecvt;
358 codecvt(__c_locale __cloc,
size_t __refs = 0);
365 do_out(state_type& __state,
const intern_type* __from,
366 const intern_type* __from_end,
const intern_type*& __from_next,
367 extern_type* __to, extern_type* __to_end,
368 extern_type*& __to_next)
const;
371 do_unshift(state_type& __state, extern_type* __to,
372 extern_type* __to_end, extern_type*& __to_next)
const;
375 do_in(state_type& __state,
const extern_type* __from,
376 const extern_type* __from_end,
const extern_type*& __from_next,
377 intern_type* __to, intern_type* __to_end,
378 intern_type*& __to_next)
const;
381 do_encoding()
const throw();
384 do_always_noconv()
const throw();
387 do_length(state_type&,
const extern_type* __from,
388 const extern_type* __end,
size_t __max)
const;
391 do_max_length()
const throw();
394 #ifdef _GLIBCXX_USE_WCHAR_T
402 typedef wchar_t intern_type;
403 typedef char extern_type;
404 typedef mbstate_t state_type;
407 __c_locale _M_c_locale_codecvt;
416 codecvt(__c_locale __cloc,
size_t __refs = 0);
423 do_out(state_type& __state,
const intern_type* __from,
424 const intern_type* __from_end,
const intern_type*& __from_next,
425 extern_type* __to, extern_type* __to_end,
426 extern_type*& __to_next)
const;
429 do_unshift(state_type& __state,
430 extern_type* __to, extern_type* __to_end,
431 extern_type*& __to_next)
const;
434 do_in(state_type& __state,
435 const extern_type* __from,
const extern_type* __from_end,
436 const extern_type*& __from_next,
437 intern_type* __to, intern_type* __to_end,
438 intern_type*& __to_next)
const;
441 int do_encoding()
const throw();
444 bool do_always_noconv()
const throw();
447 int do_length(state_type&,
const extern_type* __from,
448 const extern_type* __end,
size_t __max)
const;
451 do_max_length()
const throw();
453 #endif //_GLIBCXX_USE_WCHAR_T
456 template<
typename _InternT,
typename _ExternT,
typename _StateT>
464 if (__builtin_strcmp(__s,
"C") != 0
465 && __builtin_strcmp(__s,
"POSIX") != 0)
467 this->_S_destroy_c_locale(this->_M_c_locale_codecvt);
468 this->_S_create_c_locale(this->_M_c_locale_codecvt, __s);
479 #if _GLIBCXX_EXTERN_TEMPLATE
484 use_facet<codecvt<char, char, mbstate_t> >(
const locale&);
488 has_facet<codecvt<char, char, mbstate_t> >(
const locale&);
490 #ifdef _GLIBCXX_USE_WCHAR_T
495 use_facet<codecvt<wchar_t, char, mbstate_t> >(
const locale&);
499 has_facet<codecvt<wchar_t, char, mbstate_t> >(
const locale&);
503 _GLIBCXX_END_NAMESPACE_VERSION
Localization functionality base class.The facet class is the base class for a localization feature...
Extension to use iconv for dealing with character encodings.
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.
virtual result do_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 =0
Convert from internal to external character set.
class codecvt<char, char, mbstate_t> specialization.
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.
class codecvt_byname [22.2.1.6].
Container class for localization functionality.The locale class is first a class wrapper for C librar...
result unshift(state_type &__state, extern_type *__to, extern_type *__to_end, extern_type *&__to_next) const
Reset conversion state.
Empty base class for codecvt facet [22.2.1.5].
Primary class template codecvt.NB: Generic, mostly useless implementation.
Facet ID class.The ID class provides facets with an index used to identify them. Every facet class mu...
Common base for codecvt functions.
facet(size_t __refs=0)
Facet constructor.
class codecvt<wchar_t, char, mbstate_t> specialization.