epoc32/include/stdapis/stlportv5/stl/_string_io.h
branchSymbian3
changeset 4 837f303aceeb
parent 3 e1b950c65cb4
     1.1 --- a/epoc32/include/stdapis/stlportv5/stl/_string_io.h	Wed Mar 31 12:27:01 2010 +0100
     1.2 +++ b/epoc32/include/stdapis/stlportv5/stl/_string_io.h	Wed Mar 31 12:33:34 2010 +0100
     1.3 @@ -2,13 +2,13 @@
     1.4   * Copyright (c) 1997-1999
     1.5   * Silicon Graphics Computer Systems, Inc.
     1.6   *
     1.7 - * Copyright (c) 1999 
     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 + * Permission to use or copy this software for any purpose is hereby granted
    1.16   * without fee, provided the above notices are retained on all copies.
    1.17   * Permission to modify the code and to distribute modified code is granted,
    1.18   * provided the above notices are retained, and a notice that the code was
    1.19 @@ -19,104 +19,59 @@
    1.20  #ifndef _STLP_STRING_IO_H
    1.21  #define _STLP_STRING_IO_H
    1.22  
    1.23 -// this is for link-time instantiation
    1.24 -#if !defined  ( _STLP_STRING )
    1.25 -# include <string>
    1.26 -# endif
    1.27 +#ifndef _STLP_INTERNAL_OSTREAM_H
    1.28 +#  include <stl/_ostream.h>
    1.29 +#endif
    1.30  
    1.31 -//#ifndef _STLP_LOCALE
    1.32 -//# include <locale>
    1.33 -//#endif
    1.34 +#ifndef _STLP_INTERNAL_ISTREAM
    1.35 +#  include <stl/_istream.h>
    1.36 +#endif
    1.37  
    1.38 -# ifdef _STLP_DEBUG
    1.39 -#  define basic_string _Nondebug_string
    1.40 -# endif
    1.41 -
    1.42 -// I/O.  
    1.43 +// I/O.
    1.44  _STLP_BEGIN_NAMESPACE
    1.45  
    1.46 -#if defined (_STLP_USE_NEW_IOSTREAMS)
    1.47 -
    1.48  template <class _CharT, class _Traits, class _Alloc>
    1.49  basic_ostream<_CharT, _Traits>& _STLP_CALL
    1.50 -operator<<(basic_ostream<_CharT, _Traits>& __os, 
    1.51 +operator<<(basic_ostream<_CharT, _Traits>& __os,
    1.52             const basic_string<_CharT,_Traits,_Alloc>& __s);
    1.53  
    1.54 +#if defined (_STLP_USE_TEMPLATE_EXPRESSION)
    1.55 +
    1.56 +template <class _CharT, class _Traits, class _Alloc, class _Left, class _Right, class _StorageDir>
    1.57 +basic_ostream<_CharT, _Traits>& _STLP_CALL
    1.58 +operator<<(basic_ostream<_CharT, _Traits>& __os,
    1.59 +           const _STLP_PRIV __bstr_sum<_CharT, _Traits, _Alloc, _Left, _Right, _StorageDir>& __sum) {
    1.60 +  basic_string<_CharT, _Traits, _Alloc> __tmp(__sum);
    1.61 +  return __os << __tmp;
    1.62 +}
    1.63 +
    1.64 +#endif /* _STLP_USE_TEMPLATE_EXPRESSION */
    1.65 +
    1.66  template <class _CharT, class _Traits, class _Alloc>
    1.67  basic_istream<_CharT, _Traits>&  _STLP_CALL
    1.68  operator>>(basic_istream<_CharT, _Traits>& __is,
    1.69             basic_string<_CharT,_Traits,_Alloc>& __s);
    1.70  
    1.71 -template <class _CharT, class _Traits, class _Alloc>    
    1.72 -basic_istream<_CharT, _Traits>& _STLP_CALL 
    1.73 +template <class _CharT, class _Traits, class _Alloc>
    1.74 +basic_istream<_CharT, _Traits>& _STLP_CALL
    1.75  getline(basic_istream<_CharT, _Traits>& __is,
    1.76          basic_string<_CharT,_Traits,_Alloc>& __s,
    1.77          _CharT __delim);
    1.78  
    1.79 -# if !(defined (__BORLANDC__) && ! defined (_STLP_USE_OWN_NAMESPACE))
    1.80 +#if !(defined (__BORLANDC__) && !defined (_STLP_USE_OWN_NAMESPACE))
    1.81  
    1.82 -template <class _CharT, class _Traits, class _Alloc>    
    1.83 -inline basic_istream<_CharT, _Traits>& _STLP_CALL 
    1.84 +template <class _CharT, class _Traits, class _Alloc>
    1.85 +inline basic_istream<_CharT, _Traits>& _STLP_CALL
    1.86  getline(basic_istream<_CharT, _Traits>& __is,
    1.87 -        basic_string<_CharT,_Traits,_Alloc>& __s)
    1.88 -{
    1.89 +        basic_string<_CharT,_Traits,_Alloc>& __s) {
    1.90    return getline(__is, __s, __is.widen('\n'));
    1.91  }
    1.92 -# endif
    1.93 -
    1.94 -template <class _CharT, class _Traits>
    1.95 -bool _STLP_CALL
    1.96 -__stlp_string_fill(basic_ostream<_CharT, _Traits>& __os,
    1.97 -                  basic_streambuf<_CharT, _Traits>* __buf,
    1.98 -                  size_t __n);
    1.99 -#elif ! defined ( _STLP_USE_NO_IOSTREAMS )
   1.100 -
   1.101 -// (reg) For Watcom IO, this tells if ostream class is in .exe or in .dll
   1.102 -# ifdef _WPRTLINK
   1.103 -typedef _WPRTLINK ostream _OSTREAM_DLL;
   1.104 -typedef _WPRTLINK istream _ISTREAM_DLL;
   1.105 -#else
   1.106 -typedef           ostream _OSTREAM_DLL;
   1.107 -typedef           istream _ISTREAM_DLL;
   1.108  #endif
   1.109  
   1.110 -template <class _CharT, class _Traits, class _Alloc>
   1.111 -_OSTREAM_DLL& _STLP_CALL operator<<(_OSTREAM_DLL& __os, 
   1.112 -                    const basic_string<_CharT,_Traits,_Alloc>& __s);
   1.113 -
   1.114 -template <class _CharT, class _Traits, class _Alloc>
   1.115 -_ISTREAM_DLL& _STLP_CALL operator>>(_ISTREAM_DLL& __is, basic_string<_CharT,_Traits,_Alloc>& __s);
   1.116 -
   1.117 -template <class _CharT, class _Traits, class _Alloc>    
   1.118 -_ISTREAM_DLL& _STLP_CALL getline(_ISTREAM_DLL& __is,
   1.119 -                 basic_string<_CharT,_Traits,_Alloc>& __s,
   1.120 -                 _CharT __delim);
   1.121 -
   1.122 -
   1.123 -template <class _CharT, class _Traits, class _Alloc>    
   1.124 -inline _ISTREAM_DLL& _STLP_CALL 
   1.125 -getline(_ISTREAM_DLL& __is, basic_string<_CharT,_Traits,_Alloc>& __s)
   1.126 -{
   1.127 -  return getline(__is, __s, '\n');
   1.128 -}
   1.129 -
   1.130 -inline void  _STLP_CALL
   1.131 -__stlp_string_fill(_OSTREAM_DLL& __os, streambuf* __buf, size_t __n)
   1.132 -{
   1.133 -  char __f = __os.fill();
   1.134 -  size_t __i;
   1.135 -
   1.136 -  for (__i = 0; __i < __n; ++__i) __buf->sputc(__f);
   1.137 -}
   1.138 -
   1.139 -#endif /* _STLP_USE_NEW_IOSTREAMS */
   1.140 -
   1.141  _STLP_END_NAMESPACE
   1.142  
   1.143 -# undef basic_string
   1.144 -
   1.145 -# if !defined (_STLP_LINK_TIME_INSTANTIATION)
   1.146 +#if !defined (_STLP_LINK_TIME_INSTANTIATION)
   1.147  #  include <stl/_string_io.c>
   1.148 -# endif
   1.149 +#endif
   1.150  
   1.151  #endif /* _STLP_STRING_IO_H */