Attempt to represent the S^2->S^3 header reorganisation as a series of "hg rename" operations
2 * © Portions copyright (c) 2006-2007 Nokia Corporation. All rights reserved.
5 * Silicon Graphics Computer Systems, Inc.
10 * This material is provided "as is", with absolutely no warranty expressed
11 * or implied. Any use is at your own risk.
13 * Permission to use or copy this software for any purpose is hereby granted
14 * without fee, provided the above notices are retained on all copies.
15 * Permission to modify the code and to distribute modified code is granted,
16 * provided the above notices are retained, and a notice that the code was
17 * modified is included with the above copyright notice.
20 #ifndef _STLP_STREAMBUF_C
21 #define _STLP_STREAMBUF_C
23 #ifndef _STLP_INTERNAL_STREAMBUF
24 # include <stl/_streambuf.h>
27 # if defined (_STLP_EXPOSE_STREAM_IMPLEMENTATION)
30 //----------------------------------------------------------------------
31 // Non-inline basic_streambuf<> member functions.
33 template <class _CharT, class _Traits>
34 _STLP_EXP_DECLSPEC basic_streambuf<_CharT, _Traits>::basic_streambuf()
35 : _M_gbegin(0), _M_gnext(0), _M_gend(0),
36 _M_pbegin(0), _M_pnext(0), _M_pend(0),
39 // _M_lock._M_initialize();
42 template <class _CharT, class _Traits>
43 _STLP_EXP_DECLSPEC basic_streambuf<_CharT, _Traits>::~basic_streambuf()
47 template <class _CharT, class _Traits>
48 _STLP_EXP_DECLSPEC locale
49 basic_streambuf<_CharT, _Traits>::pubimbue(const locale& __loc) {
51 locale __tmp = _M_locale;
56 template <class _CharT, class _Traits>
57 _STLP_EXP_DECLSPEC streamsize
58 basic_streambuf<_CharT, _Traits>::xsgetn(_CharT* __s, streamsize __n)
60 streamsize __result = 0;
61 const int_type __eof = _Traits::eof();
63 while (__result < __n) {
64 if (_M_gnext < _M_gend) {
65 size_t __chunk = (min) (__STATIC_CAST(size_t,_M_gend - _M_gnext),
66 __STATIC_CAST(size_t,__n - __result));
67 _Traits::copy(__s, _M_gnext, __chunk);
73 int_type __c = this->sbumpc();
74 if (!_Traits::eq_int_type(__c, __eof)) {
87 template <class _CharT, class _Traits>
88 _STLP_EXP_DECLSPEC streamsize
89 basic_streambuf<_CharT, _Traits>::xsputn(const _CharT* __s, streamsize __n)
91 streamsize __result = 0;
92 const int_type __eof = _Traits::eof();
94 while (__result < __n) {
95 if (_M_pnext < _M_pend) {
96 size_t __chunk = (min) (__STATIC_CAST(size_t,_M_pend - _M_pnext),
97 __STATIC_CAST(size_t,__n - __result));
98 _Traits::copy(_M_pnext, __s, __chunk);
104 else if (!_Traits::eq_int_type(this->overflow(_Traits::to_int_type(*__s)),
115 template <class _CharT, class _Traits>
116 _STLP_EXP_DECLSPEC streamsize
117 basic_streambuf<_CharT, _Traits>::_M_xsputnc(_CharT __c, streamsize __n)
119 streamsize __result = 0;
120 const int_type __eof = _Traits::eof();
122 while (__result < __n) {
123 if (_M_pnext < _M_pend) {
124 size_t __chunk = (min) (__STATIC_CAST(size_t,_M_pend - _M_pnext),
125 __STATIC_CAST(size_t,__n - __result));
126 _Traits::assign(_M_pnext, __chunk, __c);
131 else if (!_Traits::eq_int_type(this->overflow(_Traits::to_int_type(__c)),
140 template <class _CharT, class _Traits>
141 _STLP_EXP_DECLSPEC _STLP_TYPENAME_ON_RETURN_TYPE basic_streambuf<_CharT, _Traits>::int_type
142 basic_streambuf<_CharT, _Traits>::_M_snextc_aux()
144 int_type __eof = _Traits::eof();
145 if (_M_gend == _M_gnext)
146 return _Traits::eq_int_type(this->uflow(), __eof) ? __eof : this->sgetc();
149 return this->underflow();
153 template <class _CharT, class _Traits>
154 _STLP_EXP_DECLSPEC _STLP_TYPENAME_ON_RETURN_TYPE basic_streambuf<_CharT, _Traits>::int_type
155 basic_streambuf<_CharT, _Traits>::pbackfail(int_type) {
156 return _Traits::eof();
159 template <class _CharT, class _Traits>
160 _STLP_EXP_DECLSPEC _STLP_TYPENAME_ON_RETURN_TYPE basic_streambuf<_CharT, _Traits>::int_type
161 basic_streambuf<_CharT, _Traits>::overflow(int_type) {
162 return _Traits::eof();
165 template <class _CharT, class _Traits>
166 _STLP_EXP_DECLSPEC _STLP_TYPENAME_ON_RETURN_TYPE basic_streambuf<_CharT, _Traits>::int_type
167 basic_streambuf<_CharT, _Traits>::uflow() {
168 return ( _Traits::eq_int_type(this->underflow(),_Traits::eof()) ?
170 _Traits::to_int_type(*_M_gnext++));
173 template <class _CharT, class _Traits>
174 _STLP_EXP_DECLSPEC _STLP_TYPENAME_ON_RETURN_TYPE basic_streambuf<_CharT, _Traits>::int_type
175 basic_streambuf<_CharT, _Traits>::underflow()
176 { return _Traits::eof(); }
178 template <class _CharT, class _Traits>
179 _STLP_EXP_DECLSPEC streamsize
180 basic_streambuf<_CharT, _Traits>::showmanyc()
183 template <class _CharT, class _Traits>
184 _STLP_EXP_DECLSPEC void
185 basic_streambuf<_CharT, _Traits>::imbue(const locale&) {}
187 template <class _CharT, class _Traits>
188 _STLP_EXP_DECLSPEC int
189 basic_streambuf<_CharT, _Traits>::sync() { return 0; }
191 template <class _CharT, class _Traits>
192 _STLP_EXP_DECLSPEC _STLP_TYPENAME_ON_RETURN_TYPE basic_streambuf<_CharT, _Traits>::pos_type
193 basic_streambuf<_CharT, _Traits>::seekpos(pos_type, ios_base::openmode)
194 { return pos_type(-1); }
196 template <class _CharT, class _Traits>
197 _STLP_EXP_DECLSPEC _STLP_TYPENAME_ON_RETURN_TYPE basic_streambuf<_CharT, _Traits>::pos_type
198 basic_streambuf<_CharT, _Traits>::seekoff(off_type, ios_base::seekdir,
200 { return pos_type(-1); }
202 template <class _CharT, class _Traits>
203 _STLP_EXP_DECLSPEC basic_streambuf<_CharT, _Traits>*
204 basic_streambuf<_CharT, _Traits>:: setbuf(char_type*, streamsize)
208 # if defined (_STLP_USE_TEMPLATE_EXPORT)
209 # if !defined (_STLP_NO_WCHAR_T)
210 _STLP_EXPORT_TEMPLATE_CLASS basic_streambuf<wchar_t, char_traits<wchar_t> >;
212 # endif /* _STLP_USE_TEMPLATE_EXPORT */