aboutsummaryrefslogtreecommitdiff
path: root/libstdc++-v3/src/codecvt.cc
diff options
context:
space:
mode:
authorBenjamin Kosnik <bkoz@redhat.com>2002-09-11 03:36:45 +0000
committerBenjamin Kosnik <bkoz@gcc.gnu.org>2002-09-11 03:36:45 +0000
commit38cca750247cbf7c5e232a33c51862f42134bc0e (patch)
tree0cc303d444522ccf2cadf35bc145e45809eb961a /libstdc++-v3/src/codecvt.cc
parent77de9af25184a81db2a552455bb811a961c71b6d (diff)
downloadgcc-38cca750247cbf7c5e232a33c51862f42134bc0e.zip
gcc-38cca750247cbf7c5e232a33c51862f42134bc0e.tar.gz
gcc-38cca750247cbf7c5e232a33c51862f42134bc0e.tar.bz2
Makefile.am (sources): Edit.
2002-09-10 Benjamin Kosnik <bkoz@redhat.com> * src/Makefile.am (sources): Edit. (target_sources): New. (target_sources_extra): New. * src/Makefile.in: Regenerate. * acinclude.m4: Set CCODECVT_CC. * aclocal.m4: Regenerate. * configure: Regenerate. * src/locale.cc: Move ctype definitions... * src/ctype.cc: ...here. New file. * src/locale.cc: Move codecvt definitions... * src/codecvt.cc: ...here. * config/generic/codecvt_members.cc: ...and here. * config/gnu/codecvt_members.cc: ...and here. * include/bits/codecvt.h: Tweak. * include/bits/locale_facets: Tweak. * src/bitset.cc: Correct license text. * src/concept-inst.cc: Same. * src/strstream.cc: Same. * src/vterminate.cc: Same. From-SVN: r57020
Diffstat (limited to 'libstdc++-v3/src/codecvt.cc')
-rw-r--r--libstdc++-v3/src/codecvt.cc77
1 files changed, 7 insertions, 70 deletions
diff --git a/libstdc++-v3/src/codecvt.cc b/libstdc++-v3/src/codecvt.cc
index dcce705..8d4c1b4 100644
--- a/libstdc++-v3/src/codecvt.cc
+++ b/libstdc++-v3/src/codecvt.cc
@@ -31,6 +31,13 @@
namespace std
{
+ // Definitions for locale::id of standard facets that are specialized.
+ locale::id codecvt<char, char, mbstate_t>::id;
+
+#ifdef _GLIBCPP_USE_WCHAR_T
+ locale::id codecvt<wchar_t, char, mbstate_t>::id;
+#endif
+
#ifdef _GLIBCPP_USE___ENC_TRAITS
// Definitions for static const data members of __enc_traits.
const int __enc_traits::_S_max_size;
@@ -132,41 +139,6 @@ namespace std
codecvt_base::result
codecvt<wchar_t, char, mbstate_t>::
- 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
- {
- result __ret = error;
- size_t __len = min(__from_end - __from, __to_end - __to);
-#if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 2)
- __c_locale __old = __uselocale(_M_c_locale_codecvt);
-#endif
- size_t __conv = wcsrtombs(__to, &__from, __len, &__state);
-#if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 2)
- __uselocale(__old);
-#endif
-
- if (__conv == __len)
- {
- __from_next = __from;
- __to_next = __to + __conv;
- __ret = ok;
- }
- else if (__conv > 0 && __conv < __len)
- {
- __from_next = __from;
- __to_next = __to + __conv;
- __ret = partial;
- }
- else
- __ret = error;
-
- return __ret;
- }
-
- codecvt_base::result
- codecvt<wchar_t, char, mbstate_t>::
do_unshift(state_type&, extern_type* __to,
extern_type*, extern_type*& __to_next) const
{
@@ -174,41 +146,6 @@ namespace std
return noconv;
}
- codecvt_base::result
- codecvt<wchar_t, char, mbstate_t>::
- do_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
- {
- result __ret = error;
- size_t __len = min(__from_end - __from, __to_end - __to);
-#if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 2)
- __c_locale __old = __uselocale(_M_c_locale_codecvt);
-#endif
- size_t __conv = mbsrtowcs(__to, &__from, __len, &__state);
-#if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 2)
- __uselocale(__old);
-#endif
-
- if (__conv == __len)
- {
- __from_next = __from;
- __to_next = __to + __conv;
- __ret = ok;
- }
- else if (__conv > 0 && __conv < __len)
- {
- __from_next = __from;
- __to_next = __to + __conv;
- __ret = partial;
- }
- else
- __ret = error;
-
- return __ret;
- }
-
int
codecvt<wchar_t, char, mbstate_t>::
do_encoding() const throw()