ios revision 1.1 1 1.1 joerg // -*- C++ -*-
2 1.1 joerg //===---------------------------- ios -------------------------------------===//
3 1.1 joerg //
4 1.1 joerg // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
5 1.1 joerg // See https://llvm.org/LICENSE.txt for license information.
6 1.1 joerg // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 1.1 joerg //
8 1.1 joerg //===----------------------------------------------------------------------===//
9 1.1 joerg
10 1.1 joerg #ifndef _LIBCPP_IOS
11 1.1 joerg #define _LIBCPP_IOS
12 1.1 joerg
13 1.1 joerg /*
14 1.1 joerg ios synopsis
15 1.1 joerg
16 1.1 joerg #include <iosfwd>
17 1.1 joerg
18 1.1 joerg namespace std
19 1.1 joerg {
20 1.1 joerg
21 1.1 joerg typedef OFF_T streamoff;
22 1.1 joerg typedef SZ_T streamsize;
23 1.1 joerg template <class stateT> class fpos;
24 1.1 joerg
25 1.1 joerg class ios_base
26 1.1 joerg {
27 1.1 joerg public:
28 1.1 joerg class failure;
29 1.1 joerg
30 1.1 joerg typedef T1 fmtflags;
31 1.1 joerg static constexpr fmtflags boolalpha;
32 1.1 joerg static constexpr fmtflags dec;
33 1.1 joerg static constexpr fmtflags fixed;
34 1.1 joerg static constexpr fmtflags hex;
35 1.1 joerg static constexpr fmtflags internal;
36 1.1 joerg static constexpr fmtflags left;
37 1.1 joerg static constexpr fmtflags oct;
38 1.1 joerg static constexpr fmtflags right;
39 1.1 joerg static constexpr fmtflags scientific;
40 1.1 joerg static constexpr fmtflags showbase;
41 1.1 joerg static constexpr fmtflags showpoint;
42 1.1 joerg static constexpr fmtflags showpos;
43 1.1 joerg static constexpr fmtflags skipws;
44 1.1 joerg static constexpr fmtflags unitbuf;
45 1.1 joerg static constexpr fmtflags uppercase;
46 1.1 joerg static constexpr fmtflags adjustfield;
47 1.1 joerg static constexpr fmtflags basefield;
48 1.1 joerg static constexpr fmtflags floatfield;
49 1.1 joerg
50 1.1 joerg typedef T2 iostate;
51 1.1 joerg static constexpr iostate badbit;
52 1.1 joerg static constexpr iostate eofbit;
53 1.1 joerg static constexpr iostate failbit;
54 1.1 joerg static constexpr iostate goodbit;
55 1.1 joerg
56 1.1 joerg typedef T3 openmode;
57 1.1 joerg static constexpr openmode app;
58 1.1 joerg static constexpr openmode ate;
59 1.1 joerg static constexpr openmode binary;
60 1.1 joerg static constexpr openmode in;
61 1.1 joerg static constexpr openmode out;
62 1.1 joerg static constexpr openmode trunc;
63 1.1 joerg
64 1.1 joerg typedef T4 seekdir;
65 1.1 joerg static constexpr seekdir beg;
66 1.1 joerg static constexpr seekdir cur;
67 1.1 joerg static constexpr seekdir end;
68 1.1 joerg
69 1.1 joerg class Init;
70 1.1 joerg
71 1.1 joerg // 27.5.2.2 fmtflags state:
72 1.1 joerg fmtflags flags() const;
73 1.1 joerg fmtflags flags(fmtflags fmtfl);
74 1.1 joerg fmtflags setf(fmtflags fmtfl);
75 1.1 joerg fmtflags setf(fmtflags fmtfl, fmtflags mask);
76 1.1 joerg void unsetf(fmtflags mask);
77 1.1 joerg
78 1.1 joerg streamsize precision() const;
79 1.1 joerg streamsize precision(streamsize prec);
80 1.1 joerg streamsize width() const;
81 1.1 joerg streamsize width(streamsize wide);
82 1.1 joerg
83 1.1 joerg // 27.5.2.3 locales:
84 1.1 joerg locale imbue(const locale& loc);
85 1.1 joerg locale getloc() const;
86 1.1 joerg
87 1.1 joerg // 27.5.2.5 storage:
88 1.1 joerg static int xalloc();
89 1.1 joerg long& iword(int index);
90 1.1 joerg void*& pword(int index);
91 1.1 joerg
92 1.1 joerg // destructor
93 1.1 joerg virtual ~ios_base();
94 1.1 joerg
95 1.1 joerg // 27.5.2.6 callbacks;
96 1.1 joerg enum event { erase_event, imbue_event, copyfmt_event };
97 1.1 joerg typedef void (*event_callback)(event, ios_base&, int index);
98 1.1 joerg void register_callback(event_callback fn, int index);
99 1.1 joerg
100 1.1 joerg ios_base(const ios_base&) = delete;
101 1.1 joerg ios_base& operator=(const ios_base&) = delete;
102 1.1 joerg
103 1.1 joerg static bool sync_with_stdio(bool sync = true);
104 1.1 joerg
105 1.1 joerg protected:
106 1.1 joerg ios_base();
107 1.1 joerg };
108 1.1 joerg
109 1.1 joerg template <class charT, class traits = char_traits<charT> >
110 1.1 joerg class basic_ios
111 1.1 joerg : public ios_base
112 1.1 joerg {
113 1.1 joerg public:
114 1.1 joerg // types:
115 1.1 joerg typedef charT char_type;
116 1.1 joerg typedef typename traits::int_type int_type; // removed in C++17
117 1.1 joerg typedef typename traits::pos_type pos_type; // removed in C++17
118 1.1 joerg typedef typename traits::off_type off_type; // removed in C++17
119 1.1 joerg typedef traits traits_type;
120 1.1 joerg
121 1.1 joerg operator unspecified-bool-type() const;
122 1.1 joerg bool operator!() const;
123 1.1 joerg iostate rdstate() const;
124 1.1 joerg void clear(iostate state = goodbit);
125 1.1 joerg void setstate(iostate state);
126 1.1 joerg bool good() const;
127 1.1 joerg bool eof() const;
128 1.1 joerg bool fail() const;
129 1.1 joerg bool bad() const;
130 1.1 joerg
131 1.1 joerg iostate exceptions() const;
132 1.1 joerg void exceptions(iostate except);
133 1.1 joerg
134 1.1 joerg // 27.5.4.1 Constructor/destructor:
135 1.1 joerg explicit basic_ios(basic_streambuf<charT,traits>* sb);
136 1.1 joerg virtual ~basic_ios();
137 1.1 joerg
138 1.1 joerg // 27.5.4.2 Members:
139 1.1 joerg basic_ostream<charT,traits>* tie() const;
140 1.1 joerg basic_ostream<charT,traits>* tie(basic_ostream<charT,traits>* tiestr);
141 1.1 joerg
142 1.1 joerg basic_streambuf<charT,traits>* rdbuf() const;
143 1.1 joerg basic_streambuf<charT,traits>* rdbuf(basic_streambuf<charT,traits>* sb);
144 1.1 joerg
145 1.1 joerg basic_ios& copyfmt(const basic_ios& rhs);
146 1.1 joerg
147 1.1 joerg char_type fill() const;
148 1.1 joerg char_type fill(char_type ch);
149 1.1 joerg
150 1.1 joerg locale imbue(const locale& loc);
151 1.1 joerg
152 1.1 joerg char narrow(char_type c, char dfault) const;
153 1.1 joerg char_type widen(char c) const;
154 1.1 joerg
155 1.1 joerg basic_ios(const basic_ios& ) = delete;
156 1.1 joerg basic_ios& operator=(const basic_ios&) = delete;
157 1.1 joerg
158 1.1 joerg protected:
159 1.1 joerg basic_ios();
160 1.1 joerg void init(basic_streambuf<charT,traits>* sb);
161 1.1 joerg void move(basic_ios& rhs);
162 1.1 joerg void swap(basic_ios& rhs) noexcept;
163 1.1 joerg void set_rdbuf(basic_streambuf<charT, traits>* sb);
164 1.1 joerg };
165 1.1 joerg
166 1.1 joerg // 27.5.5, manipulators:
167 1.1 joerg ios_base& boolalpha (ios_base& str);
168 1.1 joerg ios_base& noboolalpha(ios_base& str);
169 1.1 joerg ios_base& showbase (ios_base& str);
170 1.1 joerg ios_base& noshowbase (ios_base& str);
171 1.1 joerg ios_base& showpoint (ios_base& str);
172 1.1 joerg ios_base& noshowpoint(ios_base& str);
173 1.1 joerg ios_base& showpos (ios_base& str);
174 1.1 joerg ios_base& noshowpos (ios_base& str);
175 1.1 joerg ios_base& skipws (ios_base& str);
176 1.1 joerg ios_base& noskipws (ios_base& str);
177 1.1 joerg ios_base& uppercase (ios_base& str);
178 1.1 joerg ios_base& nouppercase(ios_base& str);
179 1.1 joerg ios_base& unitbuf (ios_base& str);
180 1.1 joerg ios_base& nounitbuf (ios_base& str);
181 1.1 joerg
182 1.1 joerg // 27.5.5.2 adjustfield:
183 1.1 joerg ios_base& internal (ios_base& str);
184 1.1 joerg ios_base& left (ios_base& str);
185 1.1 joerg ios_base& right (ios_base& str);
186 1.1 joerg
187 1.1 joerg // 27.5.5.3 basefield:
188 1.1 joerg ios_base& dec (ios_base& str);
189 1.1 joerg ios_base& hex (ios_base& str);
190 1.1 joerg ios_base& oct (ios_base& str);
191 1.1 joerg
192 1.1 joerg // 27.5.5.4 floatfield:
193 1.1 joerg ios_base& fixed (ios_base& str);
194 1.1 joerg ios_base& scientific (ios_base& str);
195 1.1 joerg ios_base& hexfloat (ios_base& str);
196 1.1 joerg ios_base& defaultfloat(ios_base& str);
197 1.1 joerg
198 1.1 joerg // 27.5.5.5 error reporting:
199 1.1 joerg enum class io_errc
200 1.1 joerg {
201 1.1 joerg stream = 1
202 1.1 joerg };
203 1.1 joerg
204 1.1 joerg concept_map ErrorCodeEnum<io_errc> { };
205 1.1 joerg error_code make_error_code(io_errc e) noexcept;
206 1.1 joerg error_condition make_error_condition(io_errc e) noexcept;
207 1.1 joerg storage-class-specifier const error_category& iostream_category() noexcept;
208 1.1 joerg
209 1.1 joerg } // std
210 1.1 joerg
211 1.1 joerg */
212 1.1 joerg
213 1.1 joerg #include <__config>
214 1.1 joerg #include <iosfwd>
215 1.1 joerg #include <__locale>
216 1.1 joerg #include <system_error>
217 1.1 joerg
218 1.1 joerg #if !defined(_LIBCPP_HAS_NO_ATOMIC_HEADER)
219 1.1 joerg #include <atomic> // for __xindex_
220 1.1 joerg #endif
221 1.1 joerg
222 1.1 joerg #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
223 1.1 joerg #pragma GCC system_header
224 1.1 joerg #endif
225 1.1 joerg
226 1.1 joerg _LIBCPP_BEGIN_NAMESPACE_STD
227 1.1 joerg
228 1.1 joerg typedef ptrdiff_t streamsize;
229 1.1 joerg
230 1.1 joerg class _LIBCPP_TYPE_VIS ios_base
231 1.1 joerg {
232 1.1 joerg public:
233 1.1 joerg class _LIBCPP_EXCEPTION_ABI failure;
234 1.1 joerg
235 1.1 joerg typedef unsigned int fmtflags;
236 1.1 joerg static const fmtflags boolalpha = 0x0001;
237 1.1 joerg static const fmtflags dec = 0x0002;
238 1.1 joerg static const fmtflags fixed = 0x0004;
239 1.1 joerg static const fmtflags hex = 0x0008;
240 1.1 joerg static const fmtflags internal = 0x0010;
241 1.1 joerg static const fmtflags left = 0x0020;
242 1.1 joerg static const fmtflags oct = 0x0040;
243 1.1 joerg static const fmtflags right = 0x0080;
244 1.1 joerg static const fmtflags scientific = 0x0100;
245 1.1 joerg static const fmtflags showbase = 0x0200;
246 1.1 joerg static const fmtflags showpoint = 0x0400;
247 1.1 joerg static const fmtflags showpos = 0x0800;
248 1.1 joerg static const fmtflags skipws = 0x1000;
249 1.1 joerg static const fmtflags unitbuf = 0x2000;
250 1.1 joerg static const fmtflags uppercase = 0x4000;
251 1.1 joerg static const fmtflags adjustfield = left | right | internal;
252 1.1 joerg static const fmtflags basefield = dec | oct | hex;
253 1.1 joerg static const fmtflags floatfield = scientific | fixed;
254 1.1 joerg
255 1.1 joerg typedef unsigned int iostate;
256 1.1 joerg static const iostate badbit = 0x1;
257 1.1 joerg static const iostate eofbit = 0x2;
258 1.1 joerg static const iostate failbit = 0x4;
259 1.1 joerg static const iostate goodbit = 0x0;
260 1.1 joerg
261 1.1 joerg typedef unsigned int openmode;
262 1.1 joerg static const openmode app = 0x01;
263 1.1 joerg static const openmode ate = 0x02;
264 1.1 joerg static const openmode binary = 0x04;
265 1.1 joerg static const openmode in = 0x08;
266 1.1 joerg static const openmode out = 0x10;
267 1.1 joerg static const openmode trunc = 0x20;
268 1.1 joerg
269 1.1 joerg enum seekdir {beg, cur, end};
270 1.1 joerg
271 1.1 joerg #if _LIBCPP_STD_VER <= 14
272 1.1 joerg typedef iostate io_state;
273 1.1 joerg typedef openmode open_mode;
274 1.1 joerg typedef seekdir seek_dir;
275 1.1 joerg
276 1.1 joerg typedef _VSTD::streamoff streamoff;
277 1.1 joerg typedef _VSTD::streampos streampos;
278 1.1 joerg #endif
279 1.1 joerg
280 1.1 joerg class _LIBCPP_TYPE_VIS Init;
281 1.1 joerg
282 1.1 joerg // 27.5.2.2 fmtflags state:
283 1.1 joerg _LIBCPP_INLINE_VISIBILITY fmtflags flags() const;
284 1.1 joerg _LIBCPP_INLINE_VISIBILITY fmtflags flags(fmtflags __fmtfl);
285 1.1 joerg _LIBCPP_INLINE_VISIBILITY fmtflags setf(fmtflags __fmtfl);
286 1.1 joerg _LIBCPP_INLINE_VISIBILITY fmtflags setf(fmtflags __fmtfl, fmtflags __mask);
287 1.1 joerg _LIBCPP_INLINE_VISIBILITY void unsetf(fmtflags __mask);
288 1.1 joerg
289 1.1 joerg _LIBCPP_INLINE_VISIBILITY streamsize precision() const;
290 1.1 joerg _LIBCPP_INLINE_VISIBILITY streamsize precision(streamsize __prec);
291 1.1 joerg _LIBCPP_INLINE_VISIBILITY streamsize width() const;
292 1.1 joerg _LIBCPP_INLINE_VISIBILITY streamsize width(streamsize __wide);
293 1.1 joerg
294 1.1 joerg // 27.5.2.3 locales:
295 1.1 joerg locale imbue(const locale& __loc);
296 1.1 joerg locale getloc() const;
297 1.1 joerg
298 1.1 joerg // 27.5.2.5 storage:
299 1.1 joerg static int xalloc();
300 1.1 joerg long& iword(int __index);
301 1.1 joerg void*& pword(int __index);
302 1.1 joerg
303 1.1 joerg // destructor
304 1.1 joerg virtual ~ios_base();
305 1.1 joerg
306 1.1 joerg // 27.5.2.6 callbacks;
307 1.1 joerg enum event { erase_event, imbue_event, copyfmt_event };
308 1.1 joerg typedef void (*event_callback)(event, ios_base&, int __index);
309 1.1 joerg void register_callback(event_callback __fn, int __index);
310 1.1 joerg
311 1.1 joerg private:
312 1.1 joerg ios_base(const ios_base&); // = delete;
313 1.1 joerg ios_base& operator=(const ios_base&); // = delete;
314 1.1 joerg
315 1.1 joerg public:
316 1.1 joerg static bool sync_with_stdio(bool __sync = true);
317 1.1 joerg
318 1.1 joerg _LIBCPP_INLINE_VISIBILITY iostate rdstate() const;
319 1.1 joerg void clear(iostate __state = goodbit);
320 1.1 joerg _LIBCPP_INLINE_VISIBILITY void setstate(iostate __state);
321 1.1 joerg
322 1.1 joerg _LIBCPP_INLINE_VISIBILITY bool good() const;
323 1.1 joerg _LIBCPP_INLINE_VISIBILITY bool eof() const;
324 1.1 joerg _LIBCPP_INLINE_VISIBILITY bool fail() const;
325 1.1 joerg _LIBCPP_INLINE_VISIBILITY bool bad() const;
326 1.1 joerg
327 1.1 joerg _LIBCPP_INLINE_VISIBILITY iostate exceptions() const;
328 1.1 joerg _LIBCPP_INLINE_VISIBILITY void exceptions(iostate __iostate);
329 1.1 joerg
330 1.1 joerg void __set_badbit_and_consider_rethrow();
331 1.1 joerg void __set_failbit_and_consider_rethrow();
332 1.1 joerg
333 1.1 joerg _LIBCPP_INLINE_VISIBILITY
334 1.1 joerg void __setstate_nothrow(iostate __state)
335 1.1 joerg {
336 1.1 joerg if (__rdbuf_)
337 1.1 joerg __rdstate_ |= __state;
338 1.1 joerg else
339 1.1 joerg __rdstate_ |= __state | ios_base::badbit;
340 1.1 joerg }
341 1.1 joerg
342 1.1 joerg protected:
343 1.1 joerg _LIBCPP_INLINE_VISIBILITY
344 1.1 joerg ios_base() {// purposefully does no initialization
345 1.1 joerg }
346 1.1 joerg
347 1.1 joerg void init(void* __sb);
348 1.1 joerg _LIBCPP_INLINE_VISIBILITY void* rdbuf() const {return __rdbuf_;}
349 1.1 joerg
350 1.1 joerg _LIBCPP_INLINE_VISIBILITY
351 1.1 joerg void rdbuf(void* __sb)
352 1.1 joerg {
353 1.1 joerg __rdbuf_ = __sb;
354 1.1 joerg clear();
355 1.1 joerg }
356 1.1 joerg
357 1.1 joerg void __call_callbacks(event);
358 1.1 joerg void copyfmt(const ios_base&);
359 1.1 joerg void move(ios_base&);
360 1.1 joerg void swap(ios_base&) _NOEXCEPT;
361 1.1 joerg
362 1.1 joerg _LIBCPP_INLINE_VISIBILITY
363 1.1 joerg void set_rdbuf(void* __sb)
364 1.1 joerg {
365 1.1 joerg __rdbuf_ = __sb;
366 1.1 joerg }
367 1.1 joerg
368 1.1 joerg private:
369 1.1 joerg // All data members must be scalars
370 1.1 joerg fmtflags __fmtflags_;
371 1.1 joerg streamsize __precision_;
372 1.1 joerg streamsize __width_;
373 1.1 joerg iostate __rdstate_;
374 1.1 joerg iostate __exceptions_;
375 1.1 joerg void* __rdbuf_;
376 1.1 joerg void* __loc_;
377 1.1 joerg event_callback* __fn_;
378 1.1 joerg int* __index_;
379 1.1 joerg size_t __event_size_;
380 1.1 joerg size_t __event_cap_;
381 1.1 joerg // TODO(EricWF): Enable this for both Clang and GCC. Currently it is only
382 1.1 joerg // enabled with clang.
383 1.1 joerg #if defined(_LIBCPP_HAS_C_ATOMIC_IMP) && !defined(_LIBCPP_HAS_NO_THREADS)
384 1.1 joerg static atomic<int> __xindex_;
385 1.1 joerg #else
386 1.1 joerg static int __xindex_;
387 1.1 joerg #endif
388 1.1 joerg long* __iarray_;
389 1.1 joerg size_t __iarray_size_;
390 1.1 joerg size_t __iarray_cap_;
391 1.1 joerg void** __parray_;
392 1.1 joerg size_t __parray_size_;
393 1.1 joerg size_t __parray_cap_;
394 1.1 joerg };
395 1.1 joerg
396 1.1 joerg //enum class io_errc
397 1.1 joerg _LIBCPP_DECLARE_STRONG_ENUM(io_errc)
398 1.1 joerg {
399 1.1 joerg stream = 1
400 1.1 joerg };
401 1.1 joerg _LIBCPP_DECLARE_STRONG_ENUM_EPILOG(io_errc)
402 1.1 joerg
403 1.1 joerg template <>
404 1.1 joerg struct _LIBCPP_TEMPLATE_VIS is_error_code_enum<io_errc> : public true_type { };
405 1.1 joerg
406 1.1 joerg #ifdef _LIBCPP_HAS_NO_STRONG_ENUMS
407 1.1 joerg template <>
408 1.1 joerg struct _LIBCPP_TEMPLATE_VIS is_error_code_enum<io_errc::__lx> : public true_type { };
409 1.1 joerg #endif
410 1.1 joerg
411 1.1 joerg _LIBCPP_FUNC_VIS
412 1.1 joerg const error_category& iostream_category() _NOEXCEPT;
413 1.1 joerg
414 1.1 joerg inline _LIBCPP_INLINE_VISIBILITY
415 1.1 joerg error_code
416 1.1 joerg make_error_code(io_errc __e) _NOEXCEPT
417 1.1 joerg {
418 1.1 joerg return error_code(static_cast<int>(__e), iostream_category());
419 1.1 joerg }
420 1.1 joerg
421 1.1 joerg inline _LIBCPP_INLINE_VISIBILITY
422 1.1 joerg error_condition
423 1.1 joerg make_error_condition(io_errc __e) _NOEXCEPT
424 1.1 joerg {
425 1.1 joerg return error_condition(static_cast<int>(__e), iostream_category());
426 1.1 joerg }
427 1.1 joerg
428 1.1 joerg class _LIBCPP_EXCEPTION_ABI ios_base::failure
429 1.1 joerg : public system_error
430 1.1 joerg {
431 1.1 joerg public:
432 1.1 joerg explicit failure(const string& __msg, const error_code& __ec = io_errc::stream);
433 1.1 joerg explicit failure(const char* __msg, const error_code& __ec = io_errc::stream);
434 1.1 joerg failure(const failure&) _NOEXCEPT = default;
435 1.1 joerg virtual ~failure() _NOEXCEPT;
436 1.1 joerg };
437 1.1 joerg
438 1.1 joerg _LIBCPP_NORETURN inline _LIBCPP_INLINE_VISIBILITY
439 1.1 joerg void __throw_failure(char const* __msg) {
440 1.1 joerg #ifndef _LIBCPP_NO_EXCEPTIONS
441 1.1 joerg throw ios_base::failure(__msg);
442 1.1 joerg #else
443 1.1 joerg ((void)__msg);
444 1.1 joerg _VSTD::abort();
445 1.1 joerg #endif
446 1.1 joerg }
447 1.1 joerg
448 1.1 joerg class _LIBCPP_TYPE_VIS ios_base::Init
449 1.1 joerg {
450 1.1 joerg public:
451 1.1 joerg Init();
452 1.1 joerg ~Init();
453 1.1 joerg };
454 1.1 joerg
455 1.1 joerg // fmtflags
456 1.1 joerg
457 1.1 joerg inline _LIBCPP_INLINE_VISIBILITY
458 1.1 joerg ios_base::fmtflags
459 1.1 joerg ios_base::flags() const
460 1.1 joerg {
461 1.1 joerg return __fmtflags_;
462 1.1 joerg }
463 1.1 joerg
464 1.1 joerg inline _LIBCPP_INLINE_VISIBILITY
465 1.1 joerg ios_base::fmtflags
466 1.1 joerg ios_base::flags(fmtflags __fmtfl)
467 1.1 joerg {
468 1.1 joerg fmtflags __r = __fmtflags_;
469 1.1 joerg __fmtflags_ = __fmtfl;
470 1.1 joerg return __r;
471 1.1 joerg }
472 1.1 joerg
473 1.1 joerg inline _LIBCPP_INLINE_VISIBILITY
474 1.1 joerg ios_base::fmtflags
475 1.1 joerg ios_base::setf(fmtflags __fmtfl)
476 1.1 joerg {
477 1.1 joerg fmtflags __r = __fmtflags_;
478 1.1 joerg __fmtflags_ |= __fmtfl;
479 1.1 joerg return __r;
480 1.1 joerg }
481 1.1 joerg
482 1.1 joerg inline _LIBCPP_INLINE_VISIBILITY
483 1.1 joerg void
484 1.1 joerg ios_base::unsetf(fmtflags __mask)
485 1.1 joerg {
486 1.1 joerg __fmtflags_ &= ~__mask;
487 1.1 joerg }
488 1.1 joerg
489 1.1 joerg inline _LIBCPP_INLINE_VISIBILITY
490 1.1 joerg ios_base::fmtflags
491 1.1 joerg ios_base::setf(fmtflags __fmtfl, fmtflags __mask)
492 1.1 joerg {
493 1.1 joerg fmtflags __r = __fmtflags_;
494 1.1 joerg unsetf(__mask);
495 1.1 joerg __fmtflags_ |= __fmtfl & __mask;
496 1.1 joerg return __r;
497 1.1 joerg }
498 1.1 joerg
499 1.1 joerg // precision
500 1.1 joerg
501 1.1 joerg inline _LIBCPP_INLINE_VISIBILITY
502 1.1 joerg streamsize
503 1.1 joerg ios_base::precision() const
504 1.1 joerg {
505 1.1 joerg return __precision_;
506 1.1 joerg }
507 1.1 joerg
508 1.1 joerg inline _LIBCPP_INLINE_VISIBILITY
509 1.1 joerg streamsize
510 1.1 joerg ios_base::precision(streamsize __prec)
511 1.1 joerg {
512 1.1 joerg streamsize __r = __precision_;
513 1.1 joerg __precision_ = __prec;
514 1.1 joerg return __r;
515 1.1 joerg }
516 1.1 joerg
517 1.1 joerg // width
518 1.1 joerg
519 1.1 joerg inline _LIBCPP_INLINE_VISIBILITY
520 1.1 joerg streamsize
521 1.1 joerg ios_base::width() const
522 1.1 joerg {
523 1.1 joerg return __width_;
524 1.1 joerg }
525 1.1 joerg
526 1.1 joerg inline _LIBCPP_INLINE_VISIBILITY
527 1.1 joerg streamsize
528 1.1 joerg ios_base::width(streamsize __wide)
529 1.1 joerg {
530 1.1 joerg streamsize __r = __width_;
531 1.1 joerg __width_ = __wide;
532 1.1 joerg return __r;
533 1.1 joerg }
534 1.1 joerg
535 1.1 joerg // iostate
536 1.1 joerg
537 1.1 joerg inline _LIBCPP_INLINE_VISIBILITY
538 1.1 joerg ios_base::iostate
539 1.1 joerg ios_base::rdstate() const
540 1.1 joerg {
541 1.1 joerg return __rdstate_;
542 1.1 joerg }
543 1.1 joerg
544 1.1 joerg inline _LIBCPP_INLINE_VISIBILITY
545 1.1 joerg void
546 1.1 joerg ios_base::setstate(iostate __state)
547 1.1 joerg {
548 1.1 joerg clear(__rdstate_ | __state);
549 1.1 joerg }
550 1.1 joerg
551 1.1 joerg inline _LIBCPP_INLINE_VISIBILITY
552 1.1 joerg bool
553 1.1 joerg ios_base::good() const
554 1.1 joerg {
555 1.1 joerg return __rdstate_ == 0;
556 1.1 joerg }
557 1.1 joerg
558 1.1 joerg inline _LIBCPP_INLINE_VISIBILITY
559 1.1 joerg bool
560 1.1 joerg ios_base::eof() const
561 1.1 joerg {
562 1.1 joerg return (__rdstate_ & eofbit) != 0;
563 1.1 joerg }
564 1.1 joerg
565 1.1 joerg inline _LIBCPP_INLINE_VISIBILITY
566 1.1 joerg bool
567 1.1 joerg ios_base::fail() const
568 1.1 joerg {
569 1.1 joerg return (__rdstate_ & (failbit | badbit)) != 0;
570 1.1 joerg }
571 1.1 joerg
572 1.1 joerg inline _LIBCPP_INLINE_VISIBILITY
573 1.1 joerg bool
574 1.1 joerg ios_base::bad() const
575 1.1 joerg {
576 1.1 joerg return (__rdstate_ & badbit) != 0;
577 1.1 joerg }
578 1.1 joerg
579 1.1 joerg inline _LIBCPP_INLINE_VISIBILITY
580 1.1 joerg ios_base::iostate
581 1.1 joerg ios_base::exceptions() const
582 1.1 joerg {
583 1.1 joerg return __exceptions_;
584 1.1 joerg }
585 1.1 joerg
586 1.1 joerg inline _LIBCPP_INLINE_VISIBILITY
587 1.1 joerg void
588 1.1 joerg ios_base::exceptions(iostate __iostate)
589 1.1 joerg {
590 1.1 joerg __exceptions_ = __iostate;
591 1.1 joerg clear(__rdstate_);
592 1.1 joerg }
593 1.1 joerg
594 1.1 joerg #if defined(_LIBCPP_CXX03_LANG)
595 1.1 joerg struct _LIBCPP_TYPE_VIS __cxx03_bool {
596 1.1 joerg typedef void (__cxx03_bool::*__bool_type)();
597 1.1 joerg void __true_value() {}
598 1.1 joerg };
599 1.1 joerg #endif
600 1.1 joerg
601 1.1 joerg template <class _CharT, class _Traits>
602 1.1 joerg class _LIBCPP_TEMPLATE_VIS basic_ios
603 1.1 joerg : public ios_base
604 1.1 joerg {
605 1.1 joerg public:
606 1.1 joerg // types:
607 1.1 joerg typedef _CharT char_type;
608 1.1 joerg typedef _Traits traits_type;
609 1.1 joerg
610 1.1 joerg typedef typename traits_type::int_type int_type;
611 1.1 joerg typedef typename traits_type::pos_type pos_type;
612 1.1 joerg typedef typename traits_type::off_type off_type;
613 1.1 joerg
614 1.1 joerg static_assert((is_same<_CharT, typename traits_type::char_type>::value),
615 1.1 joerg "traits_type::char_type must be the same type as CharT");
616 1.1 joerg
617 1.1 joerg // __true_value will generate undefined references when linking unless
618 1.1 joerg // we give it internal linkage.
619 1.1 joerg
620 1.1 joerg #if defined(_LIBCPP_CXX03_LANG)
621 1.1 joerg _LIBCPP_INLINE_VISIBILITY
622 1.1 joerg operator __cxx03_bool::__bool_type() const {
623 1.1 joerg return !fail() ? &__cxx03_bool::__true_value : nullptr;
624 1.1 joerg }
625 1.1 joerg #else
626 1.1 joerg _LIBCPP_INLINE_VISIBILITY
627 1.1 joerg _LIBCPP_EXPLICIT operator bool() const {return !fail();}
628 1.1 joerg #endif
629 1.1 joerg
630 1.1 joerg _LIBCPP_INLINE_VISIBILITY bool operator!() const {return fail();}
631 1.1 joerg _LIBCPP_INLINE_VISIBILITY iostate rdstate() const {return ios_base::rdstate();}
632 1.1 joerg _LIBCPP_INLINE_VISIBILITY void clear(iostate __state = goodbit) {ios_base::clear(__state);}
633 1.1 joerg _LIBCPP_INLINE_VISIBILITY void setstate(iostate __state) {ios_base::setstate(__state);}
634 1.1 joerg _LIBCPP_INLINE_VISIBILITY bool good() const {return ios_base::good();}
635 1.1 joerg _LIBCPP_INLINE_VISIBILITY bool eof() const {return ios_base::eof();}
636 1.1 joerg _LIBCPP_INLINE_VISIBILITY bool fail() const {return ios_base::fail();}
637 1.1 joerg _LIBCPP_INLINE_VISIBILITY bool bad() const {return ios_base::bad();}
638 1.1 joerg
639 1.1 joerg _LIBCPP_INLINE_VISIBILITY iostate exceptions() const {return ios_base::exceptions();}
640 1.1 joerg _LIBCPP_INLINE_VISIBILITY void exceptions(iostate __iostate) {ios_base::exceptions(__iostate);}
641 1.1 joerg
642 1.1 joerg // 27.5.4.1 Constructor/destructor:
643 1.1 joerg _LIBCPP_INLINE_VISIBILITY
644 1.1 joerg explicit basic_ios(basic_streambuf<char_type,traits_type>* __sb);
645 1.1 joerg virtual ~basic_ios();
646 1.1 joerg
647 1.1 joerg // 27.5.4.2 Members:
648 1.1 joerg _LIBCPP_INLINE_VISIBILITY
649 1.1 joerg basic_ostream<char_type, traits_type>* tie() const;
650 1.1 joerg _LIBCPP_INLINE_VISIBILITY
651 1.1 joerg basic_ostream<char_type, traits_type>* tie(basic_ostream<char_type, traits_type>* __tiestr);
652 1.1 joerg
653 1.1 joerg _LIBCPP_INLINE_VISIBILITY
654 1.1 joerg basic_streambuf<char_type, traits_type>* rdbuf() const;
655 1.1 joerg _LIBCPP_INLINE_VISIBILITY
656 1.1 joerg basic_streambuf<char_type, traits_type>* rdbuf(basic_streambuf<char_type, traits_type>* __sb);
657 1.1 joerg
658 1.1 joerg basic_ios& copyfmt(const basic_ios& __rhs);
659 1.1 joerg
660 1.1 joerg _LIBCPP_INLINE_VISIBILITY
661 1.1 joerg char_type fill() const;
662 1.1 joerg _LIBCPP_INLINE_VISIBILITY
663 1.1 joerg char_type fill(char_type __ch);
664 1.1 joerg
665 1.1 joerg _LIBCPP_INLINE_VISIBILITY
666 1.1 joerg locale imbue(const locale& __loc);
667 1.1 joerg
668 1.1 joerg _LIBCPP_INLINE_VISIBILITY
669 1.1 joerg char narrow(char_type __c, char __dfault) const;
670 1.1 joerg _LIBCPP_INLINE_VISIBILITY
671 1.1 joerg char_type widen(char __c) const;
672 1.1 joerg
673 1.1 joerg protected:
674 1.1 joerg _LIBCPP_INLINE_VISIBILITY
675 1.1 joerg basic_ios() {// purposefully does no initialization
676 1.1 joerg }
677 1.1 joerg _LIBCPP_INLINE_VISIBILITY
678 1.1 joerg void init(basic_streambuf<char_type, traits_type>* __sb);
679 1.1 joerg
680 1.1 joerg _LIBCPP_INLINE_VISIBILITY
681 1.1 joerg void move(basic_ios& __rhs);
682 1.1 joerg #ifndef _LIBCPP_CXX03_LANG
683 1.1 joerg _LIBCPP_INLINE_VISIBILITY
684 1.1 joerg void move(basic_ios&& __rhs) {move(__rhs);}
685 1.1 joerg #endif
686 1.1 joerg _LIBCPP_INLINE_VISIBILITY
687 1.1 joerg void swap(basic_ios& __rhs) _NOEXCEPT;
688 1.1 joerg _LIBCPP_INLINE_VISIBILITY
689 1.1 joerg void set_rdbuf(basic_streambuf<char_type, traits_type>* __sb);
690 1.1 joerg private:
691 1.1 joerg basic_ostream<char_type, traits_type>* __tie_;
692 1.1 joerg mutable int_type __fill_;
693 1.1 joerg };
694 1.1 joerg
695 1.1 joerg template <class _CharT, class _Traits>
696 1.1 joerg inline _LIBCPP_INLINE_VISIBILITY
697 1.1 joerg basic_ios<_CharT, _Traits>::basic_ios(basic_streambuf<char_type,traits_type>* __sb)
698 1.1 joerg {
699 1.1 joerg init(__sb);
700 1.1 joerg }
701 1.1 joerg
702 1.1 joerg template <class _CharT, class _Traits>
703 1.1 joerg basic_ios<_CharT, _Traits>::~basic_ios()
704 1.1 joerg {
705 1.1 joerg }
706 1.1 joerg
707 1.1 joerg template <class _CharT, class _Traits>
708 1.1 joerg inline _LIBCPP_INLINE_VISIBILITY
709 1.1 joerg void
710 1.1 joerg basic_ios<_CharT, _Traits>::init(basic_streambuf<char_type, traits_type>* __sb)
711 1.1 joerg {
712 1.1 joerg ios_base::init(__sb);
713 1.1 joerg __tie_ = nullptr;
714 1.1 joerg __fill_ = traits_type::eof();
715 1.1 joerg }
716 1.1 joerg
717 1.1 joerg template <class _CharT, class _Traits>
718 1.1 joerg inline _LIBCPP_INLINE_VISIBILITY
719 1.1 joerg basic_ostream<_CharT, _Traits>*
720 1.1 joerg basic_ios<_CharT, _Traits>::tie() const
721 1.1 joerg {
722 1.1 joerg return __tie_;
723 1.1 joerg }
724 1.1 joerg
725 1.1 joerg template <class _CharT, class _Traits>
726 1.1 joerg inline _LIBCPP_INLINE_VISIBILITY
727 1.1 joerg basic_ostream<_CharT, _Traits>*
728 1.1 joerg basic_ios<_CharT, _Traits>::tie(basic_ostream<char_type, traits_type>* __tiestr)
729 1.1 joerg {
730 1.1 joerg basic_ostream<char_type, traits_type>* __r = __tie_;
731 1.1 joerg __tie_ = __tiestr;
732 1.1 joerg return __r;
733 1.1 joerg }
734 1.1 joerg
735 1.1 joerg template <class _CharT, class _Traits>
736 1.1 joerg inline _LIBCPP_INLINE_VISIBILITY
737 1.1 joerg basic_streambuf<_CharT, _Traits>*
738 1.1 joerg basic_ios<_CharT, _Traits>::rdbuf() const
739 1.1 joerg {
740 1.1 joerg return static_cast<basic_streambuf<char_type, traits_type>*>(ios_base::rdbuf());
741 1.1 joerg }
742 1.1 joerg
743 1.1 joerg template <class _CharT, class _Traits>
744 1.1 joerg inline _LIBCPP_INLINE_VISIBILITY
745 1.1 joerg basic_streambuf<_CharT, _Traits>*
746 1.1 joerg basic_ios<_CharT, _Traits>::rdbuf(basic_streambuf<char_type, traits_type>* __sb)
747 1.1 joerg {
748 1.1 joerg basic_streambuf<char_type, traits_type>* __r = rdbuf();
749 1.1 joerg ios_base::rdbuf(__sb);
750 1.1 joerg return __r;
751 1.1 joerg }
752 1.1 joerg
753 1.1 joerg template <class _CharT, class _Traits>
754 1.1 joerg inline _LIBCPP_INLINE_VISIBILITY
755 1.1 joerg locale
756 1.1 joerg basic_ios<_CharT, _Traits>::imbue(const locale& __loc)
757 1.1 joerg {
758 1.1 joerg locale __r = getloc();
759 1.1 joerg ios_base::imbue(__loc);
760 1.1 joerg if (rdbuf())
761 1.1 joerg rdbuf()->pubimbue(__loc);
762 1.1 joerg return __r;
763 1.1 joerg }
764 1.1 joerg
765 1.1 joerg template <class _CharT, class _Traits>
766 1.1 joerg inline _LIBCPP_INLINE_VISIBILITY
767 1.1 joerg char
768 1.1 joerg basic_ios<_CharT, _Traits>::narrow(char_type __c, char __dfault) const
769 1.1 joerg {
770 1.1 joerg return use_facet<ctype<char_type> >(getloc()).narrow(__c, __dfault);
771 1.1 joerg }
772 1.1 joerg
773 1.1 joerg template <class _CharT, class _Traits>
774 1.1 joerg inline _LIBCPP_INLINE_VISIBILITY
775 1.1 joerg _CharT
776 1.1 joerg basic_ios<_CharT, _Traits>::widen(char __c) const
777 1.1 joerg {
778 1.1 joerg return use_facet<ctype<char_type> >(getloc()).widen(__c);
779 1.1 joerg }
780 1.1 joerg
781 1.1 joerg template <class _CharT, class _Traits>
782 1.1 joerg inline _LIBCPP_INLINE_VISIBILITY
783 1.1 joerg _CharT
784 1.1 joerg basic_ios<_CharT, _Traits>::fill() const
785 1.1 joerg {
786 1.1 joerg if (traits_type::eq_int_type(traits_type::eof(), __fill_))
787 1.1 joerg __fill_ = widen(' ');
788 1.1 joerg return __fill_;
789 1.1 joerg }
790 1.1 joerg
791 1.1 joerg template <class _CharT, class _Traits>
792 1.1 joerg inline _LIBCPP_INLINE_VISIBILITY
793 1.1 joerg _CharT
794 1.1 joerg basic_ios<_CharT, _Traits>::fill(char_type __ch)
795 1.1 joerg {
796 1.1 joerg char_type __r = __fill_;
797 1.1 joerg __fill_ = __ch;
798 1.1 joerg return __r;
799 1.1 joerg }
800 1.1 joerg
801 1.1 joerg template <class _CharT, class _Traits>
802 1.1 joerg basic_ios<_CharT, _Traits>&
803 1.1 joerg basic_ios<_CharT, _Traits>::copyfmt(const basic_ios& __rhs)
804 1.1 joerg {
805 1.1 joerg if (this != &__rhs)
806 1.1 joerg {
807 1.1 joerg __call_callbacks(erase_event);
808 1.1 joerg ios_base::copyfmt(__rhs);
809 1.1 joerg __tie_ = __rhs.__tie_;
810 1.1 joerg __fill_ = __rhs.__fill_;
811 1.1 joerg __call_callbacks(copyfmt_event);
812 1.1 joerg exceptions(__rhs.exceptions());
813 1.1 joerg }
814 1.1 joerg return *this;
815 1.1 joerg }
816 1.1 joerg
817 1.1 joerg template <class _CharT, class _Traits>
818 1.1 joerg inline _LIBCPP_INLINE_VISIBILITY
819 1.1 joerg void
820 1.1 joerg basic_ios<_CharT, _Traits>::move(basic_ios& __rhs)
821 1.1 joerg {
822 1.1 joerg ios_base::move(__rhs);
823 1.1 joerg __tie_ = __rhs.__tie_;
824 1.1 joerg __rhs.__tie_ = nullptr;
825 1.1 joerg __fill_ = __rhs.__fill_;
826 1.1 joerg }
827 1.1 joerg
828 1.1 joerg template <class _CharT, class _Traits>
829 1.1 joerg inline _LIBCPP_INLINE_VISIBILITY
830 1.1 joerg void
831 1.1 joerg basic_ios<_CharT, _Traits>::swap(basic_ios& __rhs) _NOEXCEPT
832 1.1 joerg {
833 1.1 joerg ios_base::swap(__rhs);
834 1.1 joerg _VSTD::swap(__tie_, __rhs.__tie_);
835 1.1 joerg _VSTD::swap(__fill_, __rhs.__fill_);
836 1.1 joerg }
837 1.1 joerg
838 1.1 joerg template <class _CharT, class _Traits>
839 1.1 joerg inline _LIBCPP_INLINE_VISIBILITY
840 1.1 joerg void
841 1.1 joerg basic_ios<_CharT, _Traits>::set_rdbuf(basic_streambuf<char_type, traits_type>* __sb)
842 1.1 joerg {
843 1.1 joerg ios_base::set_rdbuf(__sb);
844 1.1 joerg }
845 1.1 joerg
846 1.1 joerg inline
847 1.1 joerg ios_base&
848 1.1 joerg boolalpha(ios_base& __str)
849 1.1 joerg {
850 1.1 joerg __str.setf(ios_base::boolalpha);
851 1.1 joerg return __str;
852 1.1 joerg }
853 1.1 joerg
854 1.1 joerg inline
855 1.1 joerg ios_base&
856 1.1 joerg noboolalpha(ios_base& __str)
857 1.1 joerg {
858 1.1 joerg __str.unsetf(ios_base::boolalpha);
859 1.1 joerg return __str;
860 1.1 joerg }
861 1.1 joerg
862 1.1 joerg inline
863 1.1 joerg ios_base&
864 1.1 joerg showbase(ios_base& __str)
865 1.1 joerg {
866 1.1 joerg __str.setf(ios_base::showbase);
867 1.1 joerg return __str;
868 1.1 joerg }
869 1.1 joerg
870 1.1 joerg inline
871 1.1 joerg ios_base&
872 1.1 joerg noshowbase(ios_base& __str)
873 1.1 joerg {
874 1.1 joerg __str.unsetf(ios_base::showbase);
875 1.1 joerg return __str;
876 1.1 joerg }
877 1.1 joerg
878 1.1 joerg inline
879 1.1 joerg ios_base&
880 1.1 joerg showpoint(ios_base& __str)
881 1.1 joerg {
882 1.1 joerg __str.setf(ios_base::showpoint);
883 1.1 joerg return __str;
884 1.1 joerg }
885 1.1 joerg
886 1.1 joerg inline
887 1.1 joerg ios_base&
888 1.1 joerg noshowpoint(ios_base& __str)
889 1.1 joerg {
890 1.1 joerg __str.unsetf(ios_base::showpoint);
891 1.1 joerg return __str;
892 1.1 joerg }
893 1.1 joerg
894 1.1 joerg inline
895 1.1 joerg ios_base&
896 1.1 joerg showpos(ios_base& __str)
897 1.1 joerg {
898 1.1 joerg __str.setf(ios_base::showpos);
899 1.1 joerg return __str;
900 1.1 joerg }
901 1.1 joerg
902 1.1 joerg inline
903 1.1 joerg ios_base&
904 1.1 joerg noshowpos(ios_base& __str)
905 1.1 joerg {
906 1.1 joerg __str.unsetf(ios_base::showpos);
907 1.1 joerg return __str;
908 1.1 joerg }
909 1.1 joerg
910 1.1 joerg inline
911 1.1 joerg ios_base&
912 1.1 joerg skipws(ios_base& __str)
913 1.1 joerg {
914 1.1 joerg __str.setf(ios_base::skipws);
915 1.1 joerg return __str;
916 1.1 joerg }
917 1.1 joerg
918 1.1 joerg inline
919 1.1 joerg ios_base&
920 1.1 joerg noskipws(ios_base& __str)
921 1.1 joerg {
922 1.1 joerg __str.unsetf(ios_base::skipws);
923 1.1 joerg return __str;
924 1.1 joerg }
925 1.1 joerg
926 1.1 joerg inline
927 1.1 joerg ios_base&
928 1.1 joerg uppercase(ios_base& __str)
929 1.1 joerg {
930 1.1 joerg __str.setf(ios_base::uppercase);
931 1.1 joerg return __str;
932 1.1 joerg }
933 1.1 joerg
934 1.1 joerg inline
935 1.1 joerg ios_base&
936 1.1 joerg nouppercase(ios_base& __str)
937 1.1 joerg {
938 1.1 joerg __str.unsetf(ios_base::uppercase);
939 1.1 joerg return __str;
940 1.1 joerg }
941 1.1 joerg
942 1.1 joerg inline
943 1.1 joerg ios_base&
944 1.1 joerg unitbuf(ios_base& __str)
945 1.1 joerg {
946 1.1 joerg __str.setf(ios_base::unitbuf);
947 1.1 joerg return __str;
948 1.1 joerg }
949 1.1 joerg
950 1.1 joerg inline
951 1.1 joerg ios_base&
952 1.1 joerg nounitbuf(ios_base& __str)
953 1.1 joerg {
954 1.1 joerg __str.unsetf(ios_base::unitbuf);
955 1.1 joerg return __str;
956 1.1 joerg }
957 1.1 joerg
958 1.1 joerg inline
959 1.1 joerg ios_base&
960 1.1 joerg internal(ios_base& __str)
961 1.1 joerg {
962 1.1 joerg __str.setf(ios_base::internal, ios_base::adjustfield);
963 1.1 joerg return __str;
964 1.1 joerg }
965 1.1 joerg
966 1.1 joerg inline
967 1.1 joerg ios_base&
968 1.1 joerg left(ios_base& __str)
969 1.1 joerg {
970 1.1 joerg __str.setf(ios_base::left, ios_base::adjustfield);
971 1.1 joerg return __str;
972 1.1 joerg }
973 1.1 joerg
974 1.1 joerg inline
975 1.1 joerg ios_base&
976 1.1 joerg right(ios_base& __str)
977 1.1 joerg {
978 1.1 joerg __str.setf(ios_base::right, ios_base::adjustfield);
979 1.1 joerg return __str;
980 1.1 joerg }
981 1.1 joerg
982 1.1 joerg inline
983 1.1 joerg ios_base&
984 1.1 joerg dec(ios_base& __str)
985 1.1 joerg {
986 1.1 joerg __str.setf(ios_base::dec, ios_base::basefield);
987 1.1 joerg return __str;
988 1.1 joerg }
989 1.1 joerg
990 1.1 joerg inline
991 1.1 joerg ios_base&
992 1.1 joerg hex(ios_base& __str)
993 1.1 joerg {
994 1.1 joerg __str.setf(ios_base::hex, ios_base::basefield);
995 1.1 joerg return __str;
996 1.1 joerg }
997 1.1 joerg
998 1.1 joerg inline
999 1.1 joerg ios_base&
1000 1.1 joerg oct(ios_base& __str)
1001 1.1 joerg {
1002 1.1 joerg __str.setf(ios_base::oct, ios_base::basefield);
1003 1.1 joerg return __str;
1004 1.1 joerg }
1005 1.1 joerg
1006 1.1 joerg inline
1007 1.1 joerg ios_base&
1008 1.1 joerg fixed(ios_base& __str)
1009 1.1 joerg {
1010 1.1 joerg __str.setf(ios_base::fixed, ios_base::floatfield);
1011 1.1 joerg return __str;
1012 1.1 joerg }
1013 1.1 joerg
1014 1.1 joerg inline
1015 1.1 joerg ios_base&
1016 1.1 joerg scientific(ios_base& __str)
1017 1.1 joerg {
1018 1.1 joerg __str.setf(ios_base::scientific, ios_base::floatfield);
1019 1.1 joerg return __str;
1020 1.1 joerg }
1021 1.1 joerg
1022 1.1 joerg inline
1023 1.1 joerg ios_base&
1024 1.1 joerg hexfloat(ios_base& __str)
1025 1.1 joerg {
1026 1.1 joerg __str.setf(ios_base::fixed | ios_base::scientific, ios_base::floatfield);
1027 1.1 joerg return __str;
1028 1.1 joerg }
1029 1.1 joerg
1030 1.1 joerg inline
1031 1.1 joerg ios_base&
1032 1.1 joerg defaultfloat(ios_base& __str)
1033 1.1 joerg {
1034 1.1 joerg __str.unsetf(ios_base::floatfield);
1035 1.1 joerg return __str;
1036 1.1 joerg }
1037 1.1 joerg
1038 1.1 joerg _LIBCPP_END_NAMESPACE_STD
1039 1.1 joerg
1040 1.1 joerg #endif // _LIBCPP_IOS
1041