williamr@2
|
1 |
/*
|
williamr@2
|
2 |
* © Portions copyright (c) 2006-2007 Nokia Corporation. All rights reserved.
|
williamr@2
|
3 |
* Copyright (c) 1999
|
williamr@2
|
4 |
* Silicon Graphics Computer Systems, Inc.
|
williamr@2
|
5 |
*
|
williamr@2
|
6 |
* Copyright (c) 1999
|
williamr@2
|
7 |
* Boris Fomitchev
|
williamr@2
|
8 |
*
|
williamr@2
|
9 |
* This material is provided "as is", with absolutely no warranty expressed
|
williamr@2
|
10 |
* or implied. Any use is at your own risk.
|
williamr@2
|
11 |
*
|
williamr@2
|
12 |
* Permission to use or copy this software for any purpose is hereby granted
|
williamr@2
|
13 |
* without fee, provided the above notices are retained on all copies.
|
williamr@2
|
14 |
* Permission to modify the code and to distribute modified code is granted,
|
williamr@2
|
15 |
* provided the above notices are retained, and a notice that the code was
|
williamr@2
|
16 |
* modified is included with the above copyright notice.
|
williamr@2
|
17 |
*
|
williamr@2
|
18 |
*/
|
williamr@2
|
19 |
#ifndef _STLP_IOS_BASE_H
|
williamr@2
|
20 |
#define _STLP_IOS_BASE_H
|
williamr@2
|
21 |
|
williamr@2
|
22 |
#ifndef _STLP_STDEXCEPT
|
williamr@2
|
23 |
#include <stdexcept>
|
williamr@2
|
24 |
#endif
|
williamr@2
|
25 |
#ifndef _STLP_UTILITY
|
williamr@2
|
26 |
#include <utility>
|
williamr@2
|
27 |
#endif
|
williamr@2
|
28 |
#ifndef _STLP_INTERNAL_LOCALE_H
|
williamr@2
|
29 |
#include <stl/_locale.h>
|
williamr@2
|
30 |
#endif
|
williamr@2
|
31 |
#ifndef _STLP_STRING_H
|
williamr@2
|
32 |
# include <stl/_string.h>
|
williamr@2
|
33 |
#endif
|
williamr@2
|
34 |
|
williamr@2
|
35 |
_STLP_BEGIN_NAMESPACE
|
williamr@2
|
36 |
|
williamr@2
|
37 |
// ----------------------------------------------------------------------
|
williamr@2
|
38 |
|
williamr@2
|
39 |
// Class ios_base. This is the base class of the ios hierarchy, which
|
williamr@2
|
40 |
// includes basic_istream and basic_ostream. Classes in the ios
|
williamr@2
|
41 |
// hierarchy are actually quite simple: they are just glorified
|
williamr@2
|
42 |
// wrapper classes. They delegate buffering and physical character
|
williamr@2
|
43 |
// manipulation to the streambuf classes, and they delegate most
|
williamr@2
|
44 |
// formatting tasks to a locale.
|
williamr@2
|
45 |
|
williamr@2
|
46 |
#ifdef __SYMBIAN32__
|
williamr@2
|
47 |
class ios_base {
|
williamr@2
|
48 |
#else
|
williamr@2
|
49 |
class _STLP_CLASS_DECLSPEC ios_base {
|
williamr@2
|
50 |
#endif
|
williamr@2
|
51 |
public:
|
williamr@2
|
52 |
|
williamr@2
|
53 |
class _STLP_CLASS_DECLSPEC failure : public __Named_exception {
|
williamr@2
|
54 |
public:
|
williamr@2
|
55 |
_STLP_DECLSPEC explicit failure(const string&);
|
williamr@2
|
56 |
_STLP_DECLSPEC virtual ~failure() _STLP_NOTHROW_INHERENTLY;
|
williamr@2
|
57 |
};
|
williamr@2
|
58 |
|
williamr@2
|
59 |
typedef int fmtflags;
|
williamr@2
|
60 |
typedef int iostate;
|
williamr@2
|
61 |
typedef int openmode;
|
williamr@2
|
62 |
typedef int seekdir;
|
williamr@2
|
63 |
|
williamr@2
|
64 |
# ifndef _STLP_NO_ANACHRONISMS
|
williamr@2
|
65 |
typedef fmtflags fmt_flags;
|
williamr@2
|
66 |
# endif
|
williamr@2
|
67 |
|
williamr@2
|
68 |
// Formatting flags.
|
williamr@2
|
69 |
# ifdef _STLP_STATIC_CONST_INIT_BUG
|
williamr@2
|
70 |
enum {
|
williamr@2
|
71 |
# else
|
williamr@2
|
72 |
// boris : type for all those constants is int
|
williamr@2
|
73 |
static const int
|
williamr@2
|
74 |
# endif
|
williamr@2
|
75 |
left = 0x0001,
|
williamr@2
|
76 |
right = 0x0002,
|
williamr@2
|
77 |
internal = 0x0004,
|
williamr@2
|
78 |
dec = 0x0008,
|
williamr@2
|
79 |
hex = 0x0010,
|
williamr@2
|
80 |
oct = 0x0020,
|
williamr@2
|
81 |
fixed = 0x0040,
|
williamr@2
|
82 |
scientific = 0x0080,
|
williamr@2
|
83 |
boolalpha = 0x0100,
|
williamr@2
|
84 |
showbase = 0x0200,
|
williamr@2
|
85 |
showpoint = 0x0400,
|
williamr@2
|
86 |
showpos = 0x0800,
|
williamr@2
|
87 |
skipws = 0x1000,
|
williamr@2
|
88 |
unitbuf = 0x2000,
|
williamr@2
|
89 |
uppercase = 0x4000,
|
williamr@2
|
90 |
adjustfield = left | right | internal,
|
williamr@2
|
91 |
basefield = dec | hex | oct,
|
williamr@2
|
92 |
floatfield = scientific | fixed,
|
williamr@2
|
93 |
|
williamr@2
|
94 |
// State flags.
|
williamr@2
|
95 |
goodbit = 0x00,
|
williamr@2
|
96 |
badbit = 0x01,
|
williamr@2
|
97 |
eofbit = 0x02,
|
williamr@2
|
98 |
failbit = 0x04,
|
williamr@2
|
99 |
|
williamr@2
|
100 |
// Openmode flags.
|
williamr@2
|
101 |
__default_mode = 0x0, /* implementation detail */
|
williamr@2
|
102 |
app = 0x01,
|
williamr@2
|
103 |
ate = 0x02,
|
williamr@2
|
104 |
binary = 0x04,
|
williamr@2
|
105 |
in = 0x08,
|
williamr@2
|
106 |
out = 0x10,
|
williamr@2
|
107 |
trunc = 0x20,
|
williamr@2
|
108 |
|
williamr@2
|
109 |
// Seekdir flags
|
williamr@2
|
110 |
|
williamr@2
|
111 |
beg = 0x01,
|
williamr@2
|
112 |
cur = 0x02,
|
williamr@2
|
113 |
end = 0x04
|
williamr@2
|
114 |
# ifdef _STLP_STATIC_CONST_INIT_BUG
|
williamr@2
|
115 |
}
|
williamr@2
|
116 |
# endif
|
williamr@2
|
117 |
;
|
williamr@2
|
118 |
|
williamr@2
|
119 |
public: // Flag-manipulation functions.
|
williamr@2
|
120 |
fmtflags flags() const { return _M_fmtflags; }
|
williamr@2
|
121 |
fmtflags flags(fmtflags __flags) {
|
williamr@2
|
122 |
fmtflags __tmp = _M_fmtflags;
|
williamr@2
|
123 |
_M_fmtflags = __flags;
|
williamr@2
|
124 |
return __tmp;
|
williamr@2
|
125 |
}
|
williamr@2
|
126 |
|
williamr@2
|
127 |
fmtflags setf(fmtflags __flag) {
|
williamr@2
|
128 |
fmtflags __tmp = _M_fmtflags;
|
williamr@2
|
129 |
_M_fmtflags |= __flag;
|
williamr@2
|
130 |
return __tmp;
|
williamr@2
|
131 |
}
|
williamr@2
|
132 |
fmtflags setf(fmtflags __flag, fmtflags __mask) {
|
williamr@2
|
133 |
fmtflags __tmp = _M_fmtflags;
|
williamr@2
|
134 |
_M_fmtflags &= ~__mask;
|
williamr@2
|
135 |
_M_fmtflags |= __flag & __mask;
|
williamr@2
|
136 |
return __tmp;
|
williamr@2
|
137 |
}
|
williamr@2
|
138 |
void unsetf(fmtflags __mask) { _M_fmtflags &= ~__mask; }
|
williamr@2
|
139 |
|
williamr@2
|
140 |
streamsize precision() const { return _M_precision; }
|
williamr@2
|
141 |
streamsize precision(streamsize __newprecision) {
|
williamr@2
|
142 |
streamsize __tmp = _M_precision;
|
williamr@2
|
143 |
_M_precision = __newprecision;
|
williamr@2
|
144 |
return __tmp;
|
williamr@2
|
145 |
}
|
williamr@2
|
146 |
|
williamr@2
|
147 |
streamsize width() const { return _M_width; }
|
williamr@2
|
148 |
streamsize width(streamsize __newwidth) {
|
williamr@2
|
149 |
streamsize __tmp = _M_width;
|
williamr@2
|
150 |
_M_width = __newwidth;
|
williamr@2
|
151 |
return __tmp;
|
williamr@2
|
152 |
}
|
williamr@2
|
153 |
|
williamr@2
|
154 |
public: // Locales
|
williamr@2
|
155 |
_STLP_DECLSPEC locale imbue(const locale&);
|
williamr@2
|
156 |
_STLP_DECLSPEC locale getloc() const;// { return _M_locale; }
|
williamr@2
|
157 |
|
williamr@2
|
158 |
public: // Auxiliary storage.
|
williamr@2
|
159 |
_STLP_DECLSPEC static int _STLP_CALL xalloc();
|
williamr@2
|
160 |
_STLP_DECLSPEC long& iword(int __index);
|
williamr@2
|
161 |
_STLP_DECLSPEC void*& pword(int __index);
|
williamr@2
|
162 |
|
williamr@2
|
163 |
public: // Destructor.
|
williamr@2
|
164 |
_STLP_DECLSPEC virtual ~ios_base();
|
williamr@2
|
165 |
|
williamr@2
|
166 |
public: // Callbacks.
|
williamr@2
|
167 |
enum event { erase_event, imbue_event, copyfmt_event };
|
williamr@2
|
168 |
typedef void (*event_callback)(event, ios_base&, int __index);
|
williamr@2
|
169 |
_STLP_DECLSPEC void register_callback(event_callback __fn, int __index);
|
williamr@2
|
170 |
|
williamr@2
|
171 |
public: // This member function affects only
|
williamr@2
|
172 |
// the eight predefined ios objects:
|
williamr@2
|
173 |
// cin, cout, etc.
|
williamr@2
|
174 |
_STLP_DECLSPEC static bool _STLP_CALL sync_with_stdio(bool __sync = true);
|
williamr@2
|
175 |
|
williamr@2
|
176 |
public: // The C++ standard requires only that these
|
williamr@2
|
177 |
// member functions be defined in basic_ios.
|
williamr@2
|
178 |
// We define them in the non-template
|
williamr@2
|
179 |
// base class to avoid code duplication.
|
williamr@2
|
180 |
operator void*() const { return !fail() ? (void*) __CONST_CAST(ios_base*,this) : (void*) 0; }
|
williamr@2
|
181 |
bool operator!() const { return fail(); }
|
williamr@2
|
182 |
|
williamr@2
|
183 |
iostate rdstate() const { return _M_iostate; }
|
williamr@2
|
184 |
|
williamr@2
|
185 |
bool good() const { return _M_iostate == 0; }
|
williamr@2
|
186 |
bool eof() const { return (_M_iostate & eofbit) != 0; }
|
williamr@2
|
187 |
bool fail() const { return (_M_iostate & (failbit | badbit)) != 0; }
|
williamr@2
|
188 |
bool bad() const { return (_M_iostate & badbit) != 0; }
|
williamr@2
|
189 |
|
williamr@2
|
190 |
protected: // The functional protected interface.
|
williamr@2
|
191 |
|
williamr@2
|
192 |
// Copies the state of __x to *this. This member function makes it
|
williamr@2
|
193 |
// possible to implement basic_ios::copyfmt without having to expose
|
williamr@2
|
194 |
// ios_base's private data members. Does not copy _M_exception_mask
|
williamr@2
|
195 |
// or _M_iostate.
|
williamr@2
|
196 |
_STLP_DECLSPEC void _M_copy_state(const ios_base& __x);
|
williamr@2
|
197 |
|
williamr@2
|
198 |
void _M_setstate_nothrow(iostate __state) { _M_iostate |= __state; }
|
williamr@2
|
199 |
void _M_clear_nothrow(iostate __state) { _M_iostate = __state; }
|
williamr@2
|
200 |
iostate _M_get_exception_mask() const { return _M_exception_mask; }
|
williamr@2
|
201 |
void _M_set_exception_mask(iostate __mask) { _M_exception_mask = __mask; }
|
williamr@2
|
202 |
void _M_check_exception_mask() {
|
williamr@2
|
203 |
if (_M_iostate & _M_exception_mask)
|
williamr@2
|
204 |
_M_throw_failure();
|
williamr@2
|
205 |
}
|
williamr@2
|
206 |
|
williamr@2
|
207 |
_STLP_DECLSPEC void _M_invoke_callbacks(event);
|
williamr@2
|
208 |
_STLP_DECLSPEC void _M_throw_failure();
|
williamr@2
|
209 |
|
williamr@2
|
210 |
_STLP_DECLSPEC ios_base(); // Default constructor.
|
williamr@2
|
211 |
|
williamr@2
|
212 |
protected: // Initialization of the I/O system
|
williamr@2
|
213 |
static void _STLP_CALL _S_initialize();
|
williamr@2
|
214 |
static void _STLP_CALL _S_uninitialize();
|
williamr@2
|
215 |
# if !defined(__LIBSTD_CPP_SYMBIAN32_WSD__) && !defined(_STLP_LIBSTD_CPP_NO_STATIC_VAR_)
|
williamr@2
|
216 |
static bool _S_was_synced;
|
williamr@2
|
217 |
# endif //__LIBSTD_CPP_SYMBIAN32_WSD__
|
williamr@2
|
218 |
friend void CallIosInit();
|
williamr@2
|
219 |
private: // Invalidate the copy constructor and
|
williamr@2
|
220 |
// assignment operator.
|
williamr@2
|
221 |
ios_base(const ios_base&);
|
williamr@2
|
222 |
void operator=(const ios_base&);
|
williamr@2
|
223 |
|
williamr@2
|
224 |
private: // Data members.
|
williamr@2
|
225 |
|
williamr@2
|
226 |
fmtflags _M_fmtflags; // Flags
|
williamr@2
|
227 |
iostate _M_iostate;
|
williamr@2
|
228 |
openmode _M_openmode;
|
williamr@2
|
229 |
seekdir _M_seekdir;
|
williamr@2
|
230 |
iostate _M_exception_mask;
|
williamr@2
|
231 |
|
williamr@2
|
232 |
streamsize _M_precision;
|
williamr@2
|
233 |
streamsize _M_width;
|
williamr@2
|
234 |
|
williamr@2
|
235 |
locale _M_locale;
|
williamr@2
|
236 |
|
williamr@2
|
237 |
pair<event_callback, int>* _M_callbacks;
|
williamr@2
|
238 |
size_t _M_num_callbacks; // Size of the callback array.
|
williamr@2
|
239 |
size_t _M_callback_index; // Index of the next available callback;
|
williamr@2
|
240 |
// initially zero.
|
williamr@2
|
241 |
|
williamr@2
|
242 |
long* _M_iwords; // Auxiliary storage. The count is zero
|
williamr@2
|
243 |
size_t _M_num_iwords; // if and only if the pointer is null.
|
williamr@2
|
244 |
|
williamr@2
|
245 |
void** _M_pwords;
|
williamr@2
|
246 |
size_t _M_num_pwords;
|
williamr@2
|
247 |
|
williamr@2
|
248 |
# if !defined(__LIBSTD_CPP_SYMBIAN32_WSD__) && !defined(_STLP_LIBSTD_CPP_NO_STATIC_VAR_)
|
williamr@2
|
249 |
static int _S_index;
|
williamr@2
|
250 |
# endif //__LIBSTD_CPP_SYMBIAN32_WSD__
|
williamr@2
|
251 |
|
williamr@2
|
252 |
|
williamr@2
|
253 |
protected:
|
williamr@2
|
254 |
// Cached copies of the curent locale's facets. Set by init() and imbue().
|
williamr@2
|
255 |
locale::facet* _M_cached_ctype;
|
williamr@2
|
256 |
locale::facet* _M_cached_numpunct;
|
williamr@2
|
257 |
string _M_cached_grouping;
|
williamr@2
|
258 |
public:
|
williamr@2
|
259 |
// Equivalent to &use_facet< Facet >(getloc()), but faster.
|
williamr@2
|
260 |
const locale::facet* _M_ctype_facet() const { return _M_cached_ctype; }
|
williamr@2
|
261 |
const locale::facet* _M_numpunct_facet() const { return _M_cached_numpunct; }
|
williamr@2
|
262 |
const string& _M_grouping() const { return _M_cached_grouping; }
|
williamr@2
|
263 |
public:
|
williamr@2
|
264 |
|
williamr@2
|
265 |
// ----------------------------------------------------------------------
|
williamr@2
|
266 |
// Nested initializer class. This is an implementation detail, but it's
|
williamr@2
|
267 |
// prescribed by the standard. The static initializer object (on
|
williamr@2
|
268 |
// implementations where such a thing is required) is declared in
|
williamr@2
|
269 |
// <iostream>
|
williamr@2
|
270 |
|
williamr@2
|
271 |
class _STLP_CLASS_DECLSPEC Init {
|
williamr@2
|
272 |
public:
|
williamr@2
|
273 |
_STLP_DECLSPEC Init();
|
williamr@2
|
274 |
_STLP_DECLSPEC ~Init();
|
williamr@2
|
275 |
private:
|
williamr@2
|
276 |
# if !defined(__LIBSTD_CPP_SYMBIAN32_WSD__) && !defined(_STLP_LIBSTD_CPP_NO_STATIC_VAR_)
|
williamr@2
|
277 |
static long _S_count;
|
williamr@2
|
278 |
# endif //__LIBSTD_CPP_SYMBIAN32_WSD__
|
williamr@2
|
279 |
friend class ios_base;
|
williamr@2
|
280 |
};
|
williamr@2
|
281 |
|
williamr@2
|
282 |
// this class is needed to ensure locale initialization w/o <iostream> inclusion
|
williamr@2
|
283 |
class _STLP_CLASS_DECLSPEC _Loc_init {
|
williamr@2
|
284 |
public:
|
williamr@2
|
285 |
_STLP_DECLSPEC _Loc_init();
|
williamr@2
|
286 |
_STLP_DECLSPEC ~_Loc_init();
|
williamr@2
|
287 |
private:
|
williamr@2
|
288 |
# if !defined(__LIBSTD_CPP_SYMBIAN32_WSD__) && !defined(_STLP_LIBSTD_CPP_NO_STATIC_VAR_)
|
williamr@2
|
289 |
static long _S_count;
|
williamr@2
|
290 |
# endif //__LIBSTD_CPP_SYMBIAN32_WSD__
|
williamr@2
|
291 |
friend class locale;
|
williamr@2
|
292 |
friend class ios_base;
|
williamr@2
|
293 |
};
|
williamr@2
|
294 |
|
williamr@2
|
295 |
friend class Init;
|
williamr@2
|
296 |
|
williamr@2
|
297 |
public:
|
williamr@2
|
298 |
# ifndef _STLP_NO_ANACHRONISMS
|
williamr@2
|
299 |
// 31.6 Old iostreams members [depr.ios.members]
|
williamr@2
|
300 |
typedef iostate io_state;
|
williamr@2
|
301 |
typedef openmode open_mode;
|
williamr@2
|
302 |
typedef seekdir seek_dir;
|
williamr@2
|
303 |
typedef _STLP_STD::streamoff streamoff;
|
williamr@2
|
304 |
typedef _STLP_STD::streampos streampos;
|
williamr@2
|
305 |
# endif
|
williamr@2
|
306 |
};
|
williamr@2
|
307 |
|
williamr@2
|
308 |
inline _STLP_EXP_DECLSPEC locale ios_base::getloc() const
|
williamr@2
|
309 |
{
|
williamr@2
|
310 |
return _M_locale;
|
williamr@2
|
311 |
}
|
williamr@2
|
312 |
|
williamr@2
|
313 |
// ----------------------------------------------------------------------
|
williamr@2
|
314 |
// ios_base manipulator functions, from section 27.4.5 of the C++ standard.
|
williamr@2
|
315 |
// All of them are trivial one-line wrapper functions.
|
williamr@2
|
316 |
|
williamr@2
|
317 |
// fmtflag manipulators, section 27.4.5.1
|
williamr@2
|
318 |
inline ios_base& _STLP_CALL boolalpha(ios_base& __s)
|
williamr@2
|
319 |
{ __s.setf(ios_base::boolalpha); return __s;}
|
williamr@2
|
320 |
|
williamr@2
|
321 |
inline ios_base& _STLP_CALL noboolalpha(ios_base& __s)
|
williamr@2
|
322 |
{ __s.unsetf(ios_base::boolalpha); return __s;}
|
williamr@2
|
323 |
|
williamr@2
|
324 |
inline ios_base& _STLP_CALL showbase(ios_base& __s)
|
williamr@2
|
325 |
{ __s.setf(ios_base::showbase); return __s;}
|
williamr@2
|
326 |
|
williamr@2
|
327 |
inline ios_base& _STLP_CALL noshowbase(ios_base& __s)
|
williamr@2
|
328 |
{ __s.unsetf(ios_base::showbase); return __s;}
|
williamr@2
|
329 |
|
williamr@2
|
330 |
inline ios_base& _STLP_CALL showpoint(ios_base& __s)
|
williamr@2
|
331 |
{ __s.setf(ios_base::showpoint); return __s;}
|
williamr@2
|
332 |
|
williamr@2
|
333 |
inline ios_base& _STLP_CALL noshowpoint(ios_base& __s)
|
williamr@2
|
334 |
{ __s.unsetf(ios_base::showpoint); return __s;}
|
williamr@2
|
335 |
|
williamr@2
|
336 |
inline ios_base& _STLP_CALL showpos(ios_base& __s)
|
williamr@2
|
337 |
{ __s.setf(ios_base::showpos); return __s;}
|
williamr@2
|
338 |
|
williamr@2
|
339 |
inline ios_base& _STLP_CALL noshowpos(ios_base& __s)
|
williamr@2
|
340 |
{ __s.unsetf(ios_base::showpos); return __s;}
|
williamr@2
|
341 |
|
williamr@2
|
342 |
inline ios_base& _STLP_CALL skipws(ios_base& __s)
|
williamr@2
|
343 |
{ __s.setf(ios_base::skipws); return __s;}
|
williamr@2
|
344 |
|
williamr@2
|
345 |
inline ios_base& _STLP_CALL noskipws(ios_base& __s)
|
williamr@2
|
346 |
{ __s.unsetf(ios_base::skipws); return __s;}
|
williamr@2
|
347 |
|
williamr@2
|
348 |
inline ios_base& _STLP_CALL uppercase(ios_base& __s)
|
williamr@2
|
349 |
{ __s.setf(ios_base::uppercase); return __s;}
|
williamr@2
|
350 |
|
williamr@2
|
351 |
inline ios_base& _STLP_CALL nouppercase(ios_base& __s)
|
williamr@2
|
352 |
{ __s.unsetf(ios_base::uppercase); return __s;}
|
williamr@2
|
353 |
|
williamr@2
|
354 |
inline ios_base& _STLP_CALL unitbuf(ios_base& __s)
|
williamr@2
|
355 |
{ __s.setf(ios_base::unitbuf); return __s;}
|
williamr@2
|
356 |
|
williamr@2
|
357 |
inline ios_base& _STLP_CALL nounitbuf(ios_base& __s)
|
williamr@2
|
358 |
{ __s.unsetf(ios_base::unitbuf); return __s;}
|
williamr@2
|
359 |
|
williamr@2
|
360 |
|
williamr@2
|
361 |
// adjustfield manipulators, section 27.4.5.2
|
williamr@2
|
362 |
inline ios_base& _STLP_CALL internal(ios_base& __s)
|
williamr@2
|
363 |
{ __s.setf(ios_base::internal, ios_base::adjustfield); return __s; }
|
williamr@2
|
364 |
|
williamr@2
|
365 |
inline ios_base& _STLP_CALL left(ios_base& __s)
|
williamr@2
|
366 |
{ __s.setf(ios_base::left, ios_base::adjustfield); return __s; }
|
williamr@2
|
367 |
|
williamr@2
|
368 |
inline ios_base& _STLP_CALL right(ios_base& __s)
|
williamr@2
|
369 |
{ __s.setf(ios_base::right, ios_base::adjustfield); return __s; }
|
williamr@2
|
370 |
|
williamr@2
|
371 |
// basefield manipulators, section 27.4.5.3
|
williamr@2
|
372 |
inline ios_base& _STLP_CALL dec(ios_base& __s)
|
williamr@2
|
373 |
{ __s.setf(ios_base::dec, ios_base::basefield); return __s; }
|
williamr@2
|
374 |
|
williamr@2
|
375 |
inline ios_base& _STLP_CALL hex(ios_base& __s)
|
williamr@2
|
376 |
{ __s.setf(ios_base::hex, ios_base::basefield); return __s; }
|
williamr@2
|
377 |
|
williamr@2
|
378 |
inline ios_base& _STLP_CALL oct(ios_base& __s)
|
williamr@2
|
379 |
{ __s.setf(ios_base::oct, ios_base::basefield); return __s; }
|
williamr@2
|
380 |
|
williamr@2
|
381 |
|
williamr@2
|
382 |
// floatfield manipulators, section 27.4.5.3
|
williamr@2
|
383 |
inline ios_base& _STLP_CALL fixed(ios_base& __s)
|
williamr@2
|
384 |
{ __s.setf(ios_base::fixed, ios_base::floatfield); return __s; }
|
williamr@2
|
385 |
|
williamr@2
|
386 |
inline ios_base& _STLP_CALL scientific(ios_base& __s)
|
williamr@2
|
387 |
{ __s.setf(ios_base::scientific, ios_base::floatfield); return __s; }
|
williamr@2
|
388 |
|
williamr@2
|
389 |
#if defined(__BORLANDC__) && defined(_RTLDLL)
|
williamr@2
|
390 |
|
williamr@2
|
391 |
long ios_base::_Loc_init::_S_count = 0;
|
williamr@2
|
392 |
|
williamr@2
|
393 |
void _STLP_CALL _Stl_loc_init_num_put();
|
williamr@2
|
394 |
void _STLP_CALL _Stl_loc_init_num_get();
|
williamr@2
|
395 |
void _STLP_CALL _Stl_loc_init_monetary();
|
williamr@2
|
396 |
void _STLP_CALL _Stl_loc_init_time_facets();
|
williamr@2
|
397 |
|
williamr@2
|
398 |
inline ios_base::_Loc_init::_Loc_init() {
|
williamr@2
|
399 |
if (_S_count++ == 0) {
|
williamr@2
|
400 |
_Stl_loc_init_num_put();
|
williamr@2
|
401 |
_Stl_loc_init_num_get();
|
williamr@2
|
402 |
_Stl_loc_init_monetary();
|
williamr@2
|
403 |
_Stl_loc_init_time_facets();
|
williamr@2
|
404 |
locale::_S_initialize();
|
williamr@2
|
405 |
}
|
williamr@2
|
406 |
}
|
williamr@2
|
407 |
|
williamr@2
|
408 |
inline ios_base::_Loc_init::~_Loc_init() {
|
williamr@2
|
409 |
if (--_S_count == 0)
|
williamr@2
|
410 |
locale::_S_uninitialize();
|
williamr@2
|
411 |
}
|
williamr@2
|
412 |
|
williamr@2
|
413 |
#endif /* __BORLANDC__ */
|
williamr@2
|
414 |
|
williamr@2
|
415 |
#if 0
|
williamr@2
|
416 |
#ifdef __SYMBIAN32__
|
williamr@2
|
417 |
#pragma message("Symbian I/O stream support on progress.")
|
williamr@2
|
418 |
inline ios_base::_Loc_init::_Loc_init() {
|
williamr@2
|
419 |
}
|
williamr@2
|
420 |
|
williamr@2
|
421 |
inline ios_base::_Loc_init::~_Loc_init() {
|
williamr@2
|
422 |
}
|
williamr@2
|
423 |
#endif
|
williamr@2
|
424 |
|
williamr@2
|
425 |
inline ios_base::Init::Init() {
|
williamr@2
|
426 |
}
|
williamr@2
|
427 |
|
williamr@2
|
428 |
inline ios_base::Init::~Init() {
|
williamr@2
|
429 |
}
|
williamr@2
|
430 |
#endif
|
williamr@2
|
431 |
|
williamr@2
|
432 |
_STLP_END_NAMESPACE
|
williamr@2
|
433 |
|
williamr@2
|
434 |
#endif /* _STLP_IOS_BASE */
|
williamr@2
|
435 |
|
williamr@2
|
436 |
// Local Variables:
|
williamr@2
|
437 |
// mode:C++
|
williamr@2
|
438 |
// End:
|
williamr@2
|
439 |
|