epoc32/include/stdapis/stlportv5/stl/_streambuf.h
branchSymbian3
changeset 4 837f303aceeb
parent 3 e1b950c65cb4
     1.1 --- a/epoc32/include/stdapis/stlportv5/stl/_streambuf.h	Wed Mar 31 12:27:01 2010 +0100
     1.2 +++ b/epoc32/include/stdapis/stlportv5/stl/_streambuf.h	Wed Mar 31 12:33:34 2010 +0100
     1.3 @@ -1,34 +1,26 @@
     1.4  /*
     1.5 - * © Portions copyright (c) 2006-2007 Nokia Corporation.  All rights reserved.
     1.6 - *
     1.7   * Copyright (c) 1999
     1.8   * Silicon Graphics Computer Systems, Inc.
     1.9   *
    1.10 - * Copyright (c) 1999 
    1.11 + * Copyright (c) 1999
    1.12   * Boris Fomitchev
    1.13   *
    1.14   * This material is provided "as is", with absolutely no warranty expressed
    1.15   * or implied. Any use is at your own risk.
    1.16   *
    1.17 - * Permission to use or copy this software for any purpose is hereby granted 
    1.18 + * Permission to use or copy this software for any purpose is hereby granted
    1.19   * without fee, provided the above notices are retained on all copies.
    1.20   * Permission to modify the code and to distribute modified code is granted,
    1.21   * provided the above notices are retained, and a notice that the code was
    1.22   * modified is included with the above copyright notice.
    1.23   *
    1.24 - */ 
    1.25 + */
    1.26  #ifndef _STLP_INTERNAL_STREAMBUF
    1.27  #define _STLP_INTERNAL_STREAMBUF
    1.28  
    1.29  #ifndef _STLP_IOS_BASE_H
    1.30 -#include <stl/_ios_base.h>      // Needed for ios_base bitfield members.
    1.31 -                                // <ios_base> includes <iosfwd>.
    1.32 -#endif
    1.33 -
    1.34 -#ifndef _STLP_STDIO_FILE_H
    1.35 -#include <stl/_stdio_file.h>     // Declaration of struct FILE, and of
    1.36 -                                // functions to manipulate it.
    1.37 -#endif
    1.38 +#  include <stl/_ios_base.h>      // Needed for ios_base bitfield members.
    1.39 +#endif                            // <ios_base> includes <iosfwd>.
    1.40  
    1.41  _STLP_BEGIN_NAMESPACE
    1.42  
    1.43 @@ -50,15 +42,10 @@
    1.44  
    1.45  // The second template parameter, _Traits, defaults to char_traits<_CharT>.
    1.46  // The default is declared in header <iosfwd>, and it isn't declared here
    1.47 -// because C++ language rules do not allow it to be declared twice. 
    1.48 +// because C++ language rules do not allow it to be declared twice.
    1.49  
    1.50  template <class _CharT, class _Traits>
    1.51 -#ifdef __SYMBIAN32__
    1.52 -class basic_streambuf 
    1.53 -#else
    1.54 -class basic_streambuf
    1.55 -#endif
    1.56 -{
    1.57 +class basic_streambuf {
    1.58    friend class basic_istream<_CharT, _Traits>;
    1.59    friend class basic_ostream<_CharT, _Traits>;
    1.60  
    1.61 @@ -81,20 +68,29 @@
    1.62  
    1.63    locale _M_locale;             // The streambuf's locale object
    1.64  
    1.65 -public:                         // Extension: locking, for thread safety.
    1.66 -  _STLP_mutex _M_lock;
    1.67 +//public:                         // Extension: locking, for thread safety.
    1.68 +//  _STLP_mutex _M_lock;
    1.69  
    1.70  public:                         // Destructor.
    1.71 -  _STLP_DECLSPEC virtual ~basic_streambuf();
    1.72 +  virtual ~basic_streambuf();
    1.73  
    1.74  protected:                      // The default constructor.
    1.75 -  _STLP_DECLSPEC basic_streambuf();
    1.76 +  basic_streambuf()
    1.77 +#if defined (_STLP_MSVC) && (_STLP_MSVC < 1300) && defined (_STLP_USE_STATIC_LIB)
    1.78 +    //We make it inline to avoid unresolved symbol.
    1.79 +    : _M_gbegin(0), _M_gnext(0), _M_gend(0),
    1.80 +      _M_pbegin(0), _M_pnext(0), _M_pend(0),
    1.81 +      _M_locale()
    1.82 +  {}
    1.83 +#else
    1.84 +  ;
    1.85 +#endif
    1.86  
    1.87  protected:                      // Protected interface to the get area.
    1.88    char_type* eback() const { return _M_gbegin; } // Beginning
    1.89    char_type* gptr()  const { return _M_gnext; }  // Current position
    1.90    char_type* egptr() const { return _M_gend; }   // End
    1.91 -  
    1.92 +
    1.93    void gbump(int __n) { _M_gnext += __n; }
    1.94    void setg(char_type* __gbegin, char_type* __gnext, char_type* __gend) {
    1.95      _M_gbegin = __gbegin;
    1.96 @@ -106,13 +102,12 @@
    1.97    // An alternate public interface to the above functions
    1.98    // which allows us to avoid using templated friends which
    1.99    // are not supported on some compilers.
   1.100 -
   1.101    char_type* _M_eback() const { return eback(); }
   1.102    char_type* _M_gptr()  const { return gptr(); }
   1.103    char_type* _M_egptr() const { return egptr(); }
   1.104    void _M_gbump(int __n)      { gbump(__n); }
   1.105    void _M_setg(char_type* __gbegin, char_type* __gnext, char_type* __gend)
   1.106 -    { setg(__gbegin, __gnext, __gend); }
   1.107 +  { this->setg(__gbegin, __gnext, __gend); }
   1.108  
   1.109  protected:                      // Protected interface to the put area
   1.110  
   1.111 @@ -129,34 +124,34 @@
   1.112  
   1.113  protected:                      // Virtual buffer management functions.
   1.114  
   1.115 -  _STLP_DECLSPEC virtual basic_streambuf<_CharT, _Traits>* setbuf(char_type*, streamsize);
   1.116 +  virtual basic_streambuf<_CharT, _Traits>* setbuf(char_type*, streamsize);
   1.117  
   1.118    // Alters the stream position, using an integer offset.  In this
   1.119    // class seekoff does nothing; subclasses are expected to override it.
   1.120 -  _STLP_DECLSPEC virtual pos_type seekoff(off_type, ios_base::seekdir,
   1.121 +  virtual pos_type seekoff(off_type, ios_base::seekdir,
   1.122                             ios_base::openmode = ios_base::in | ios_base::out);
   1.123  
   1.124    // Alters the stream position, using a previously obtained streampos.  In
   1.125    // this class seekpos does nothing; subclasses are expected to override it.
   1.126 -  _STLP_DECLSPEC virtual pos_type
   1.127 +  virtual pos_type
   1.128    seekpos(pos_type, ios_base::openmode = ios_base::in | ios_base::out);
   1.129  
   1.130 -  // Synchronizes (i.e. flushes) the buffer.  All subclasses are expected to 
   1.131 +  // Synchronizes (i.e. flushes) the buffer.  All subclasses are expected to
   1.132    // override this virtual member function.
   1.133 -  _STLP_DECLSPEC virtual int sync();
   1.134 +  virtual int sync();
   1.135  
   1.136  
   1.137  public:                         // Buffer management.
   1.138 -  basic_streambuf<_CharT, _Traits>* pubsetbuf(char_type* __s, streamsize __n) 
   1.139 -    { return this->setbuf(__s, __n); }
   1.140 +  basic_streambuf<_CharT, _Traits>* pubsetbuf(char_type* __s, streamsize __n)
   1.141 +  { return this->setbuf(__s, __n); }
   1.142  
   1.143    pos_type pubseekoff(off_type __offset, ios_base::seekdir __way,
   1.144                        ios_base::openmode __mod = ios_base::in | ios_base::out)
   1.145 -    { return this->seekoff(__offset, __way, __mod); }
   1.146 +  { return this->seekoff(__offset, __way, __mod); }
   1.147  
   1.148    pos_type pubseekpos(pos_type __sp,
   1.149                        ios_base::openmode __mod = ios_base::in | ios_base::out)
   1.150 -    { return this->seekpos(__sp, __mod); }
   1.151 +  { return this->seekpos(__sp, __mod); }
   1.152  
   1.153    int pubsync() { return this->sync(); }
   1.154  
   1.155 @@ -166,40 +161,40 @@
   1.156    // with underflow, before reaching end of file.  (-1 is a special value:
   1.157    // it means that underflow will fail.)  Most subclasses should probably
   1.158    // override this virtual member function.
   1.159 -  _STLP_DECLSPEC virtual streamsize showmanyc();
   1.160 +  virtual streamsize showmanyc();
   1.161  
   1.162 -  // Reads up to __n characters.  Return value is the number of 
   1.163 +  // Reads up to __n characters.  Return value is the number of
   1.164    // characters read.
   1.165 -  _STLP_DECLSPEC virtual streamsize xsgetn(char_type* __s, streamsize __n);
   1.166 +  virtual streamsize xsgetn(char_type* __s, streamsize __n);
   1.167  
   1.168    // Called when there is no read position, i.e. when gptr() is null
   1.169    // or when gptr() >= egptr().  Subclasses are expected to override
   1.170    // this virtual member function.
   1.171 -  _STLP_DECLSPEC virtual int_type underflow();
   1.172 +  virtual int_type underflow();
   1.173  
   1.174 -  // Similar to underflow(), but used for unbuffered input.  Most 
   1.175 +  // Similar to underflow(), but used for unbuffered input.  Most
   1.176    // subclasses should probably override this virtual member function.
   1.177 -  _STLP_DECLSPEC virtual int_type uflow();
   1.178 +  virtual int_type uflow();
   1.179  
   1.180    // Called when there is no putback position, i.e. when gptr() is null
   1.181    // or when gptr() == eback().  All subclasses are expected to override
   1.182    // this virtual member function.
   1.183 -  _STLP_DECLSPEC virtual int_type pbackfail(int_type = traits_type::eof());
   1.184 +  virtual int_type pbackfail(int_type = traits_type::eof());
   1.185  
   1.186  protected:                      // Virtual put area functions, as defined in
   1.187                                  // 27.5.2.4.5 of the standard.
   1.188  
   1.189    // Writes up to __n characters.  Return value is the number of characters
   1.190    // written.
   1.191 -  _STLP_DECLSPEC virtual streamsize xsputn(const char_type* __s, streamsize __n);
   1.192 +  virtual streamsize xsputn(const char_type* __s, streamsize __n);
   1.193  
   1.194    // Extension: writes up to __n copies of __c.  Return value is the number
   1.195    // of characters written.
   1.196 -  _STLP_DECLSPEC virtual streamsize _M_xsputnc(char_type __c, streamsize __n);
   1.197 +  virtual streamsize _M_xsputnc(char_type __c, streamsize __n);
   1.198  
   1.199    // Called when there is no write position.  All subclasses are expected to
   1.200    // override this virtual member function.
   1.201 -  _STLP_DECLSPEC virtual int_type overflow(int_type = traits_type::eof());
   1.202 +  virtual int_type overflow(int_type = traits_type::eof());
   1.203  
   1.204  public:                         // Public members for writing characters.
   1.205    // Write a single character.
   1.206 @@ -210,49 +205,48 @@
   1.207  
   1.208    // Write __n characters.
   1.209    streamsize sputn(const char_type* __s, streamsize __n)
   1.210 -    { return this->xsputn(__s, __n); }
   1.211 +  { return this->xsputn(__s, __n); }
   1.212  
   1.213    // Extension: write __n copies of __c.
   1.214    streamsize _M_sputnc(char_type __c, streamsize __n)
   1.215 -    { return this->_M_xsputnc(__c, __n); }
   1.216 +  { return this->_M_xsputnc(__c, __n); }
   1.217  
   1.218  private:                        // Helper functions.
   1.219 -  _STLP_DECLSPEC int_type _M_snextc_aux();
   1.220 -
   1.221 +  int_type _M_snextc_aux();
   1.222  
   1.223  public:                         // Public members for reading characters.
   1.224    streamsize in_avail() {
   1.225      return (_M_gnext < _M_gend) ? (_M_gend - _M_gnext) : this->showmanyc();
   1.226    }
   1.227 -  
   1.228 +
   1.229    // Advance to the next character and return it.
   1.230    int_type snextc() {
   1.231 -	return ( _M_gend - _M_gnext > 1 ?
   1.232 +  return ( _M_gend - _M_gnext > 1 ?
   1.233               _Traits::to_int_type(*++_M_gnext) :
   1.234               this->_M_snextc_aux());
   1.235    }
   1.236  
   1.237    // Return the current character and advance to the next.
   1.238    int_type sbumpc() {
   1.239 -    return _M_gnext < _M_gend ? _Traits::to_int_type(*_M_gnext++) 
   1.240 +    return _M_gnext < _M_gend ? _Traits::to_int_type(*_M_gnext++)
   1.241        : this->uflow();
   1.242    }
   1.243 -  
   1.244 +
   1.245    // Return the current character without advancing to the next.
   1.246    int_type sgetc() {
   1.247 -    return _M_gnext < _M_gend ? _Traits::to_int_type(*_M_gnext) 
   1.248 +    return _M_gnext < _M_gend ? _Traits::to_int_type(*_M_gnext)
   1.249        : this->underflow();
   1.250    }
   1.251 -  
   1.252 +
   1.253    streamsize sgetn(char_type* __s, streamsize __n)
   1.254    { return this->xsgetn(__s, __n); }
   1.255 -  
   1.256 +
   1.257    int_type sputbackc(char_type __c) {
   1.258      return ((_M_gbegin < _M_gnext) && _Traits::eq(__c, *(_M_gnext - 1)))
   1.259        ? _Traits::to_int_type(*--_M_gnext)
   1.260        : this->pbackfail(_Traits::to_int_type(__c));
   1.261    }
   1.262 -  
   1.263 +
   1.264    int_type sungetc() {
   1.265      return (_M_gbegin < _M_gnext)
   1.266        ? _Traits::to_int_type(*--_M_gnext)
   1.267 @@ -265,16 +259,16 @@
   1.268    // sets the streambuf's locale to __loc.  Note that imbue should
   1.269    // not (and cannot, since it has no access to streambuf's private
   1.270    // members) set the streambuf's locale itself.
   1.271 -  _STLP_DECLSPEC virtual void imbue(const locale&);
   1.272 +  virtual void imbue(const locale&);
   1.273  
   1.274  public:                         // Locale-related functions.
   1.275 -  _STLP_DECLSPEC locale pubimbue(const locale&);
   1.276 +  locale pubimbue(const locale&);
   1.277    locale getloc() const { return _M_locale; }
   1.278  
   1.279 -# ifndef _STLP_NO_ANACHRONISMS
   1.280 +#if !defined (_STLP_NO_ANACHRONISMS)
   1.281    void stossc() { this->sbumpc(); }
   1.282 -# endif
   1.283 -#if defined(__MVS__) || defined(__OS400__)
   1.284 +#endif
   1.285 +#if defined (__MVS__) || defined (__OS400__)
   1.286  private: // Data members.
   1.287  
   1.288    char_type* _M_gbegin; // Beginning of get area
   1.289 @@ -287,251 +281,21 @@
   1.290  #endif
   1.291  };
   1.292  
   1.293 +#if defined (_STLP_USE_TEMPLATE_EXPORT)
   1.294 +_STLP_EXPORT_TEMPLATE_CLASS basic_streambuf<char, char_traits<char> >;
   1.295 +#  if !defined (_STLP_NO_WCHAR_T)
   1.296 +_STLP_EXPORT_TEMPLATE_CLASS basic_streambuf<wchar_t, char_traits<wchar_t> >;
   1.297 +#  endif // _STLP_NO_WCHAR_T
   1.298 +#endif // _STLP_USE_TEMPLATE_EXPORT
   1.299  
   1.300 -//----------------------------------------------------------------------
   1.301 -// Specialization: basic_streambuf<char, char_traits<char> >
   1.302 +_STLP_END_NAMESPACE
   1.303  
   1.304 -// We implement basic_streambuf<char, char_traits<char> > very differently
   1.305 -// than the general basic_streambuf<> template.  The main reason for this
   1.306 -// difference is a requirement in the C++ standard: the standard input
   1.307 -// and output streams cin and cout are required by default to be synchronized
   1.308 -// with the C library components stdin and stdout.  This means it must be
   1.309 -// possible to synchronize a basic_streambuf<char> with a C buffer.
   1.310 -//
   1.311 -// There are two basic ways to do that.  First, the streambuf could be
   1.312 -// unbuffered and delegate all buffering to stdio operations.  This
   1.313 -// would be correct, but slow: it would require at least one virtual
   1.314 -// function call for every character.  Second, the streambuf could use 
   1.315 -// a C stdio FILE as its buffer.  
   1.316 -//
   1.317 -// We choose the latter option.  Every streambuf has pointers to two
   1.318 -// FILE objects, one for the get area and one for the put area.  Ordinarily
   1.319 -// it just uses a FILE object as a convenient way to package the three
   1.320 -// get/put area pointers.  If a basic_streambuf<char> is synchronized with
   1.321 -// a stdio stream, though, then the pointers are to a FILE object that's
   1.322 -// also used by the C library.
   1.323 -//
   1.324 -// The header <stl/_stdio_file.h> encapsulates the implementation details
   1.325 -// of struct FILE.  It contains low-level inline functions that convert
   1.326 -// between whe FILE's internal representation and the three-pointer 
   1.327 -// representation that basic_streambuf<> needs.
   1.328 -
   1.329 -_STLP_TEMPLATE_NULL 
   1.330 -#ifdef __SYMBIAN32__
   1.331 -class basic_streambuf<char, char_traits<char> >
   1.332 -#else
   1.333 -class _STLP_CLASS_DECLSPEC basic_streambuf<char, char_traits<char> >
   1.334 -#endif
   1.335 -{
   1.336 -  friend class basic_istream<char, char_traits<char> >;
   1.337 -  friend class basic_ostream<char, char_traits<char> >;
   1.338 -public:                         // Typedefs.
   1.339 -  typedef char                        char_type;
   1.340 -  typedef char_traits<char>::int_type int_type;
   1.341 -  typedef char_traits<char>::pos_type pos_type;
   1.342 -  typedef char_traits<char>::off_type off_type;
   1.343 -  typedef char_traits<char>           traits_type;
   1.344 -
   1.345 -private:                        // Data members.
   1.346 -
   1.347 -  FILE* _M_get;                 // Reference to the get area
   1.348 -  FILE* _M_put;                 // Reference to the put area
   1.349 -
   1.350 -#if defined(__hpux)
   1.351 -  _FILEX  _M_default_get;          // Get area, unless we're syncing with stdio.
   1.352 -  _FILEX  _M_default_put;          // Put area, unless we're syncing with stdio.
   1.353 -#else
   1.354 -  FILE  _M_default_get;          // Get area, unless we're syncing with stdio.
   1.355 -  FILE  _M_default_put;          // Put area, unless we're syncing with stdio.
   1.356 +#if defined (_STLP_EXPOSE_STREAM_IMPLEMENTATION) && !defined (_STLP_LINK_TIME_INSTANTIATION)
   1.357 +#  include <stl/_streambuf.c>
   1.358  #endif
   1.359  
   1.360 -  locale _M_locale;
   1.361 -
   1.362 -public:                         // Extension: locking, for thread safety.
   1.363 -  _STLP_mutex _M_lock;
   1.364 -
   1.365 -public:                         // Destructor.
   1.366 -  _STLP_DECLSPEC virtual ~basic_streambuf _STLP_PSPEC2(char, char_traits<char>) ();
   1.367 -
   1.368 -public:
   1.369 -  // The default constructor; defined here inline as some compilers require it
   1.370 -  _STLP_DECLSPEC basic_streambuf _STLP_PSPEC2(char, char_traits<char>) ();
   1.371 -  // Extension: a constructor for streambufs synchronized with C stdio files.
   1.372 -  _STLP_DECLSPEC basic_streambuf _STLP_PSPEC2(char, char_traits<char>) (FILE* __get, FILE* __put);
   1.373 -
   1.374 -protected:                      // Protected interface to the get area.
   1.375 -  char_type* eback() const { return _FILE_I_begin(_M_get); }
   1.376 -  char_type* gptr()  const { return _FILE_I_next(_M_get); }
   1.377 -  char_type* egptr() const { return _FILE_I_end(_M_get); }
   1.378 -  void gbump(int __n) { _FILE_I_bump(_M_get, __n); }
   1.379 -  void setg(char_type* __gbegin, char_type* __gnext, char_type* __gend)
   1.380 -    { 
   1.381 -    _FILE_I_set(_M_get, __gbegin, __gnext, __gend); 
   1.382 -#ifdef __SYMBIAN32__
   1.383 -    _change_input_mode();
   1.384 -#endif
   1.385 -    }
   1.386 -
   1.387 -public:
   1.388 -  // An alternate public interface to the above functions
   1.389 -  // which allows us to avoid using templated friends which
   1.390 -  // are not supported on some compilers.
   1.391 -
   1.392 -  char_type* _M_eback() const { return _FILE_I_begin(_M_get); }
   1.393 -  char_type* _M_gptr()  const { return _FILE_I_next(_M_get); }
   1.394 -  char_type* _M_egptr() const { return _FILE_I_end(_M_get); }
   1.395 -
   1.396 -  void _M_gbump(int __n) { _FILE_I_bump(_M_get, __n); }
   1.397 -  void _M_setg(char_type* __gbegin, char_type* __gnext, char_type* __gend)
   1.398 -    { _FILE_I_set(_M_get, __gbegin, __gnext, __gend); }
   1.399 -
   1.400 -protected:                      // Protected interface to the put area
   1.401 -  char_type* pbase() const { return _FILE_O_begin(_M_put); }
   1.402 -  char_type* pptr()  const { return _FILE_O_next(_M_put); }
   1.403 -  char_type* epptr() const { return _FILE_O_end(_M_put); }
   1.404 -
   1.405 -  void pbump(int __n) { _FILE_O_bump(_M_put, __n); }
   1.406 -  void setp(char_type* __pbegin, char_type* __pend)
   1.407 -    { _FILE_O_set(_M_put, __pbegin, __pbegin, __pend); }
   1.408 -
   1.409 -protected:                      // Virtual buffer-management functions.
   1.410 -  _STLP_DECLSPEC virtual basic_streambuf<char, char_traits<char> >* setbuf(char_type*, streamsize);
   1.411 -  _STLP_DECLSPEC virtual pos_type seekoff(off_type, ios_base::seekdir,
   1.412 -                           ios_base::openmode = ios_base::in | ios_base::out);
   1.413 -  _STLP_DECLSPEC  virtual pos_type
   1.414 -  seekpos(pos_type, ios_base::openmode = ios_base::in | ios_base::out);
   1.415 -  _STLP_DECLSPEC virtual int sync();
   1.416 -
   1.417 -public:                         // Buffer management.
   1.418 -  basic_streambuf<char, char_traits<char> >* pubsetbuf(char_type* __s, streamsize __n) 
   1.419 -    { return this->setbuf(__s, __n); }
   1.420 -
   1.421 -  pos_type pubseekoff(off_type __offset, ios_base::seekdir __way,
   1.422 -                      ios_base::openmode __mod = ios_base::in | ios_base::out)
   1.423 -    { return this->seekoff(__offset, __way, __mod); }
   1.424 -
   1.425 -  pos_type pubseekpos(pos_type __sp,
   1.426 -                      ios_base::openmode __mod = ios_base::in | ios_base::out)
   1.427 -    { return this->seekpos(__sp, __mod); }
   1.428 -
   1.429 -  int pubsync() { return this->sync(); }
   1.430 -
   1.431 -protected:                      // Virtual get area functions.
   1.432 -  _STLP_DECLSPEC virtual streamsize showmanyc();
   1.433 -  _STLP_DECLSPEC virtual streamsize xsgetn(char_type* __s, streamsize __n);
   1.434 -  _STLP_DECLSPEC virtual int_type underflow();
   1.435 -  _STLP_DECLSPEC virtual int_type uflow();
   1.436 -  _STLP_DECLSPEC virtual int_type pbackfail(int_type __c = traits_type::eof());
   1.437 -
   1.438 -protected:                      // Virtual put area functions.
   1.439 -  _STLP_DECLSPEC virtual streamsize xsputn(const char_type* __s, streamsize __n);
   1.440 -  _STLP_DECLSPEC virtual streamsize _M_xsputnc(char_type __c, streamsize __n);
   1.441 -  _STLP_DECLSPEC virtual int_type overflow(int_type = traits_type::eof());
   1.442 -#ifdef __SYMBIAN32__  
   1.443 -  virtual int save_read_buffer () { return 0; }
   1.444 -  virtual void _change_input_mode() {};
   1.445 -#endif
   1.446 -public:                         // Public members for writing characters.
   1.447 -  // Write a single character.
   1.448 -  int_type sputc(char_type __c) {
   1.449 -    int_type __res;
   1.450 -	if( _FILE_O_avail(_M_put) > 0 )
   1.451 -	{
   1.452 -		_FILE_O_postincr(_M_put) = __c;
   1.453 -		__res = traits_type::to_int_type(__c);
   1.454 -	}
   1.455 -	else
   1.456 -      __res = this->overflow(traits_type::to_int_type(__c));
   1.457 -    return __res;
   1.458 -  }
   1.459 -
   1.460 -  // Write __n characters.
   1.461 -  streamsize sputn(const char_type* __s, streamsize __n)
   1.462 -    { return this->xsputn(__s, __n); }
   1.463 -
   1.464 -  // Extension: write __n copies of __c.
   1.465 -  streamsize _M_sputnc(char_type __c, streamsize __n)
   1.466 -    { return this->_M_xsputnc(__c, __n); }
   1.467 -
   1.468 -private:                        // Helper functions.
   1.469 -  _STLP_DECLSPEC int_type _M_snextc_aux();
   1.470 -
   1.471 -public:                         // Public members for reading characters.
   1.472 -  streamsize in_avail()
   1.473 -    { return _FILE_I_avail(_M_get) > 0 ? _FILE_I_avail(_M_get)
   1.474 -#ifdef __SYMBIAN32__  
   1.475 -                                     + save_read_buffer()
   1.476 -#endif
   1.477 -                                     : this->showmanyc(); }
   1.478 -  
   1.479 -  // Advance to the next character and return it.
   1.480 -  int_type snextc() {
   1.481 -    return _FILE_I_avail(_M_get) > 1
   1.482 -      ? traits_type::to_int_type(_FILE_I_preincr(_M_get))
   1.483 -      : this->_M_snextc_aux();
   1.484 -  }
   1.485 -
   1.486 -  // Return the current character and advance to the next.
   1.487 -  int_type sbumpc() {
   1.488 -    return _FILE_I_avail(_M_get) > 0
   1.489 -      ? traits_type::to_int_type(_FILE_I_postincr(_M_get))
   1.490 -      : this->uflow();
   1.491 -  }
   1.492 -
   1.493 -  // Return the current character without advancing to the next.
   1.494 -  int_type sgetc() {
   1.495 -    return _FILE_I_avail(_M_get) > 0
   1.496 -      ? traits_type::to_int_type(*_FILE_I_next(_M_get))
   1.497 -      : this->underflow();
   1.498 -  }
   1.499 -    
   1.500 -  streamsize sgetn(char_type* __s, streamsize __n)
   1.501 -    { return this->xsgetn(__s, __n); }
   1.502 -
   1.503 -  int_type sputbackc(char_type __c) {
   1.504 -    return _FILE_I_begin(_M_get) < _FILE_I_next(_M_get) &&
   1.505 -           __c == *(_FILE_I_next(_M_get) - 1)
   1.506 -      ? traits_type::to_int_type(_FILE_I_predecr(_M_get))
   1.507 -      : this->pbackfail(traits_type::to_int_type(__c));
   1.508 -  }
   1.509 -
   1.510 -  int_type sungetc() {
   1.511 -    return _FILE_I_begin(_M_get) < _FILE_I_next(_M_get)
   1.512 -      ? traits_type::to_int_type(_FILE_I_predecr(_M_get))
   1.513 -      : this->pbackfail();
   1.514 -  }
   1.515 -
   1.516 -protected:                      // Virtual locale functions.
   1.517 -  _STLP_DECLSPEC virtual void imbue(const locale&);
   1.518 -public:                         // Locale-related functions.
   1.519 -  _STLP_DECLSPEC locale pubimbue(const locale&);
   1.520 -  locale getloc() const { return _M_locale; }
   1.521 -
   1.522 -# ifndef _STLP_NO_ANACHRONISMS
   1.523 -public:
   1.524 -  void stossc() { this->sbumpc(); }
   1.525 -# endif
   1.526 -
   1.527 -#if defined(__MVS__) || defined(__OS400__)
   1.528 -private: // Data members.
   1.529 -
   1.530 -  char_type* _M_gbegin; // Beginning of get area
   1.531 -  char_type* _M_gnext; // Current position within the get area
   1.532 -  char_type* _M_gend; // End of get area
   1.533 -
   1.534 -  char_type* _M_pbegin; // Beginning of put area
   1.535 -  char_type* _M_pnext; // Current position within the put area
   1.536 -  char_type* _M_pend; // End of put area
   1.537  #endif
   1.538  
   1.539 -};
   1.540 -_STLP_END_NAMESPACE
   1.541 -
   1.542 -# if defined (_STLP_EXPOSE_STREAM_IMPLEMENTATION) && !defined (_STLP_LINK_TIME_INSTANTIATION)
   1.543 -#  include <stl/_streambuf.c>
   1.544 -# endif
   1.545 -
   1.546 -#endif
   1.547  // Local Variables:
   1.548  // mode:C++
   1.549  // End: