|
1 /* |
|
2 * Copyright (c) 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_IOSTREAM |
|
20 #define _STLP_IOSTREAM |
|
21 |
|
22 # ifndef _STLP_OUTERMOST_HEADER_ID |
|
23 # define _STLP_OUTERMOST_HEADER_ID 0x1037 |
|
24 # include <stl/_prolog.h> |
|
25 # endif |
|
26 |
|
27 # ifdef _STLP_PRAGMA_ONCE |
|
28 # pragma once |
|
29 # endif |
|
30 |
|
31 #include <stl/_ioserr.h> |
|
32 |
|
33 #ifdef _STLP_REDIRECT_STDSTREAMS |
|
34 // for ofstream redirection |
|
35 # include <fstream> |
|
36 #endif |
|
37 |
|
38 #include <stl/_iosfwd.h> |
|
39 #include <stl/_istream.h> |
|
40 |
|
41 _STLP_BEGIN_NAMESPACE |
|
42 |
|
43 #ifndef _STLP_USE_NAMESPACES |
|
44 // in case of SGI iostreams, we have to rename our streams not to clash with those |
|
45 // provided in native lib |
|
46 # define cin _STLP_cin |
|
47 # define cout _STLP_cout |
|
48 # define cerr _STLP_cerr |
|
49 # define clog _STLP_clog |
|
50 #endif |
|
51 |
|
52 // Note: cin and wcin are both associated with stdio. The C standard |
|
53 // (Amendment 1, section 4.6.2.1) says that it is an error to mix |
|
54 // wide- and narrow-oriented I/O on the same stream. This implies |
|
55 // that it is an error to use both cin and wcin in the same C++ |
|
56 // program; the same applies to cout and wcout, and cerr/clog and |
|
57 // wcerr/wclog. |
|
58 |
|
59 # ifdef _STLP_REDIRECT_STDSTREAMS |
|
60 extern _STLP_DECLSPEC istream cin; |
|
61 extern _STLP_DECLSPEC ofstream cout; |
|
62 extern _STLP_DECLSPEC ofstream cerr; |
|
63 extern _STLP_DECLSPEC ofstream clog; |
|
64 # else |
|
65 extern _STLP_DECLSPEC istream cin; |
|
66 extern _STLP_DECLSPEC ostream cout; |
|
67 extern _STLP_DECLSPEC ostream cerr; |
|
68 extern _STLP_DECLSPEC ostream clog; |
|
69 # endif |
|
70 |
|
71 # ifndef _STLP_NO_WCHAR_T |
|
72 extern _STLP_DECLSPEC wistream wcin; |
|
73 extern _STLP_DECLSPEC wostream wcout; |
|
74 extern _STLP_DECLSPEC wostream wcerr; |
|
75 extern _STLP_DECLSPEC wostream wclog; |
|
76 # endif |
|
77 |
|
78 _STLP_END_NAMESPACE |
|
79 |
|
80 //# elif defined ( _STLP_USE_NO_IOSTREAMS ) |
|
81 //# include <stl/_null_stream.h> |
|
82 |
|
83 # if (_STLP_OUTERMOST_HEADER_ID == 0x1037) |
|
84 # include <stl/_epilog.h> |
|
85 # undef _STLP_OUTERMOST_HEADER_ID |
|
86 # endif |
|
87 |
|
88 #endif /* _STLP_IOSTREAM */ |
|
89 |
|
90 // Local Variables: |
|
91 // mode:C++ |
|
92 // End: |