epoc32/include/stdapis/stlport/stl/_string_io.h
branchSymbian2
changeset 2 2fe1408b6811
parent 0 061f57f2323e
     1.1 --- a/epoc32/include/stdapis/stlport/stl/_string_io.h	Tue Nov 24 13:55:44 2009 +0000
     1.2 +++ b/epoc32/include/stdapis/stlport/stl/_string_io.h	Tue Mar 16 16:12:26 2010 +0000
     1.3 @@ -1,1 +1,122 @@
     1.4 -_string_io.h
     1.5 +/*
     1.6 + * Copyright (c) 1997-1999
     1.7 + * Silicon Graphics Computer Systems, Inc.
     1.8 + *
     1.9 + * Copyright (c) 1999 
    1.10 + * Boris Fomitchev
    1.11 + *
    1.12 + * This material is provided "as is", with absolutely no warranty expressed
    1.13 + * or implied. Any use is at your own risk.
    1.14 + *
    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 + * modified is included with the above copyright notice.
    1.20 + *
    1.21 + */
    1.22 +
    1.23 +#ifndef _STLP_STRING_IO_H
    1.24 +#define _STLP_STRING_IO_H
    1.25 +
    1.26 +// this is for link-time instantiation
    1.27 +#if !defined  ( _STLP_STRING )
    1.28 +# include <string>
    1.29 +# endif
    1.30 +
    1.31 +//#ifndef _STLP_LOCALE
    1.32 +//# include <locale>
    1.33 +//#endif
    1.34 +
    1.35 +# ifdef _STLP_DEBUG
    1.36 +#  define basic_string _Nondebug_string
    1.37 +# endif
    1.38 +
    1.39 +// I/O.  
    1.40 +_STLP_BEGIN_NAMESPACE
    1.41 +
    1.42 +#if defined (_STLP_USE_NEW_IOSTREAMS)
    1.43 +
    1.44 +template <class _CharT, class _Traits, class _Alloc>
    1.45 +basic_ostream<_CharT, _Traits>& _STLP_CALL
    1.46 +operator<<(basic_ostream<_CharT, _Traits>& __os, 
    1.47 +           const basic_string<_CharT,_Traits,_Alloc>& __s);
    1.48 +
    1.49 +template <class _CharT, class _Traits, class _Alloc>
    1.50 +basic_istream<_CharT, _Traits>&  _STLP_CALL
    1.51 +operator>>(basic_istream<_CharT, _Traits>& __is,
    1.52 +           basic_string<_CharT,_Traits,_Alloc>& __s);
    1.53 +
    1.54 +template <class _CharT, class _Traits, class _Alloc>    
    1.55 +basic_istream<_CharT, _Traits>& _STLP_CALL 
    1.56 +getline(basic_istream<_CharT, _Traits>& __is,
    1.57 +        basic_string<_CharT,_Traits,_Alloc>& __s,
    1.58 +        _CharT __delim);
    1.59 +
    1.60 +# if !(defined (__BORLANDC__) && ! defined (_STLP_USE_OWN_NAMESPACE))
    1.61 +
    1.62 +template <class _CharT, class _Traits, class _Alloc>    
    1.63 +inline basic_istream<_CharT, _Traits>& _STLP_CALL 
    1.64 +getline(basic_istream<_CharT, _Traits>& __is,
    1.65 +        basic_string<_CharT,_Traits,_Alloc>& __s)
    1.66 +{
    1.67 +  return getline(__is, __s, __is.widen('\n'));
    1.68 +}
    1.69 +# endif
    1.70 +
    1.71 +template <class _CharT, class _Traits>
    1.72 +bool _STLP_CALL
    1.73 +__stlp_string_fill(basic_ostream<_CharT, _Traits>& __os,
    1.74 +                  basic_streambuf<_CharT, _Traits>* __buf,
    1.75 +                  size_t __n);
    1.76 +#elif ! defined ( _STLP_USE_NO_IOSTREAMS )
    1.77 +
    1.78 +// (reg) For Watcom IO, this tells if ostream class is in .exe or in .dll
    1.79 +# ifdef _WPRTLINK
    1.80 +typedef _WPRTLINK ostream _OSTREAM_DLL;
    1.81 +typedef _WPRTLINK istream _ISTREAM_DLL;
    1.82 +#else
    1.83 +typedef           ostream _OSTREAM_DLL;
    1.84 +typedef           istream _ISTREAM_DLL;
    1.85 +#endif
    1.86 +
    1.87 +template <class _CharT, class _Traits, class _Alloc>
    1.88 +_OSTREAM_DLL& _STLP_CALL operator<<(_OSTREAM_DLL& __os, 
    1.89 +                    const basic_string<_CharT,_Traits,_Alloc>& __s);
    1.90 +
    1.91 +template <class _CharT, class _Traits, class _Alloc>
    1.92 +_ISTREAM_DLL& _STLP_CALL operator>>(_ISTREAM_DLL& __is, basic_string<_CharT,_Traits,_Alloc>& __s);
    1.93 +
    1.94 +template <class _CharT, class _Traits, class _Alloc>    
    1.95 +_ISTREAM_DLL& _STLP_CALL getline(_ISTREAM_DLL& __is,
    1.96 +                 basic_string<_CharT,_Traits,_Alloc>& __s,
    1.97 +                 _CharT __delim);
    1.98 +
    1.99 +
   1.100 +template <class _CharT, class _Traits, class _Alloc>    
   1.101 +inline _ISTREAM_DLL& _STLP_CALL 
   1.102 +getline(_ISTREAM_DLL& __is, basic_string<_CharT,_Traits,_Alloc>& __s)
   1.103 +{
   1.104 +  return getline(__is, __s, '\n');
   1.105 +}
   1.106 +
   1.107 +inline void  _STLP_CALL
   1.108 +__stlp_string_fill(_OSTREAM_DLL& __os, streambuf* __buf, size_t __n)
   1.109 +{
   1.110 +  char __f = __os.fill();
   1.111 +  size_t __i;
   1.112 +
   1.113 +  for (__i = 0; __i < __n; ++__i) __buf->sputc(__f);
   1.114 +}
   1.115 +
   1.116 +#endif /* _STLP_USE_NEW_IOSTREAMS */
   1.117 +
   1.118 +_STLP_END_NAMESPACE
   1.119 +
   1.120 +# undef basic_string
   1.121 +
   1.122 +# if !defined (_STLP_LINK_TIME_INSTANTIATION)
   1.123 +#  include <stl/_string_io.c>
   1.124 +# endif
   1.125 +
   1.126 +#endif /* _STLP_STRING_IO_H */