summaryrefslogtreecommitdiff
path: root/libstdc++-v3/include
diff options
context:
space:
mode:
authorPaolo Carlini <pcarlini@unitus.it>2002-09-10 21:35:04 +0200
committerPaolo Carlini <paolo@gcc.gnu.org>2002-09-10 19:35:04 +0000
commitc6b5df5351eb21818563818b5c3941ae5b6bc5ab (patch)
tree0ac78e1529f2e352158b6477d3d7a1b652a84244 /libstdc++-v3/include
parent33b679d10a7186845cba6c783c85a7fb841aeac9 (diff)
downloadgcc-c6b5df5351eb21818563818b5c3941ae5b6bc5ab.tar.gz
codecvt.h (class __codecvt_abstract_base): Add __c_locale type _M_c_locale_codecvt member.
2002-09-10 Paolo Carlini <pcarlini@unitus.it> * include/bits/codecvt.h (class __codecvt_abstract_base): Add __c_locale type _M_c_locale_codecvt member. (class codecvt<char, char, mbstate_t>, class codecvt<wchar_t, char, mbstate_t>): Add new codecvt(__c_locale, size_t) constructor. (codecvt_byname::codecvt_byname): Update. * src/codecvt.cc (class codecvt<char, char, mbstate_t>, class codecvt<wchar_t, char, mbstate_t>): Update codecvt(size_t) constructor and ~codecvt() destructor; define codecvt(__c_locale, size_t) constructor. (codecvt::do_out): Switch to _M_c_locale_codecvt around wcsrtombs call. (codecvt::do_in): Ditto for mbsrtowcs call. * src/localename.cc (locale::_Impl::_Impl(const char*, size_t)): Tweak construction of codecvt facets. From-SVN: r57011
Diffstat (limited to 'libstdc++-v3/include')
-rw-r--r--libstdc++-v3/include/bits/codecvt.h24
1 files changed, 21 insertions, 3 deletions
diff --git a/libstdc++-v3/include/bits/codecvt.h b/libstdc++-v3/include/bits/codecvt.h
index 506752f3432..3a3f6044e5f 100644
--- a/libstdc++-v3/include/bits/codecvt.h
+++ b/libstdc++-v3/include/bits/codecvt.h
@@ -70,7 +70,11 @@
typedef _InternT intern_type;
typedef _ExternT extern_type;
typedef _StateT state_type;
-
+
+ protected:
+ __c_locale _M_c_locale_codecvt;
+
+ public:
// 22.2.1.5.1 codecvt members
result
out(state_type& __state, const intern_type* __from,
@@ -225,6 +229,10 @@
explicit
codecvt(size_t __refs = 0);
+ // Non-standard.
+ explicit
+ codecvt(__c_locale __cloc, size_t __refs = 0);
+
protected:
virtual
~codecvt();
@@ -277,6 +285,10 @@
explicit
codecvt(size_t __refs = 0);
+ // Non-standard.
+ explicit
+ codecvt(__c_locale __cloc, size_t __refs = 0);
+
protected:
virtual
~codecvt();
@@ -320,8 +332,14 @@
{
public:
explicit
- codecvt_byname(const char*, size_t __refs = 0)
- : codecvt<_InternT, _ExternT, _StateT>(__refs) { }
+ codecvt_byname(const char* __s, size_t __refs = 0)
+ : codecvt<_InternT, _ExternT, _StateT>(__refs)
+ {
+ if (_M_c_locale_codecvt != _S_c_locale)
+ _S_destroy_c_locale(_M_c_locale_codecvt);
+ _S_create_c_locale(_M_c_locale_codecvt, __s);
+ }
+
protected:
virtual
~codecvt_byname() { }