|
1 /* |
|
2 * Portions Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). All rights reserved. |
|
3 * |
|
4 * Copyright (c) 1999 |
|
5 * Silicon Graphics Computer Systems, Inc. |
|
6 * |
|
7 * Copyright (c) 1999 |
|
8 * Boris Fomitchev |
|
9 * |
|
10 * This material is provided "as is", with absolutely no warranty expressed |
|
11 * or implied. Any use is at your own risk. |
|
12 * |
|
13 * Permission to use or copy this software for any purpose is hereby granted |
|
14 * without fee, provided the above notices are retained on all copies. |
|
15 * Permission to modify the code and to distribute modified code is granted, |
|
16 * provided the above notices are retained, and a notice that the code was |
|
17 * modified is included with the above copyright notice. |
|
18 * |
|
19 */ |
|
20 |
|
21 #ifndef _STLP_IOSTREAM |
|
22 #define _STLP_IOSTREAM |
|
23 |
|
24 # ifndef _STLP_OUTERMOST_HEADER_ID |
|
25 # define _STLP_OUTERMOST_HEADER_ID 0x1037 |
|
26 # include <stl/_prolog.h> |
|
27 # endif |
|
28 |
|
29 # ifdef _STLP_PRAGMA_ONCE |
|
30 # pragma once |
|
31 # endif |
|
32 |
|
33 #include <stl/_ioserr.h> |
|
34 |
|
35 #ifdef _STLP_REDIRECT_STDSTREAMS |
|
36 // for ofstream redirection |
|
37 # include <fstream> |
|
38 #endif |
|
39 |
|
40 #include <stl/_iosfwd.h> |
|
41 #include <stl/_istream.h> |
|
42 |
|
43 _STLP_BEGIN_NAMESPACE |
|
44 |
|
45 #ifndef _STLP_USE_NAMESPACES |
|
46 // in case of SGI iostreams, we have to rename our streams not to clash with those |
|
47 // provided in native lib |
|
48 # define cin _STLP_cin |
|
49 # define cout _STLP_cout |
|
50 # define cerr _STLP_cerr |
|
51 # define clog _STLP_clog |
|
52 #endif |
|
53 |
|
54 // Note: cin and wcin are both associated with stdio. The C standard |
|
55 // (Amendment 1, section 4.6.2.1) says that it is an error to mix |
|
56 // wide- and narrow-oriented I/O on the same stream. This implies |
|
57 // that it is an error to use both cin and wcin in the same C++ |
|
58 // program; the same applies to cout and wcout, and cerr/clog and |
|
59 // wcerr/wclog. |
|
60 |
|
61 # ifdef _STLP_REDIRECT_STDSTREAMS |
|
62 extern _STLP_DECLSPEC istream cin; |
|
63 extern _STLP_DECLSPEC ofstream cout; |
|
64 extern _STLP_DECLSPEC ofstream cerr; |
|
65 extern _STLP_DECLSPEC ofstream clog; |
|
66 # elif defined(__SYMBIAN32__WSD__) || defined (__SYMBIAN32__NO_STATIC_IMPORTS__) |
|
67 _STLP_DECLSPEC ostream& get_cerr(); |
|
68 _STLP_DECLSPEC ostream& get_cout(); |
|
69 _STLP_DECLSPEC ostream& get_clog(); |
|
70 _STLP_DECLSPEC istream& get_cin(); |
|
71 # if defined (__SYMBIAN32__WSD__) || !defined(_STLP_DESIGNATED_DLL) |
|
72 /* For the emulator, these definitions are used by the user as well as the STLPort library*/ |
|
73 /* For ARM platforms, user gets references to streams via function calls while the library uses the |
|
74 objects internally. |
|
75 */ |
|
76 #define cerr get_cerr() |
|
77 #define cin get_cin() |
|
78 #define cout get_cout() |
|
79 #define clog get_clog() |
|
80 # endif //__SYMBIAN32__WSD__ || _STLP_DESIGNATED_DLL |
|
81 #else |
|
82 extern _STLP_DECLSPEC istream cin; |
|
83 extern _STLP_DECLSPEC ostream cout; |
|
84 extern _STLP_DECLSPEC ostream cerr; |
|
85 extern _STLP_DECLSPEC ostream clog; |
|
86 # endif //_STLP_REDIRECT_STDSTREAMS |
|
87 |
|
88 # ifndef _STLP_NO_WCHAR_T |
|
89 # if defined(__SYMBIAN32__WSD__) || defined (__SYMBIAN32__NO_STATIC_IMPORTS__) |
|
90 _STLP_DECLSPEC wostream& get_wcerr(); |
|
91 _STLP_DECLSPEC wostream& get_wcout(); |
|
92 _STLP_DECLSPEC wostream& get_wclog(); |
|
93 _STLP_DECLSPEC wistream& get_wcin(); |
|
94 |
|
95 # if defined (__SYMBIAN32__WSD__) || !defined(_STLP_DESIGNATED_DLL) |
|
96 /* For the emulator, these definitions are used by the user as well as the STLPort library*/ |
|
97 /* For ARM platforms, user gets references to streams via function calls while the library uses the |
|
98 objects internally. |
|
99 */ |
|
100 #define wcerr get_wcerr() |
|
101 #define wcin get_wcin() |
|
102 #define wcout get_wcout() |
|
103 #define wclog get_wclog() |
|
104 # endif //__SYMBIAN32__WSD__ || _STLP_DESIGNATED_DLL |
|
105 #else //__SYMBIAN32__WSD__ |
|
106 extern _STLP_DECLSPEC wistream wcin; |
|
107 extern _STLP_DECLSPEC wostream wcout; |
|
108 extern _STLP_DECLSPEC wostream wcerr; |
|
109 extern _STLP_DECLSPEC wostream wclog; |
|
110 #endif //__SYMBIAN32__WSD__ || __SYMBIAN32__NO_STATIC_IMPORTS__ |
|
111 # endif //_STLP_NO_WCHAR_T |
|
112 |
|
113 _STLP_END_NAMESPACE |
|
114 |
|
115 //# elif defined ( _STLP_USE_NO_IOSTREAMS ) |
|
116 //# include <stl/_null_stream.h> |
|
117 |
|
118 # if (_STLP_OUTERMOST_HEADER_ID == 0x1037) |
|
119 # include <stl/_epilog.h> |
|
120 # undef _STLP_OUTERMOST_HEADER_ID |
|
121 # endif |
|
122 |
|
123 #endif /* _STLP_IOSTREAM */ |
|
124 |
|
125 // Local Variables: |
|
126 // mode:C++ |
|
127 // End: |