epoc32/include/tools/stlport/stl/_sstream.c
branchSymbian3
changeset 4 837f303aceeb
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/epoc32/include/tools/stlport/stl/_sstream.c	Wed Mar 31 12:33:34 2010 +0100
     1.3 @@ -0,0 +1,536 @@
     1.4 +/*
     1.5 + * Copyright (c) 1999
     1.6 + * Silicon Graphics Computer Systems, Inc.
     1.7 + *
     1.8 + * Copyright (c) 1999
     1.9 + * Boris Fomitchev
    1.10 + *
    1.11 + * This material is provided "as is", with absolutely no warranty expressed
    1.12 + * or implied. Any use is at your own risk.
    1.13 + *
    1.14 + * Permission to use or copy this software for any purpose is hereby granted
    1.15 + * without fee, provided the above notices are retained on all copies.
    1.16 + * Permission to modify the code and to distribute modified code is granted,
    1.17 + * provided the above notices are retained, and a notice that the code was
    1.18 + * modified is included with the above copyright notice.
    1.19 + *
    1.20 + */
    1.21 +
    1.22 +#ifndef _STLP_SSTREAM_C
    1.23 +#define _STLP_SSTREAM_C
    1.24 +
    1.25 +#ifndef _STLP_INTERNAL_SSTREAM
    1.26 +#  include <stl/_sstream.h>
    1.27 +#endif
    1.28 +
    1.29 +#if defined ( _STLP_NESTED_TYPE_PARAM_BUG )
    1.30 +// no wint_t is supported for this mode
    1.31 +#  define __BSB_int_type__ int
    1.32 +#  define __BSB_pos_type__ streampos
    1.33 +#else
    1.34 +#  define __BSB_int_type__ _STLP_TYPENAME_ON_RETURN_TYPE basic_stringbuf<_CharT, _Traits, _Alloc>::int_type
    1.35 +#  define __BSB_pos_type__ _STLP_TYPENAME_ON_RETURN_TYPE basic_stringbuf<_CharT, _Traits, _Alloc>::pos_type
    1.36 +#endif
    1.37 +
    1.38 +_STLP_BEGIN_NAMESPACE
    1.39 +
    1.40 +//----------------------------------------------------------------------
    1.41 +// Non-inline stringbuf member functions.
    1.42 +
    1.43 +// Constructors.  Note that the base class constructor sets all of the
    1.44 +// get and area pointers to null.
    1.45 +
    1.46 +template <class _CharT, class _Traits, class _Alloc>
    1.47 +basic_stringbuf<_CharT, _Traits, _Alloc>
    1.48 +  ::basic_stringbuf(ios_base::openmode __mode)
    1.49 +    : basic_streambuf<_CharT, _Traits>(), _M_mode(__mode), _M_str()
    1.50 +{}
    1.51 +
    1.52 +template <class _CharT, class _Traits, class _Alloc>
    1.53 +basic_stringbuf<_CharT, _Traits, _Alloc>
    1.54 +  ::basic_stringbuf(const basic_string<_CharT, _Traits, _Alloc>& __s, ios_base::openmode __mode)
    1.55 +    : basic_streambuf<_CharT, _Traits>(), _M_mode(__mode), _M_str(__s)
    1.56 +{
    1.57 +  _M_set_ptrs();
    1.58 +}
    1.59 +
    1.60 +template <class _CharT, class _Traits, class _Alloc>
    1.61 +basic_stringbuf<_CharT, _Traits, _Alloc>::~basic_stringbuf()
    1.62 +{}
    1.63 +
    1.64 +// Set the underlying string to a new value.
    1.65 +template <class _CharT, class _Traits, class _Alloc>
    1.66 +void
    1.67 +basic_stringbuf<_CharT, _Traits, _Alloc>::str(const basic_string<_CharT, _Traits, _Alloc>& __s)
    1.68 +{
    1.69 +  _M_str = __s;
    1.70 +  _M_set_ptrs();
    1.71 +}
    1.72 +
    1.73 +template <class _CharT, class _Traits, class _Alloc>
    1.74 +void
    1.75 +basic_stringbuf<_CharT, _Traits, _Alloc>::_M_set_ptrs() {
    1.76 +  _CharT* __data_ptr = __CONST_CAST(_CharT*,_M_str.data());
    1.77 +  _CharT* __data_end = __data_ptr + _M_str.size();
    1.78 +  // The initial read position is the beginning of the string.
    1.79 +  if (_M_mode & ios_base::in) {
    1.80 +    if (_M_mode & ios_base::ate)
    1.81 +      this->setg(__data_ptr, __data_end, __data_end);
    1.82 +    else
    1.83 +      this->setg(__data_ptr, __data_ptr, __data_end);
    1.84 +  }
    1.85 +
    1.86 +  // The initial write position is the beginning of the string.
    1.87 +  if (_M_mode & ios_base::out) {
    1.88 +    if (_M_mode & (ios_base::app | ios_base::ate))
    1.89 +      this->setp(__data_end, __data_end);
    1.90 +    else
    1.91 +      this->setp(__data_ptr, __data_end);
    1.92 +  }
    1.93 +}
    1.94 +
    1.95 +// Precondition: gptr() >= egptr().  Returns a character, if one is available.
    1.96 +template <class _CharT, class _Traits, class _Alloc>
    1.97 +__BSB_int_type__
    1.98 +basic_stringbuf<_CharT, _Traits, _Alloc>::underflow() {
    1.99 +  return this->gptr() != this->egptr()
   1.100 +    ? _Traits::to_int_type(*this->gptr())
   1.101 +    : _Traits::eof();
   1.102 +}
   1.103 +
   1.104 +// Precondition: gptr() >= egptr().
   1.105 +template <class _CharT, class _Traits, class _Alloc>
   1.106 +__BSB_int_type__
   1.107 +basic_stringbuf<_CharT, _Traits, _Alloc>::uflow() {
   1.108 +  if (this->gptr() != this->egptr()) {
   1.109 +    int_type __c = _Traits::to_int_type(*this->gptr());
   1.110 +    this->gbump(1);
   1.111 +    return __c;
   1.112 +  }
   1.113 +  else
   1.114 +    return _Traits::eof();
   1.115 +}
   1.116 +
   1.117 +template <class _CharT, class _Traits, class _Alloc>
   1.118 +__BSB_int_type__
   1.119 +basic_stringbuf<_CharT, _Traits, _Alloc>::pbackfail(int_type __c) {
   1.120 +  if (this->gptr() != this->eback()) {
   1.121 +    if (!_Traits::eq_int_type(__c, _Traits::eof())) {
   1.122 +      if (_Traits::eq(_Traits::to_char_type(__c), this->gptr()[-1])) {
   1.123 +        this->gbump(-1);
   1.124 +        return __c;
   1.125 +      }
   1.126 +      else if (_M_mode & ios_base::out) {
   1.127 +        this->gbump(-1);
   1.128 +        *this->gptr() = _Traits::to_char_type(__c);
   1.129 +        return __c;
   1.130 +      }
   1.131 +      else
   1.132 +        return _Traits::eof();
   1.133 +    }
   1.134 +    else {
   1.135 +      this->gbump(-1);
   1.136 +      return _Traits::not_eof(__c);
   1.137 +    }
   1.138 +  }
   1.139 +  else
   1.140 +    return _Traits::eof();
   1.141 +}
   1.142 +
   1.143 +template <class _CharT, class _Traits, class _Alloc>
   1.144 +__BSB_int_type__
   1.145 +basic_stringbuf<_CharT, _Traits, _Alloc>::overflow(int_type __c) {
   1.146 +  // fbp : reverse order of "ifs" to pass Dietmar's test.
   1.147 +  // Apparently, standard allows overflow with eof even for read-only streams.
   1.148 +  if (!_Traits::eq_int_type(__c, _Traits::eof())) {
   1.149 +    if (_M_mode & ios_base::out) {
   1.150 +      if (!(_M_mode & ios_base::in)) {
   1.151 +        // It's a write-only streambuf, so we can use special append buffer.
   1.152 +        if (this->pptr() == this->epptr())
   1.153 +          this->_M_append_buffer();
   1.154 +
   1.155 +        if (this->pptr() != this->epptr()) {
   1.156 +          *this->pptr() = _Traits::to_char_type(__c);
   1.157 +          this->pbump(1);
   1.158 +          return __c;
   1.159 +        }
   1.160 +        else
   1.161 +          return _Traits::eof();
   1.162 +      }
   1.163 +      else {
   1.164 +        // We're not using a special append buffer, just the string itself.
   1.165 +        if (this->pptr() == this->epptr()) {
   1.166 +          ptrdiff_t __offset = this->gptr() - this->eback();
   1.167 +          _M_str.push_back(_Traits::to_char_type(__c));
   1.168 +
   1.169 +          _CharT* __data_ptr = __CONST_CAST(_CharT*,_M_str.data());
   1.170 +          size_t __data_size = _M_str.size();
   1.171 +
   1.172 +          this->setg(__data_ptr, __data_ptr + __offset, __data_ptr+__data_size);
   1.173 +          this->setp(__data_ptr, __data_ptr + __data_size);
   1.174 +          this->pbump((int)__data_size);
   1.175 +          return __c;
   1.176 +        }
   1.177 +        else {
   1.178 +          *this->pptr() = _Traits::to_char_type(__c);
   1.179 +          this->pbump(1);
   1.180 +          return __c;
   1.181 +        }
   1.182 +      }
   1.183 +    }
   1.184 +    else                          // Overflow always fails if it's read-only
   1.185 +      return _Traits::eof();
   1.186 +  }
   1.187 +  else                        // __c is EOF, so we don't have to do anything
   1.188 +    return _Traits::not_eof(__c);
   1.189 +}
   1.190 +
   1.191 +template <class _CharT, class _Traits, class _Alloc>
   1.192 +streamsize
   1.193 +basic_stringbuf<_CharT, _Traits, _Alloc>::xsputn(const char_type* __s,
   1.194 +                                                 streamsize __n) {
   1.195 +  streamsize __nwritten = 0;
   1.196 +
   1.197 +  if ((_M_mode & ios_base::out) && __n > 0) {
   1.198 +    // If the put pointer is somewhere in the middle of the string,
   1.199 +    // then overwrite instead of append.
   1.200 +    if (this->pbase() == _M_str.data() ) {
   1.201 +      ptrdiff_t __avail = _M_str.data() + _M_str.size() - this->pptr();
   1.202 +      if (__avail > __n) {
   1.203 +        _Traits::copy(this->pptr(), __s, __STATIC_CAST(size_t, __n));
   1.204 +        this->pbump((int)__n);
   1.205 +        return __n;
   1.206 +      }
   1.207 +      else {
   1.208 +        _Traits::copy(this->pptr(), __s, __avail);
   1.209 +        __nwritten += __avail;
   1.210 +        __n -= __avail;
   1.211 +        __s += __avail;
   1.212 +        this->setp(_M_Buf, _M_Buf + __STATIC_CAST(int,_S_BufSiz));
   1.213 +      }
   1.214 +    }
   1.215 +
   1.216 +    // At this point we know we're appending.
   1.217 +    if (_M_mode & ios_base::in) {
   1.218 +      ptrdiff_t __get_offset = this->gptr() - this->eback();
   1.219 +      _M_str.append(__s, __s + __STATIC_CAST(ptrdiff_t, __n));
   1.220 +
   1.221 +      _CharT* __data_ptr = __CONST_CAST(_CharT*, _M_str.data());
   1.222 +      size_t __data_size = _M_str.size();
   1.223 +
   1.224 +      this->setg(__data_ptr, __data_ptr + __get_offset, __data_ptr + __data_size);
   1.225 +      this->setp(__data_ptr, __data_ptr + __data_size);
   1.226 +      this->pbump((int)__data_size);
   1.227 +    }
   1.228 +    else {
   1.229 +      _M_append_buffer();
   1.230 +      _M_str.append(__s, __s + __STATIC_CAST(ptrdiff_t, __n));
   1.231 +    }
   1.232 +
   1.233 +    __nwritten += __n;
   1.234 +  }
   1.235 +
   1.236 +  return __nwritten;
   1.237 +}
   1.238 +
   1.239 +template <class _CharT, class _Traits, class _Alloc>
   1.240 +streamsize
   1.241 +basic_stringbuf<_CharT, _Traits, _Alloc>::_M_xsputnc(char_type __c,
   1.242 +                                                     streamsize __n) {
   1.243 +  streamsize __nwritten = 0;
   1.244 +
   1.245 +  if ((_M_mode & ios_base::out) && __n > 0) {
   1.246 +    // If the put pointer is somewhere in the middle of the string,
   1.247 +    // then overwrite instead of append.
   1.248 +    if (this->pbase() == _M_str.data()) {
   1.249 +      ptrdiff_t __avail = _M_str.data() + _M_str.size() - this->pptr();
   1.250 +      if (__avail > __n) {
   1.251 +        _Traits::assign(this->pptr(), __STATIC_CAST(size_t, __n), __c);
   1.252 +        this->pbump(__STATIC_CAST(int, __n));
   1.253 +        return __n;
   1.254 +      }
   1.255 +      else {
   1.256 +        _Traits::assign(this->pptr(), __avail, __c);
   1.257 +        __nwritten += __avail;
   1.258 +        __n -= __avail;
   1.259 +        this->setp(_M_Buf, _M_Buf + __STATIC_CAST(int,_S_BufSiz));
   1.260 +      }
   1.261 +    }
   1.262 +
   1.263 +    // At this point we know we're appending.
   1.264 +    size_t __app_size = sizeof(streamsize) > sizeof(size_t) ? __STATIC_CAST(size_t, (min)(__n, __STATIC_CAST(streamsize, _M_str.max_size())))
   1.265 +                                                            : __STATIC_CAST(size_t, __n);
   1.266 +    if (this->_M_mode & ios_base::in) {
   1.267 +      ptrdiff_t __get_offset = this->gptr() - this->eback();
   1.268 +      _M_str.append(__app_size, __c);
   1.269 +
   1.270 +      _CharT* __data_ptr = __CONST_CAST(_CharT*,_M_str.data());
   1.271 +      size_t __data_size = _M_str.size();
   1.272 +
   1.273 +      this->setg(__data_ptr, __data_ptr + __get_offset, __data_ptr + __data_size);
   1.274 +      this->setp(__data_ptr, __data_ptr + __data_size);
   1.275 +      this->pbump((int)__data_size);
   1.276 +    }
   1.277 +    else {
   1.278 +      _M_append_buffer();
   1.279 +      _M_str.append(__app_size, __c);
   1.280 +    }
   1.281 +
   1.282 +    __nwritten += __app_size;
   1.283 +  }
   1.284 +
   1.285 +  return __nwritten;
   1.286 +}
   1.287 +
   1.288 +// According to the C++ standard the effects of setbuf are implementation
   1.289 +// defined, except that setbuf(0, 0) has no effect.  In this implementation,
   1.290 +// setbuf(<anything>, n), for n > 0, calls reserve(n) on the underlying
   1.291 +// string.
   1.292 +template <class _CharT, class _Traits, class _Alloc>
   1.293 +basic_streambuf<_CharT, _Traits>*
   1.294 +basic_stringbuf<_CharT, _Traits, _Alloc>::setbuf(_CharT*, streamsize __n) {
   1.295 +  if (__n > 0) {
   1.296 +    bool __do_get_area = false;
   1.297 +    bool __do_put_area = false;
   1.298 +    ptrdiff_t __offg = 0;
   1.299 +    ptrdiff_t __offp = 0;
   1.300 +
   1.301 +    if (this->pbase() == _M_str.data()) {
   1.302 +      __do_put_area = true;
   1.303 +      __offp = this->pptr() - this->pbase();
   1.304 +    }
   1.305 +
   1.306 +    if (this->eback() == _M_str.data()) {
   1.307 +      __do_get_area = true;
   1.308 +      __offg = this->gptr() - this->eback();
   1.309 +    }
   1.310 +
   1.311 +    if ((_M_mode & ios_base::out) && !(_M_mode & ios_base::in))
   1.312 +      _M_append_buffer();
   1.313 +
   1.314 +    _M_str.reserve(sizeof(streamsize) > sizeof(size_t) ? __STATIC_CAST(size_t, (min)(__n, __STATIC_CAST(streamsize, _M_str.max_size())))
   1.315 +                                                       : __STATIC_CAST(size_t, __n));
   1.316 +
   1.317 +    _CharT* __data_ptr = __CONST_CAST(_CharT*, _M_str.data());
   1.318 +    size_t __data_size = _M_str.size();
   1.319 +
   1.320 +    if (__do_get_area) {
   1.321 +      this->setg(__data_ptr, __data_ptr + __offg, __data_ptr + __data_size);
   1.322 +    }
   1.323 +
   1.324 +    if (__do_put_area) {
   1.325 +      this->setp(__data_ptr, __data_ptr + __data_size);
   1.326 +      this->pbump((int)__offp);
   1.327 +    }
   1.328 +  }
   1.329 +
   1.330 +  return this;
   1.331 +}
   1.332 +
   1.333 +template <class _CharT, class _Traits, class _Alloc>
   1.334 +__BSB_pos_type__
   1.335 +basic_stringbuf<_CharT, _Traits, _Alloc>
   1.336 +  ::seekoff(off_type __off,
   1.337 +            ios_base::seekdir __dir,
   1.338 +            ios_base::openmode __mode) {
   1.339 +  __mode &= _M_mode;
   1.340 +
   1.341 +  bool __imode  = (__mode & ios_base::in) != 0;
   1.342 +  bool __omode = (__mode & ios_base::out) != 0;
   1.343 +
   1.344 +  if ( !(__imode || __omode) )
   1.345 +    return pos_type(off_type(-1));
   1.346 +
   1.347 +  if ( (__imode && (this->gptr() == 0)) || (__omode && (this->pptr() == 0)) )
   1.348 +    return pos_type(off_type(-1));
   1.349 +
   1.350 +  if ((_M_mode & ios_base::out) && !(_M_mode & ios_base::in))
   1.351 +    _M_append_buffer();
   1.352 +
   1.353 +  streamoff __newoff;
   1.354 +  switch(__dir) {
   1.355 +  case ios_base::beg:
   1.356 +    __newoff = 0;
   1.357 +    break;
   1.358 +  case ios_base::end:
   1.359 +    __newoff = _M_str.size();
   1.360 +    break;
   1.361 +  case ios_base::cur:
   1.362 +    __newoff = __imode ? this->gptr() - this->eback() : this->pptr() - this->pbase();
   1.363 +    break;
   1.364 +  default:
   1.365 +    return pos_type(off_type(-1));
   1.366 +  }
   1.367 +
   1.368 +  __off += __newoff;
   1.369 +
   1.370 +  if (__imode) {
   1.371 +    ptrdiff_t __n = this->egptr() - this->eback();
   1.372 +
   1.373 +    if (__off < 0 || __off > __n)
   1.374 +      return pos_type(off_type(-1));
   1.375 +    this->setg(this->eback(), this->eback() + __STATIC_CAST(ptrdiff_t, __off),
   1.376 +                              this->eback() + __STATIC_CAST(ptrdiff_t, __n));
   1.377 +  }
   1.378 +
   1.379 +  if (__omode) {
   1.380 +    ptrdiff_t __n = this->epptr() - this->pbase();
   1.381 +
   1.382 +    if (__off < 0 || __off > __n)
   1.383 +      return pos_type(off_type(-1));
   1.384 +    this->setp(this->pbase(), this->pbase() + __n);
   1.385 +    this->pbump((int)__off);
   1.386 +  }
   1.387 +
   1.388 +  return pos_type(__off);
   1.389 +}
   1.390 +
   1.391 +template <class _CharT, class _Traits, class _Alloc>
   1.392 +__BSB_pos_type__
   1.393 +basic_stringbuf<_CharT, _Traits, _Alloc>
   1.394 +  ::seekpos(pos_type __pos, ios_base::openmode __mode) {
   1.395 +  __mode &= _M_mode;
   1.396 +
   1.397 +  bool __imode  = (__mode & ios_base::in) != 0;
   1.398 +  bool __omode = (__mode & ios_base::out) != 0;
   1.399 +
   1.400 +  if ( !(__imode || __omode) )
   1.401 +    return pos_type(off_type(-1));
   1.402 +
   1.403 +  if ( (__imode && (this->gptr() == 0)) || (__omode && (this->pptr() == 0)) )
   1.404 +    return pos_type(off_type(-1));
   1.405 +
   1.406 +  const off_type __n = __pos - pos_type(off_type(0));
   1.407 +  if ((_M_mode & ios_base::out) && !(_M_mode & ios_base::in))
   1.408 +    _M_append_buffer();
   1.409 +
   1.410 +  if (__imode) {
   1.411 +    if (__n < 0 || __n > this->egptr() - this->eback())
   1.412 +      return pos_type(off_type(-1));
   1.413 +    this->setg(this->eback(), this->eback() + __STATIC_CAST(ptrdiff_t, __n), this->egptr());
   1.414 +  }
   1.415 +
   1.416 +  if (__omode) {
   1.417 +    if (__n < 0 || size_t(__n) > _M_str.size())
   1.418 +      return pos_type(off_type(-1));
   1.419 +
   1.420 +    _CharT* __data_ptr = __CONST_CAST(_CharT*,_M_str.data());
   1.421 +    size_t __data_size = _M_str.size();
   1.422 +
   1.423 +    this->setp(__data_ptr, __data_ptr+__data_size);
   1.424 +    this->pbump((int)__n);
   1.425 +  }
   1.426 +
   1.427 +  return __pos;
   1.428 +}
   1.429 +
   1.430 +// This is declared as a const member function because it is
   1.431 +// called by basic_stringbuf<>::str().  Precondition: this is a
   1.432 +// write-only stringbuf.  We can't use an output buffer for read-
   1.433 +// write stringbufs.  Postcondition: pptr is reset to the beginning
   1.434 +// of the buffer.
   1.435 +template <class _CharT, class _Traits, class _Alloc>
   1.436 +void basic_stringbuf<_CharT, _Traits, _Alloc>::_M_append_buffer() const {
   1.437 +  // Do we have a buffer to append?
   1.438 +  if (this->pbase() == this->_M_Buf && this->pptr() != this->_M_Buf) {
   1.439 +    basic_stringbuf<_CharT, _Traits, _Alloc>* __this = __CONST_CAST(_Self*,this);
   1.440 +    __this->_M_str.append((const _CharT*)this->pbase(), (const _CharT*)this->pptr());
   1.441 +#ifndef __MWERKS__
   1.442 +    __this->setp(__CONST_CAST(_CharT*,_M_Buf),
   1.443 +                 __CONST_CAST(_CharT*,_M_Buf + __STATIC_CAST(int,_S_BufSiz)));
   1.444 +#else // CodeWarrior treat const char * and const char [8] as different types
   1.445 +    __this->setp((_CharT*)_M_Buf,
   1.446 +                 (_CharT*)(_M_Buf + __STATIC_CAST(int,_S_BufSiz)));
   1.447 +#endif
   1.448 +  }
   1.449 +
   1.450 +  // Have we run off the end of the string?
   1.451 +  else if (this->pptr() == this->epptr()) {
   1.452 +    basic_stringbuf<_CharT, _Traits, _Alloc>* __this = __CONST_CAST(_Self*,this);
   1.453 +#ifndef __MWERKS__
   1.454 +    __this->setp(__CONST_CAST(_CharT*,_M_Buf),
   1.455 +                 __CONST_CAST(_CharT*,_M_Buf + __STATIC_CAST(int,_S_BufSiz)));
   1.456 +#else // CodeWarrior treat const char * and const char [8] as different types
   1.457 +    __this->setp((_CharT*)_M_Buf,
   1.458 +                 (_CharT*)(_M_Buf + __STATIC_CAST(int,_S_BufSiz)));
   1.459 +#endif
   1.460 +  }
   1.461 +}
   1.462 +
   1.463 +//----------------------------------------------------------------------
   1.464 +// Non-inline istringstream member functions.
   1.465 +
   1.466 +template <class _CharT, class _Traits, class _Alloc>
   1.467 +basic_istringstream<_CharT, _Traits, _Alloc>
   1.468 +  ::basic_istringstream(ios_base::openmode __mode)
   1.469 +    : basic_istream<_CharT, _Traits>(0),
   1.470 +      _M_buf(__mode | ios_base::in) {
   1.471 +  this->init(&_M_buf);
   1.472 +}
   1.473 +
   1.474 +template <class _CharT, class _Traits, class _Alloc>
   1.475 +basic_istringstream<_CharT, _Traits, _Alloc>
   1.476 +  ::basic_istringstream(const _String& __str,ios_base::openmode __mode)
   1.477 +    : basic_istream<_CharT, _Traits>(0),
   1.478 +      _M_buf(__str, __mode | ios_base::in) {
   1.479 +  this->init(&_M_buf);
   1.480 +}
   1.481 +
   1.482 +template <class _CharT, class _Traits, class _Alloc>
   1.483 +basic_istringstream<_CharT, _Traits, _Alloc>::~basic_istringstream()
   1.484 +{}
   1.485 +
   1.486 +//----------------------------------------------------------------------
   1.487 +// Non-inline ostringstream member functions.
   1.488 +
   1.489 +template <class _CharT, class _Traits, class _Alloc>
   1.490 +basic_ostringstream<_CharT, _Traits, _Alloc>
   1.491 +  ::basic_ostringstream(ios_base::openmode __mode)
   1.492 +    : basic_ostream<_CharT, _Traits>(0),
   1.493 +      _M_buf(__mode | ios_base::out) {
   1.494 +  this->init(&_M_buf);
   1.495 +}
   1.496 +
   1.497 +template <class _CharT, class _Traits, class _Alloc>
   1.498 +basic_ostringstream<_CharT, _Traits, _Alloc>
   1.499 +  ::basic_ostringstream(const _String& __str, ios_base::openmode __mode)
   1.500 +    : basic_ostream<_CharT, _Traits>(0),
   1.501 +      _M_buf(__str, __mode | ios_base::out) {
   1.502 +  this->init(&_M_buf);
   1.503 +}
   1.504 +
   1.505 +template <class _CharT, class _Traits, class _Alloc>
   1.506 +basic_ostringstream<_CharT, _Traits, _Alloc>::~basic_ostringstream()
   1.507 +{}
   1.508 +
   1.509 +//----------------------------------------------------------------------
   1.510 +// Non-inline stringstream member functions.
   1.511 +
   1.512 +template <class _CharT, class _Traits, class _Alloc>
   1.513 +basic_stringstream<_CharT, _Traits, _Alloc>
   1.514 +  ::basic_stringstream(ios_base::openmode __mode)
   1.515 +    : basic_iostream<_CharT, _Traits>(0), _M_buf(__mode) {
   1.516 +   this->init(&_M_buf);
   1.517 +}
   1.518 +
   1.519 +template <class _CharT, class _Traits, class _Alloc>
   1.520 +basic_stringstream<_CharT, _Traits, _Alloc>
   1.521 +  ::basic_stringstream(const _String& __str, ios_base::openmode __mode)
   1.522 +    : basic_iostream<_CharT, _Traits>(0), _M_buf(__str, __mode) {
   1.523 +  this->init(&_M_buf);
   1.524 +}
   1.525 +
   1.526 +template <class _CharT, class _Traits, class _Alloc>
   1.527 +basic_stringstream<_CharT, _Traits, _Alloc>::~basic_stringstream()
   1.528 +{}
   1.529 +
   1.530 +_STLP_END_NAMESPACE
   1.531 +
   1.532 +# undef __BSB_int_type__
   1.533 +# undef __BSB_pos_type__
   1.534 +
   1.535 +#endif /* _STLP_SSTREAM_C */
   1.536 +
   1.537 +// Local Variables:
   1.538 +// mode:C++
   1.539 +// End: