epoc32/include/stdapis/stlportv5/stl/_streambuf.c
branchSymbian3
changeset 4 837f303aceeb
parent 3 e1b950c65cb4
     1.1 --- a/epoc32/include/stdapis/stlportv5/stl/_streambuf.c	Wed Mar 31 12:27:01 2010 +0100
     1.2 +++ b/epoc32/include/stdapis/stlportv5/stl/_streambuf.c	Wed Mar 31 12:33:34 2010 +0100
     1.3 @@ -1,51 +1,47 @@
     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_STREAMBUF_C
    1.27  #define _STLP_STREAMBUF_C
    1.28  
    1.29  #ifndef _STLP_INTERNAL_STREAMBUF
    1.30 -# include <stl/_streambuf.h>
    1.31 +#  include <stl/_streambuf.h>
    1.32  #endif
    1.33  
    1.34 -# if defined (_STLP_EXPOSE_STREAM_IMPLEMENTATION)
    1.35 -
    1.36  _STLP_BEGIN_NAMESPACE
    1.37  //----------------------------------------------------------------------
    1.38  // Non-inline basic_streambuf<> member functions.
    1.39  
    1.40 +#if !defined (_STLP_MSVC) || (_STLP_MSVC >= 1300) || !defined (_STLP_USE_STATIC_LIB)
    1.41  template <class _CharT, class _Traits>
    1.42 -_STLP_EXP_DECLSPEC basic_streambuf<_CharT, _Traits>::basic_streambuf()
    1.43 +basic_streambuf<_CharT, _Traits>::basic_streambuf()
    1.44    : _M_gbegin(0), _M_gnext(0), _M_gend(0),
    1.45      _M_pbegin(0), _M_pnext(0), _M_pend(0),
    1.46 -    _M_locale()
    1.47 -{
    1.48 +    _M_locale() {
    1.49    //  _M_lock._M_initialize();
    1.50  }
    1.51 +#endif
    1.52  
    1.53  template <class _CharT, class _Traits>
    1.54 -_STLP_EXP_DECLSPEC  basic_streambuf<_CharT, _Traits>::~basic_streambuf() 
    1.55 +basic_streambuf<_CharT, _Traits>::~basic_streambuf()
    1.56  {}
    1.57  
    1.58 -
    1.59  template <class _CharT, class _Traits>
    1.60 -_STLP_EXP_DECLSPEC locale 
    1.61 +locale
    1.62  basic_streambuf<_CharT, _Traits>::pubimbue(const locale& __loc) {
    1.63    this->imbue(__loc);
    1.64    locale __tmp = _M_locale;
    1.65 @@ -54,16 +50,15 @@
    1.66  }
    1.67  
    1.68  template <class _CharT, class _Traits>
    1.69 -_STLP_EXP_DECLSPEC streamsize
    1.70 -basic_streambuf<_CharT, _Traits>::xsgetn(_CharT* __s, streamsize __n)
    1.71 -{
    1.72 +streamsize
    1.73 +basic_streambuf<_CharT, _Traits>::xsgetn(_CharT* __s, streamsize __n) {
    1.74    streamsize __result = 0;
    1.75    const int_type __eof = _Traits::eof();
    1.76  
    1.77    while (__result < __n) {
    1.78      if (_M_gnext < _M_gend) {
    1.79        size_t __chunk = (min) (__STATIC_CAST(size_t,_M_gend - _M_gnext),
    1.80 -                           __STATIC_CAST(size_t,__n - __result));
    1.81 +                              __STATIC_CAST(size_t,__n - __result));
    1.82        _Traits::copy(__s, _M_gnext, __chunk);
    1.83        __result += __chunk;
    1.84        __s += __chunk;
    1.85 @@ -72,20 +67,20 @@
    1.86      else {
    1.87        int_type __c = this->sbumpc();
    1.88        if (!_Traits::eq_int_type(__c, __eof)) {
    1.89 -        *__s = __c;
    1.90 +        *__s = _Traits::to_char_type(__c);
    1.91          ++__result;
    1.92 -	++__s;
    1.93 +        ++__s;
    1.94        }
    1.95        else
    1.96 -        break; 
    1.97 +        break;
    1.98      }
    1.99    }
   1.100 -  
   1.101 +
   1.102    return __result;
   1.103  }
   1.104  
   1.105  template <class _CharT, class _Traits>
   1.106 -_STLP_EXP_DECLSPEC streamsize
   1.107 +streamsize
   1.108  basic_streambuf<_CharT, _Traits>::xsputn(const _CharT* __s, streamsize __n)
   1.109  {
   1.110    streamsize __result = 0;
   1.111 @@ -113,7 +108,7 @@
   1.112  }
   1.113  
   1.114  template <class _CharT, class _Traits>
   1.115 -_STLP_EXP_DECLSPEC streamsize
   1.116 +streamsize
   1.117  basic_streambuf<_CharT, _Traits>::_M_xsputnc(_CharT __c, streamsize __n)
   1.118  {
   1.119    streamsize __result = 0;
   1.120 @@ -138,8 +133,8 @@
   1.121  }
   1.122  
   1.123  template <class _CharT, class _Traits>
   1.124 -_STLP_EXP_DECLSPEC _STLP_TYPENAME_ON_RETURN_TYPE basic_streambuf<_CharT, _Traits>::int_type 
   1.125 -basic_streambuf<_CharT, _Traits>::_M_snextc_aux()  
   1.126 +_STLP_TYPENAME_ON_RETURN_TYPE basic_streambuf<_CharT, _Traits>::int_type
   1.127 +basic_streambuf<_CharT, _Traits>::_M_snextc_aux()
   1.128  {
   1.129    int_type __eof = _Traits::eof();
   1.130    if (_M_gend == _M_gnext)
   1.131 @@ -151,19 +146,19 @@
   1.132  }
   1.133  
   1.134  template <class _CharT, class _Traits>
   1.135 -_STLP_EXP_DECLSPEC _STLP_TYPENAME_ON_RETURN_TYPE basic_streambuf<_CharT, _Traits>::int_type 
   1.136 -basic_streambuf<_CharT, _Traits>::pbackfail(int_type) { 
   1.137 - return _Traits::eof(); 
   1.138 +_STLP_TYPENAME_ON_RETURN_TYPE basic_streambuf<_CharT, _Traits>::int_type
   1.139 +basic_streambuf<_CharT, _Traits>::pbackfail(int_type) {
   1.140 + return _Traits::eof();
   1.141  }
   1.142  
   1.143  template <class _CharT, class _Traits>
   1.144 -_STLP_EXP_DECLSPEC _STLP_TYPENAME_ON_RETURN_TYPE basic_streambuf<_CharT, _Traits>::int_type 
   1.145 -basic_streambuf<_CharT, _Traits>::overflow(int_type) { 
   1.146 -  return _Traits::eof(); 
   1.147 +_STLP_TYPENAME_ON_RETURN_TYPE basic_streambuf<_CharT, _Traits>::int_type
   1.148 +basic_streambuf<_CharT, _Traits>::overflow(int_type) {
   1.149 +  return _Traits::eof();
   1.150  }
   1.151  
   1.152  template <class _CharT, class _Traits>
   1.153 -_STLP_EXP_DECLSPEC _STLP_TYPENAME_ON_RETURN_TYPE basic_streambuf<_CharT, _Traits>::int_type 
   1.154 +_STLP_TYPENAME_ON_RETURN_TYPE basic_streambuf<_CharT, _Traits>::int_type
   1.155  basic_streambuf<_CharT, _Traits>::uflow() {
   1.156      return ( _Traits::eq_int_type(this->underflow(),_Traits::eof()) ?
   1.157               _Traits::eof() :
   1.158 @@ -171,48 +166,43 @@
   1.159  }
   1.160  
   1.161  template <class _CharT, class _Traits>
   1.162 -_STLP_EXP_DECLSPEC _STLP_TYPENAME_ON_RETURN_TYPE basic_streambuf<_CharT, _Traits>::int_type 
   1.163 +_STLP_TYPENAME_ON_RETURN_TYPE basic_streambuf<_CharT, _Traits>::int_type
   1.164  basic_streambuf<_CharT, _Traits>::underflow()
   1.165  { return _Traits::eof(); }
   1.166  
   1.167  template <class _CharT, class _Traits>
   1.168 -_STLP_EXP_DECLSPEC streamsize 
   1.169 +streamsize
   1.170  basic_streambuf<_CharT, _Traits>::showmanyc()
   1.171  { return 0; }
   1.172  
   1.173  template <class _CharT, class _Traits>
   1.174 -_STLP_EXP_DECLSPEC void 
   1.175 +void
   1.176  basic_streambuf<_CharT, _Traits>::imbue(const locale&) {}
   1.177  
   1.178  template <class _CharT, class _Traits>
   1.179 -_STLP_EXP_DECLSPEC int
   1.180 +int
   1.181  basic_streambuf<_CharT, _Traits>::sync() { return 0; }
   1.182  
   1.183  template <class _CharT, class _Traits>
   1.184 -_STLP_EXP_DECLSPEC _STLP_TYPENAME_ON_RETURN_TYPE basic_streambuf<_CharT, _Traits>::pos_type 
   1.185 +_STLP_TYPENAME_ON_RETURN_TYPE basic_streambuf<_CharT, _Traits>::pos_type
   1.186  basic_streambuf<_CharT, _Traits>::seekpos(pos_type, ios_base::openmode)
   1.187  { return pos_type(-1); }
   1.188  
   1.189  template <class _CharT, class _Traits>
   1.190 -_STLP_EXP_DECLSPEC _STLP_TYPENAME_ON_RETURN_TYPE basic_streambuf<_CharT, _Traits>::pos_type 
   1.191 +_STLP_TYPENAME_ON_RETURN_TYPE basic_streambuf<_CharT, _Traits>::pos_type
   1.192  basic_streambuf<_CharT, _Traits>::seekoff(off_type, ios_base::seekdir,
   1.193 -					  ios_base::openmode)
   1.194 +                                          ios_base::openmode)
   1.195  { return pos_type(-1); }
   1.196  
   1.197  template <class _CharT, class _Traits>
   1.198 -_STLP_EXP_DECLSPEC basic_streambuf<_CharT, _Traits>* 
   1.199 +basic_streambuf<_CharT, _Traits>*
   1.200  basic_streambuf<_CharT, _Traits>:: setbuf(char_type*, streamsize)
   1.201  { return this; }
   1.202  
   1.203 -
   1.204 -# if defined (_STLP_USE_TEMPLATE_EXPORT)
   1.205 -#  if !defined (_STLP_NO_WCHAR_T)
   1.206 -_STLP_EXPORT_TEMPLATE_CLASS basic_streambuf<wchar_t, char_traits<wchar_t> >;
   1.207 -#  endif
   1.208 -# endif /* _STLP_USE_TEMPLATE_EXPORT */
   1.209 -
   1.210  _STLP_END_NAMESPACE
   1.211  
   1.212 -# endif /* EXPOSE */
   1.213 +#endif
   1.214  
   1.215 -#endif
   1.216 +// Local Variables:
   1.217 +// mode:C++
   1.218 +// End: