]> git.buserror.net Git - polintos/scott/priv.git/blob - include/c++/stl/stl/_string_io.h
minor doc updates
[polintos/scott/priv.git] / include / c++ / stl / stl / _string_io.h
1 /*
2  * Copyright (c) 1997-1999
3  * Silicon Graphics Computer Systems, Inc.
4  *
5  * Copyright (c) 1999
6  * Boris Fomitchev
7  *
8  * This material is provided "as is", with absolutely no warranty expressed
9  * or implied. Any use is at your own risk.
10  *
11  * Permission to use or copy this software for any purpose is hereby granted
12  * without fee, provided the above notices are retained on all copies.
13  * Permission to modify the code and to distribute modified code is granted,
14  * provided the above notices are retained, and a notice that the code was
15  * modified is included with the above copyright notice.
16  *
17  */
18
19 #ifndef _STLP_STRING_IO_H
20 #define _STLP_STRING_IO_H
21
22 #ifndef _STLP_INTERNAL_OSTREAM_H
23 #  include <stl/_ostream.h>
24 #endif
25
26 #ifndef _STLP_INTERNAL_ISTREAM
27 #  include <stl/_istream.h>
28 #endif
29
30 // I/O.
31 _STLP_BEGIN_NAMESPACE
32
33 template <class _CharT, class _Traits, class _Alloc>
34 basic_ostream<_CharT, _Traits>& _STLP_CALL
35 operator<<(basic_ostream<_CharT, _Traits>& __os,
36            const basic_string<_CharT,_Traits,_Alloc>& __s);
37
38 #if defined (_STLP_USE_TEMPLATE_EXPRESSION)
39
40 template <class _CharT, class _Traits, class _Alloc, class _Left, class _Right, class _StorageDir>
41 basic_ostream<_CharT, _Traits>& _STLP_CALL
42 operator<<(basic_ostream<_CharT, _Traits>& __os,
43            const _STLP_PRIV __bstr_sum<_CharT, _Traits, _Alloc, _Left, _Right, _StorageDir>& __sum) {
44   basic_string<_CharT, _Traits, _Alloc> __tmp(__sum);
45   return __os << __tmp;
46 }
47
48 #endif /* _STLP_USE_TEMPLATE_EXPRESSION */
49
50 template <class _CharT, class _Traits, class _Alloc>
51 basic_istream<_CharT, _Traits>&  _STLP_CALL
52 operator>>(basic_istream<_CharT, _Traits>& __is,
53            basic_string<_CharT,_Traits,_Alloc>& __s);
54
55 template <class _CharT, class _Traits, class _Alloc>
56 basic_istream<_CharT, _Traits>& _STLP_CALL
57 getline(basic_istream<_CharT, _Traits>& __is,
58         basic_string<_CharT,_Traits,_Alloc>& __s,
59         _CharT __delim);
60
61 #if !(defined (__BORLANDC__) && !defined (_STLP_USE_OWN_NAMESPACE))
62
63 template <class _CharT, class _Traits, class _Alloc>
64 inline basic_istream<_CharT, _Traits>& _STLP_CALL
65 getline(basic_istream<_CharT, _Traits>& __is,
66         basic_string<_CharT,_Traits,_Alloc>& __s) {
67   return getline(__is, __s, __is.widen('\n'));
68 }
69 #endif
70
71 _STLP_END_NAMESPACE
72
73 #if !defined (_STLP_LINK_TIME_INSTANTIATION)
74 #  include <stl/_string_io.c>
75 #endif
76
77 #endif /* _STLP_STRING_IO_H */