epoc32/include/stdapis/stlportv5/stl/_string_io.h
author William Roberts <williamr@symbian.org>
Wed, 31 Mar 2010 12:27:01 +0100
branchSymbian2
changeset 3 e1b950c65cb4
parent 2 epoc32/include/stdapis/stlport/stl/_string_io.h@2fe1408b6811
child 4 837f303aceeb
permissions -rw-r--r--
Attempt to represent the S^2->S^3 header reorganisation as a series of "hg rename" operations
williamr@2
     1
/*
williamr@2
     2
 * Copyright (c) 1997-1999
williamr@2
     3
 * Silicon Graphics Computer Systems, Inc.
williamr@2
     4
 *
williamr@2
     5
 * Copyright (c) 1999 
williamr@2
     6
 * Boris Fomitchev
williamr@2
     7
 *
williamr@2
     8
 * This material is provided "as is", with absolutely no warranty expressed
williamr@2
     9
 * or implied. Any use is at your own risk.
williamr@2
    10
 *
williamr@2
    11
 * Permission to use or copy this software for any purpose is hereby granted 
williamr@2
    12
 * without fee, provided the above notices are retained on all copies.
williamr@2
    13
 * Permission to modify the code and to distribute modified code is granted,
williamr@2
    14
 * provided the above notices are retained, and a notice that the code was
williamr@2
    15
 * modified is included with the above copyright notice.
williamr@2
    16
 *
williamr@2
    17
 */
williamr@2
    18
williamr@2
    19
#ifndef _STLP_STRING_IO_H
williamr@2
    20
#define _STLP_STRING_IO_H
williamr@2
    21
williamr@2
    22
// this is for link-time instantiation
williamr@2
    23
#if !defined  ( _STLP_STRING )
williamr@2
    24
# include <string>
williamr@2
    25
# endif
williamr@2
    26
williamr@2
    27
//#ifndef _STLP_LOCALE
williamr@2
    28
//# include <locale>
williamr@2
    29
//#endif
williamr@2
    30
williamr@2
    31
# ifdef _STLP_DEBUG
williamr@2
    32
#  define basic_string _Nondebug_string
williamr@2
    33
# endif
williamr@2
    34
williamr@2
    35
// I/O.  
williamr@2
    36
_STLP_BEGIN_NAMESPACE
williamr@2
    37
williamr@2
    38
#if defined (_STLP_USE_NEW_IOSTREAMS)
williamr@2
    39
williamr@2
    40
template <class _CharT, class _Traits, class _Alloc>
williamr@2
    41
basic_ostream<_CharT, _Traits>& _STLP_CALL
williamr@2
    42
operator<<(basic_ostream<_CharT, _Traits>& __os, 
williamr@2
    43
           const basic_string<_CharT,_Traits,_Alloc>& __s);
williamr@2
    44
williamr@2
    45
template <class _CharT, class _Traits, class _Alloc>
williamr@2
    46
basic_istream<_CharT, _Traits>&  _STLP_CALL
williamr@2
    47
operator>>(basic_istream<_CharT, _Traits>& __is,
williamr@2
    48
           basic_string<_CharT,_Traits,_Alloc>& __s);
williamr@2
    49
williamr@2
    50
template <class _CharT, class _Traits, class _Alloc>    
williamr@2
    51
basic_istream<_CharT, _Traits>& _STLP_CALL 
williamr@2
    52
getline(basic_istream<_CharT, _Traits>& __is,
williamr@2
    53
        basic_string<_CharT,_Traits,_Alloc>& __s,
williamr@2
    54
        _CharT __delim);
williamr@2
    55
williamr@2
    56
# if !(defined (__BORLANDC__) && ! defined (_STLP_USE_OWN_NAMESPACE))
williamr@2
    57
williamr@2
    58
template <class _CharT, class _Traits, class _Alloc>    
williamr@2
    59
inline basic_istream<_CharT, _Traits>& _STLP_CALL 
williamr@2
    60
getline(basic_istream<_CharT, _Traits>& __is,
williamr@2
    61
        basic_string<_CharT,_Traits,_Alloc>& __s)
williamr@2
    62
{
williamr@2
    63
  return getline(__is, __s, __is.widen('\n'));
williamr@2
    64
}
williamr@2
    65
# endif
williamr@2
    66
williamr@2
    67
template <class _CharT, class _Traits>
williamr@2
    68
bool _STLP_CALL
williamr@2
    69
__stlp_string_fill(basic_ostream<_CharT, _Traits>& __os,
williamr@2
    70
                  basic_streambuf<_CharT, _Traits>* __buf,
williamr@2
    71
                  size_t __n);
williamr@2
    72
#elif ! defined ( _STLP_USE_NO_IOSTREAMS )
williamr@2
    73
williamr@2
    74
// (reg) For Watcom IO, this tells if ostream class is in .exe or in .dll
williamr@2
    75
# ifdef _WPRTLINK
williamr@2
    76
typedef _WPRTLINK ostream _OSTREAM_DLL;
williamr@2
    77
typedef _WPRTLINK istream _ISTREAM_DLL;
williamr@2
    78
#else
williamr@2
    79
typedef           ostream _OSTREAM_DLL;
williamr@2
    80
typedef           istream _ISTREAM_DLL;
williamr@2
    81
#endif
williamr@2
    82
williamr@2
    83
template <class _CharT, class _Traits, class _Alloc>
williamr@2
    84
_OSTREAM_DLL& _STLP_CALL operator<<(_OSTREAM_DLL& __os, 
williamr@2
    85
                    const basic_string<_CharT,_Traits,_Alloc>& __s);
williamr@2
    86
williamr@2
    87
template <class _CharT, class _Traits, class _Alloc>
williamr@2
    88
_ISTREAM_DLL& _STLP_CALL operator>>(_ISTREAM_DLL& __is, basic_string<_CharT,_Traits,_Alloc>& __s);
williamr@2
    89
williamr@2
    90
template <class _CharT, class _Traits, class _Alloc>    
williamr@2
    91
_ISTREAM_DLL& _STLP_CALL getline(_ISTREAM_DLL& __is,
williamr@2
    92
                 basic_string<_CharT,_Traits,_Alloc>& __s,
williamr@2
    93
                 _CharT __delim);
williamr@2
    94
williamr@2
    95
williamr@2
    96
template <class _CharT, class _Traits, class _Alloc>    
williamr@2
    97
inline _ISTREAM_DLL& _STLP_CALL 
williamr@2
    98
getline(_ISTREAM_DLL& __is, basic_string<_CharT,_Traits,_Alloc>& __s)
williamr@2
    99
{
williamr@2
   100
  return getline(__is, __s, '\n');
williamr@2
   101
}
williamr@2
   102
williamr@2
   103
inline void  _STLP_CALL
williamr@2
   104
__stlp_string_fill(_OSTREAM_DLL& __os, streambuf* __buf, size_t __n)
williamr@2
   105
{
williamr@2
   106
  char __f = __os.fill();
williamr@2
   107
  size_t __i;
williamr@2
   108
williamr@2
   109
  for (__i = 0; __i < __n; ++__i) __buf->sputc(__f);
williamr@2
   110
}
williamr@2
   111
williamr@2
   112
#endif /* _STLP_USE_NEW_IOSTREAMS */
williamr@2
   113
williamr@2
   114
_STLP_END_NAMESPACE
williamr@2
   115
williamr@2
   116
# undef basic_string
williamr@2
   117
williamr@2
   118
# if !defined (_STLP_LINK_TIME_INSTANTIATION)
williamr@2
   119
#  include <stl/_string_io.c>
williamr@2
   120
# endif
williamr@2
   121
williamr@2
   122
#endif /* _STLP_STRING_IO_H */