00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
#include <locale>
00031
00032
namespace std
00033 {
00034
00035 locale::id codecvt<char, char, mbstate_t>::id;
00036
00037
#ifdef _GLIBCXX_USE_WCHAR_T
00038
locale::id codecvt<wchar_t, char, mbstate_t>::id;
00039
#endif
00040
00041
#ifdef _GLIBCXX_USE___ENC_TRAITS
00042
00043
const int __enc_traits::_S_max_size;
00044
#endif
00045
00046 codecvt<char, char, mbstate_t>::
00047 codecvt(size_t __refs)
00048 : __codecvt_abstract_base<char, char, mbstate_t>(__refs),
00049 _M_c_locale_codecvt(_S_get_c_locale())
00050 { }
00051
00052 codecvt<char, char, mbstate_t>::
00053 codecvt(__c_locale __cloc, size_t __refs)
00054 : __codecvt_abstract_base<char, char, mbstate_t>(__refs),
00055 _M_c_locale_codecvt(_S_clone_c_locale(__cloc))
00056 { }
00057
00058 codecvt<char, char, mbstate_t>::
00059 ~codecvt()
00060 { _S_destroy_c_locale(_M_c_locale_codecvt); }
00061
00062 codecvt_base::result
00063 codecvt<char, char, mbstate_t>::
00064 do_out(state_type&,
const intern_type* __from,
00065
const intern_type*,
const intern_type*& __from_next,
00066 extern_type* __to, extern_type*,
00067 extern_type*& __to_next)
const
00068
{
00069
00070
00071
00072 __from_next = __from;
00073 __to_next = __to;
00074
return noconv;
00075 }
00076
00077 codecvt_base::result
00078 codecvt<char, char, mbstate_t>::
00079 do_unshift(state_type&, extern_type* __to,
00080 extern_type*, extern_type*& __to_next)
const
00081
{
00082 __to_next = __to;
00083
return noconv;
00084 }
00085
00086 codecvt_base::result
00087 codecvt<char, char, mbstate_t>::
00088 do_in(state_type&,
const extern_type* __from,
00089
const extern_type*,
const extern_type*& __from_next,
00090 intern_type* __to, intern_type*, intern_type*& __to_next)
const
00091
{
00092
00093
00094
00095 __from_next = __from;
00096 __to_next = __to;
00097
return noconv;
00098 }
00099
00100
int
00101 codecvt<char, char, mbstate_t>::
00102 do_encoding() const throw()
00103 {
return 1; }
00104
00105
bool
00106 codecvt<char, char, mbstate_t>::
00107 do_always_noconv() const throw()
00108 {
return true; }
00109
00110
int
00111 codecvt<char, char, mbstate_t>::
00112 do_length (state_type&,
const extern_type* __from,
00113
const extern_type* __end, size_t __max)
const
00114
{
00115 size_t __d = static_cast<size_t>(__end - __from);
00116
return std::min(__max, __d);
00117 }
00118
00119
int
00120 codecvt<char, char, mbstate_t>::
00121 do_max_length() const throw()
00122 {
return 1; }
00123
00124
#ifdef _GLIBCXX_USE_WCHAR_T
00125
00126 codecvt<wchar_t, char, mbstate_t>::
00127 codecvt(size_t __refs)
00128 : __codecvt_abstract_base<wchar_t, char, mbstate_t>(__refs),
00129 _M_c_locale_codecvt(_S_get_c_locale())
00130 { }
00131
00132 codecvt<wchar_t, char, mbstate_t>::
00133 codecvt(__c_locale __cloc, size_t __refs)
00134 : __codecvt_abstract_base<wchar_t, char, mbstate_t>(__refs),
00135 _M_c_locale_codecvt(_S_clone_c_locale(__cloc))
00136 { }
00137
00138 codecvt<wchar_t, char, mbstate_t>::
00139 ~codecvt()
00140 { _S_destroy_c_locale(_M_c_locale_codecvt); }
00141
00142 codecvt_base::result
00143 codecvt<wchar_t, char, mbstate_t>::
00144 do_unshift(state_type&, extern_type* __to,
00145 extern_type*, extern_type*& __to_next)
const
00146
{
00147
00148 __to_next = __to;
00149
return noconv;
00150 }
00151
00152
bool
00153 codecvt<wchar_t, char, mbstate_t>::
00154 do_always_noconv() const throw()
00155 {
return false; }
00156
#endif // _GLIBCXX_USE_WCHAR_T
00157
}