diff options
author | bkoz <bkoz@138bc75d-0d04-0410-961f-82ee72b054a4> | 2003-05-13 20:13:15 +0000 |
---|---|---|
committer | bkoz <bkoz@138bc75d-0d04-0410-961f-82ee72b054a4> | 2003-05-13 20:13:15 +0000 |
commit | e99fa449303a4d5d88c8f8b69efd2d914e200b34 (patch) | |
tree | a60c45a328c27b7215a6c1c1c6b74c81468147ef /libstdc++-v3/include/bits/ostream.tcc | |
parent | 23364f5f5d1d269375d0651b0b04862710ed87b7 (diff) | |
download | ppe42-gcc-e99fa449303a4d5d88c8f8b69efd2d914e200b34.tar.gz ppe42-gcc-e99fa449303a4d5d88c8f8b69efd2d914e200b34.zip |
2003-05-12 Benjamin Kosnik <bkoz@redhat.com>
* include/std/std_fstream.h (basic_filebuf::_M_codecvt): Add
cached member.
* include/bits/fstream.tcc (basic_filebuf::basic_filebuf):
Initialize _M_codecvt.
(basic_filebuf::imbue): Same.
(basic_filebuf::showmanyc): Use it.
(basic_filebuf::underflow): Use it.
(basic_filebuf::_M_convert_to_external): Use it.
(basic_filebuf::seekoff): Use it.
(basic_filebuf::imbue): Use it, tweaks.
* include/bits/localefwd.h (__check_facet): New.
* include/bits/locale_classes.h: Tweaks.
* include/bits/locale_facets.tcc: Tweaks.
* include/bits/basic_ios.h (basic_ios::_M_check_facet): Remove.
_M_fctype to _M_ctype, _M_fnumput to _M_num_put, _M_fnumget to
_M_num_get. Change _M_check_facet to __check_facet. Tweaks.
* include/bits/basic_ios.tcc: Same.
* include/bits/istream.tcc: Same.
* include/bits/ostream.tcc: Same.
* include/std/std_streambuf.h: Same.
* testsuite/27_io/basic_filebuf/imbue/char/2.cc: New.
* testsuite/27_io/basic_filebuf/imbue/char/3.cc: New.
* testsuite/27_io/basic_filebuf/imbue/wchar_t/1.cc: New.
* testsuite/27_io/basic_filebuf/imbue/wchar_t/2.cc: New.
* testsuite/27_io/basic_filebuf/imbue/wchar_t/3.cc: New.
* testsuite/27_io/basic_filebuf/imbue/wchar_t/9322.cc: New.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@66781 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libstdc++-v3/include/bits/ostream.tcc')
-rw-r--r-- | libstdc++-v3/include/bits/ostream.tcc | 94 |
1 files changed, 43 insertions, 51 deletions
diff --git a/libstdc++-v3/include/bits/ostream.tcc b/libstdc++-v3/include/bits/ostream.tcc index fc7d08a1b6e..620458806a1 100644 --- a/libstdc++-v3/include/bits/ostream.tcc +++ b/libstdc++-v3/include/bits/ostream.tcc @@ -157,10 +157,10 @@ namespace std { try { - if (_M_check_facet(this->_M_fnumput)) - if (this->_M_fnumput->put(*this, *this, - this->fill(), __n).failed()) - this->setstate(ios_base::badbit); + __check_facet(this->_M_num_put); + if (this->_M_num_put->put(*this, *this, this->fill(), + __n).failed()) + this->setstate(ios_base::badbit); } catch(...) { @@ -183,23 +183,19 @@ namespace std { try { + bool __b = false; char_type __c = this->fill(); ios_base::fmtflags __fmt = this->flags() & ios_base::basefield; - if (_M_check_facet(this->_M_fnumput)) + __check_facet(this->_M_num_put); + if ((__fmt & ios_base::oct) || (__fmt & ios_base::hex)) { - bool __b = false; - if ((__fmt & ios_base::oct) || (__fmt & ios_base::hex)) - { - unsigned long __l = static_cast<unsigned long>(__n); - __b = this->_M_fnumput->put(*this, *this, - __c, __l).failed(); - } - else - __b = this->_M_fnumput->put(*this, *this, - __c, __n).failed(); - if (__b) - this->setstate(ios_base::badbit); + unsigned long __l = static_cast<unsigned long>(__n); + __b = this->_M_num_put->put(*this, *this, __c, __l).failed(); } + else + __b = this->_M_num_put->put(*this, *this, __c, __n).failed(); + if (__b) + this->setstate(ios_base::badbit); } catch(...) { @@ -222,10 +218,10 @@ namespace std { try { - if (_M_check_facet(this->_M_fnumput)) - if (this->_M_fnumput->put(*this, *this, - this->fill(), __n).failed()) - this->setstate(ios_base::badbit); + __check_facet(this->_M_num_put); + if (this->_M_num_put->put(*this, *this, this->fill(), + __n).failed()) + this->setstate(ios_base::badbit); } catch(...) { @@ -249,24 +245,20 @@ namespace std { try { + bool __b = false; char_type __c = this->fill(); ios_base::fmtflags __fmt = this->flags() & ios_base::basefield; - if (_M_check_facet(this->_M_fnumput)) + __check_facet(this->_M_num_put); + if ((__fmt & ios_base::oct) || (__fmt & ios_base::hex)) { - bool __b = false; - if ((__fmt & ios_base::oct) || (__fmt & ios_base::hex)) - { - unsigned long long __l; - __l = static_cast<unsigned long long>(__n); - __b = this->_M_fnumput->put(*this, *this, - __c, __l).failed(); - } - else - __b = this->_M_fnumput->put(*this, *this, - __c, __n).failed(); - if (__b) - this->setstate(ios_base::badbit); + unsigned long long __l; + __l = static_cast<unsigned long long>(__n); + __b = this->_M_num_put->put(*this, *this, __c, __l).failed(); } + else + __b = this->_M_num_put->put(*this, *this, __c, __n).failed(); + if (__b) + this->setstate(ios_base::badbit); } catch(...) { @@ -289,10 +281,10 @@ namespace std { try { - if (_M_check_facet(this->_M_fnumput)) - if (this->_M_fnumput->put(*this, *this, - this->fill(), __n).failed()) - this->setstate(ios_base::badbit); + __check_facet(this->_M_num_put); + if (this->_M_num_put->put(*this, *this, this->fill(), + __n).failed()) + this->setstate(ios_base::badbit); } catch(...) { @@ -316,10 +308,10 @@ namespace std { try { - if (_M_check_facet(this->_M_fnumput)) - if (this->_M_fnumput->put(*this, *this, - this->fill(), __n).failed()) - this->setstate(ios_base::badbit); + __check_facet(this->_M_num_put); + if (this->_M_num_put->put(*this, *this, this->fill(), + __n).failed()) + this->setstate(ios_base::badbit); } catch(...) { @@ -342,10 +334,10 @@ namespace std { try { - if (_M_check_facet(this->_M_fnumput)) - if (this->_M_fnumput->put(*this, *this, - this->fill(), __n).failed()) - this->setstate(ios_base::badbit); + __check_facet(this->_M_num_put); + if (this->_M_num_put->put(*this, *this, this->fill(), + __n).failed()) + this->setstate(ios_base::badbit); } catch(...) { @@ -368,10 +360,10 @@ namespace std { try { - if (_M_check_facet(this->_M_fnumput)) - if (this->_M_fnumput->put(*this, *this, - this->fill(), __n).failed()) - this->setstate(ios_base::badbit); + __check_facet(this->_M_num_put); + if (this->_M_num_put->put(*this, *this, this->fill(), + __n).failed()) + this->setstate(ios_base::badbit); } catch(...) { |