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 #ifndef _CPP_BITS_BASICIOS_TCC
00031 #define _CPP_BITS_BASICIOS_TCC 1
00032
00033 namespace std {
00034
00035 template<typename _CharT, typename _Traits>
00036 basic_streambuf<_CharT, _Traits>*
00037 basic_ios<_CharT, _Traits>::rdbuf(basic_streambuf<_CharT, _Traits>* __sb)
00038 {
00039 basic_streambuf<_CharT, _Traits>* __old = _M_streambuf;
00040 _M_streambuf = __sb;
00041 this->clear();
00042 return __old;
00043 }
00044
00045 template<typename _CharT, typename _Traits>
00046 basic_ios<_CharT, _Traits>&
00047 basic_ios<_CharT, _Traits>::copyfmt(const basic_ios& __rhs)
00048 {
00049
00050
00051
00052
00053 _Words* __words = (__rhs._M_word_limit <= _S_local_words) ?
00054 _M_word_array : new _Words[__rhs._M_word_limit];
00055
00056
00057
00058
00059
00060
00061
00062
00063 _Callback_list* __cb = __rhs._M_callbacks;
00064 if (__cb)
00065 __cb->_M_add_reference();
00066 _M_call_callbacks(erase_event);
00067 if (_M_words != _M_word_array)
00068 delete [] _M_words;
00069 _M_dispose_callbacks();
00070
00071 _M_callbacks = __cb;
00072 for (int __i = 0; __i < __rhs._M_word_limit; ++__i)
00073 __words[__i] = __rhs._M_words[__i];
00074 if (_M_words != _M_word_array)
00075 delete [] _M_words;
00076 _M_words = __words;
00077 _M_word_limit = __rhs._M_word_limit;
00078
00079 this->flags(__rhs.flags());
00080 this->width(__rhs.width());
00081 this->precision(__rhs.precision());
00082 this->tie(__rhs.tie());
00083 this->fill(__rhs.fill());
00084
00085 this->exceptions(__rhs.exceptions());
00086
00087 _M_call_callbacks(copyfmt_event);
00088 return *this;
00089 }
00090
00091 template<typename _CharT, typename _Traits>
00092 char
00093 basic_ios<_CharT, _Traits>::narrow(char_type __c, char __dfault) const
00094 { return _M_ios_fctype->narrow(__c, __dfault); }
00095
00096 template<typename _CharT, typename _Traits>
00097 _CharT
00098 basic_ios<_CharT, _Traits>::widen(char __c) const
00099 { return _M_ios_fctype->widen(__c); }
00100
00101
00102 template<typename _CharT, typename _Traits>
00103 locale
00104 basic_ios<_CharT, _Traits>::imbue(const locale& __loc)
00105 {
00106 locale __old(this->getloc());
00107 ios_base::imbue(__loc);
00108 _M_ios_fctype = &use_facet<__ctype_type>(__loc);
00109 _M_fnumput = &use_facet<__numput_type>(__loc);
00110 _M_fnumget = &use_facet<__numget_type>(__loc);
00111 if (this->rdbuf() != 0)
00112 this->rdbuf()->pubimbue(__loc);
00113 return __old;
00114 }
00115
00116 template<typename _CharT, typename _Traits>
00117 void
00118 basic_ios<_CharT, _Traits>::init(basic_streambuf<_CharT, _Traits>* __sb)
00119 {
00120
00121 ios_base::_M_init();
00122 _M_ios_fctype = &use_facet<__ctype_type>(_M_ios_locale);
00123
00124 _M_fnumput = &use_facet<__numput_type>(_M_ios_locale);
00125 _M_fnumget = &use_facet<__numget_type>(_M_ios_locale);
00126 _M_tie = 0;
00127 _M_fill = this->widen(' ');
00128 _M_exception = goodbit;
00129 _M_streambuf = __sb;
00130 _M_streambuf_state = __sb ? goodbit : badbit;
00131 }
00132
00133 }
00134
00135 #endif
00136
00137