epoc32/include/stdapis/stlportv5/stl/_string_io.h
branchSymbian2
changeset 3 e1b950c65cb4
parent 2 2fe1408b6811
child 4 837f303aceeb
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/epoc32/include/stdapis/stlportv5/stl/_string_io.h	Wed Mar 31 12:27:01 2010 +0100
     1.3 @@ -0,0 +1,122 @@
     1.4 +/*
     1.5 + * Copyright (c) 1997-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_STRING_IO_H
    1.23 +#define _STLP_STRING_IO_H
    1.24 +
    1.25 +// this is for link-time instantiation
    1.26 +#if !defined  ( _STLP_STRING )
    1.27 +# include <string>
    1.28 +# endif
    1.29 +
    1.30 +//#ifndef _STLP_LOCALE
    1.31 +//# include <locale>
    1.32 +//#endif
    1.33 +
    1.34 +# ifdef _STLP_DEBUG
    1.35 +#  define basic_string _Nondebug_string
    1.36 +# endif
    1.37 +
    1.38 +// I/O.  
    1.39 +_STLP_BEGIN_NAMESPACE
    1.40 +
    1.41 +#if defined (_STLP_USE_NEW_IOSTREAMS)
    1.42 +
    1.43 +template <class _CharT, class _Traits, class _Alloc>
    1.44 +basic_ostream<_CharT, _Traits>& _STLP_CALL
    1.45 +operator<<(basic_ostream<_CharT, _Traits>& __os, 
    1.46 +           const basic_string<_CharT,_Traits,_Alloc>& __s);
    1.47 +
    1.48 +template <class _CharT, class _Traits, class _Alloc>
    1.49 +basic_istream<_CharT, _Traits>&  _STLP_CALL
    1.50 +operator>>(basic_istream<_CharT, _Traits>& __is,
    1.51 +           basic_string<_CharT,_Traits,_Alloc>& __s);
    1.52 +
    1.53 +template <class _CharT, class _Traits, class _Alloc>    
    1.54 +basic_istream<_CharT, _Traits>& _STLP_CALL 
    1.55 +getline(basic_istream<_CharT, _Traits>& __is,
    1.56 +        basic_string<_CharT,_Traits,_Alloc>& __s,
    1.57 +        _CharT __delim);
    1.58 +
    1.59 +# if !(defined (__BORLANDC__) && ! defined (_STLP_USE_OWN_NAMESPACE))
    1.60 +
    1.61 +template <class _CharT, class _Traits, class _Alloc>    
    1.62 +inline basic_istream<_CharT, _Traits>& _STLP_CALL 
    1.63 +getline(basic_istream<_CharT, _Traits>& __is,
    1.64 +        basic_string<_CharT,_Traits,_Alloc>& __s)
    1.65 +{
    1.66 +  return getline(__is, __s, __is.widen('\n'));
    1.67 +}
    1.68 +# endif
    1.69 +
    1.70 +template <class _CharT, class _Traits>
    1.71 +bool _STLP_CALL
    1.72 +__stlp_string_fill(basic_ostream<_CharT, _Traits>& __os,
    1.73 +                  basic_streambuf<_CharT, _Traits>* __buf,
    1.74 +                  size_t __n);
    1.75 +#elif ! defined ( _STLP_USE_NO_IOSTREAMS )
    1.76 +
    1.77 +// (reg) For Watcom IO, this tells if ostream class is in .exe or in .dll
    1.78 +# ifdef _WPRTLINK
    1.79 +typedef _WPRTLINK ostream _OSTREAM_DLL;
    1.80 +typedef _WPRTLINK istream _ISTREAM_DLL;
    1.81 +#else
    1.82 +typedef           ostream _OSTREAM_DLL;
    1.83 +typedef           istream _ISTREAM_DLL;
    1.84 +#endif
    1.85 +
    1.86 +template <class _CharT, class _Traits, class _Alloc>
    1.87 +_OSTREAM_DLL& _STLP_CALL operator<<(_OSTREAM_DLL& __os, 
    1.88 +                    const basic_string<_CharT,_Traits,_Alloc>& __s);
    1.89 +
    1.90 +template <class _CharT, class _Traits, class _Alloc>
    1.91 +_ISTREAM_DLL& _STLP_CALL operator>>(_ISTREAM_DLL& __is, basic_string<_CharT,_Traits,_Alloc>& __s);
    1.92 +
    1.93 +template <class _CharT, class _Traits, class _Alloc>    
    1.94 +_ISTREAM_DLL& _STLP_CALL getline(_ISTREAM_DLL& __is,
    1.95 +                 basic_string<_CharT,_Traits,_Alloc>& __s,
    1.96 +                 _CharT __delim);
    1.97 +
    1.98 +
    1.99 +template <class _CharT, class _Traits, class _Alloc>    
   1.100 +inline _ISTREAM_DLL& _STLP_CALL 
   1.101 +getline(_ISTREAM_DLL& __is, basic_string<_CharT,_Traits,_Alloc>& __s)
   1.102 +{
   1.103 +  return getline(__is, __s, '\n');
   1.104 +}
   1.105 +
   1.106 +inline void  _STLP_CALL
   1.107 +__stlp_string_fill(_OSTREAM_DLL& __os, streambuf* __buf, size_t __n)
   1.108 +{
   1.109 +  char __f = __os.fill();
   1.110 +  size_t __i;
   1.111 +
   1.112 +  for (__i = 0; __i < __n; ++__i) __buf->sputc(__f);
   1.113 +}
   1.114 +
   1.115 +#endif /* _STLP_USE_NEW_IOSTREAMS */
   1.116 +
   1.117 +_STLP_END_NAMESPACE
   1.118 +
   1.119 +# undef basic_string
   1.120 +
   1.121 +# if !defined (_STLP_LINK_TIME_INSTANTIATION)
   1.122 +#  include <stl/_string_io.c>
   1.123 +# endif
   1.124 +
   1.125 +#endif /* _STLP_STRING_IO_H */