2 //===----------------------------------------------------------------------===//
4 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
5 // See https://llvm.org/LICENSE.txt for license information.
6 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
8 //===----------------------------------------------------------------------===//
21 typedef OFF_T streamoff;
22 typedef SZ_T streamsize;
23 template <class stateT> class fpos;
31 static constexpr fmtflags boolalpha;
32 static constexpr fmtflags dec;
33 static constexpr fmtflags fixed;
34 static constexpr fmtflags hex;
35 static constexpr fmtflags internal;
36 static constexpr fmtflags left;
37 static constexpr fmtflags oct;
38 static constexpr fmtflags right;
39 static constexpr fmtflags scientific;
40 static constexpr fmtflags showbase;
41 static constexpr fmtflags showpoint;
42 static constexpr fmtflags showpos;
43 static constexpr fmtflags skipws;
44 static constexpr fmtflags unitbuf;
45 static constexpr fmtflags uppercase;
46 static constexpr fmtflags adjustfield;
47 static constexpr fmtflags basefield;
48 static constexpr fmtflags floatfield;
51 static constexpr iostate badbit;
52 static constexpr iostate eofbit;
53 static constexpr iostate failbit;
54 static constexpr iostate goodbit;
57 static constexpr openmode app;
58 static constexpr openmode ate;
59 static constexpr openmode binary;
60 static constexpr openmode in;
61 static constexpr openmode out;
62 static constexpr openmode trunc;
65 static constexpr seekdir beg;
66 static constexpr seekdir cur;
67 static constexpr seekdir end;
71 // 27.5.2.2 fmtflags state:
72 fmtflags flags() const;
73 fmtflags flags(fmtflags fmtfl);
74 fmtflags setf(fmtflags fmtfl);
75 fmtflags setf(fmtflags fmtfl, fmtflags mask);
76 void unsetf(fmtflags mask);
78 streamsize precision() const;
79 streamsize precision(streamsize prec);
80 streamsize width() const;
81 streamsize width(streamsize wide);
84 locale imbue(const locale& loc);
85 locale getloc() const;
89 long& iword(int index);
90 void*& pword(int index);
95 // 27.5.2.6 callbacks;
96 enum event { erase_event, imbue_event, copyfmt_event };
97 typedef void (*event_callback)(event, ios_base&, int index);
98 void register_callback(event_callback fn, int index);
100 ios_base(const ios_base&) = delete;
101 ios_base& operator=(const ios_base&) = delete;
103 static bool sync_with_stdio(bool sync = true);
109 template <class charT, class traits = char_traits<charT> >
115 typedef charT char_type;
116 typedef typename traits::int_type int_type; // removed in C++17
117 typedef typename traits::pos_type pos_type; // removed in C++17
118 typedef typename traits::off_type off_type; // removed in C++17
119 typedef traits traits_type;
121 operator unspecified-bool-type() const;
122 bool operator!() const;
123 iostate rdstate() const;
124 void clear(iostate state = goodbit);
125 void setstate(iostate state);
131 iostate exceptions() const;
132 void exceptions(iostate except);
134 // 27.5.4.1 Constructor/destructor:
135 explicit basic_ios(basic_streambuf<charT,traits>* sb);
136 virtual ~basic_ios();
139 basic_ostream<charT,traits>* tie() const;
140 basic_ostream<charT,traits>* tie(basic_ostream<charT,traits>* tiestr);
142 basic_streambuf<charT,traits>* rdbuf() const;
143 basic_streambuf<charT,traits>* rdbuf(basic_streambuf<charT,traits>* sb);
145 basic_ios& copyfmt(const basic_ios& rhs);
147 char_type fill() const;
148 char_type fill(char_type ch);
150 locale imbue(const locale& loc);
152 char narrow(char_type c, char dfault) const;
153 char_type widen(char c) const;
155 basic_ios(const basic_ios& ) = delete;
156 basic_ios& operator=(const basic_ios&) = delete;
160 void init(basic_streambuf<charT,traits>* sb);
161 void move(basic_ios& rhs);
162 void swap(basic_ios& rhs) noexcept;
163 void set_rdbuf(basic_streambuf<charT, traits>* sb);
166 // 27.5.5, manipulators:
167 ios_base& boolalpha (ios_base& str);
168 ios_base& noboolalpha(ios_base& str);
169 ios_base& showbase (ios_base& str);
170 ios_base& noshowbase (ios_base& str);
171 ios_base& showpoint (ios_base& str);
172 ios_base& noshowpoint(ios_base& str);
173 ios_base& showpos (ios_base& str);
174 ios_base& noshowpos (ios_base& str);
175 ios_base& skipws (ios_base& str);
176 ios_base& noskipws (ios_base& str);
177 ios_base& uppercase (ios_base& str);
178 ios_base& nouppercase(ios_base& str);
179 ios_base& unitbuf (ios_base& str);
180 ios_base& nounitbuf (ios_base& str);
182 // 27.5.5.2 adjustfield:
183 ios_base& internal (ios_base& str);
184 ios_base& left (ios_base& str);
185 ios_base& right (ios_base& str);
187 // 27.5.5.3 basefield:
188 ios_base& dec (ios_base& str);
189 ios_base& hex (ios_base& str);
190 ios_base& oct (ios_base& str);
192 // 27.5.5.4 floatfield:
193 ios_base& fixed (ios_base& str);
194 ios_base& scientific (ios_base& str);
195 ios_base& hexfloat (ios_base& str);
196 ios_base& defaultfloat(ios_base& str);
198 // 27.5.5.5 error reporting:
204 concept_map ErrorCodeEnum<io_errc> { };
205 error_code make_error_code(io_errc e) noexcept;
206 error_condition make_error_condition(io_errc e) noexcept;
207 storage-class-specifier const error_category& iostream_category() noexcept;
216 #include <system_error>
219 #if !defined(_LIBCPP_HAS_NO_ATOMIC_HEADER)
220 #include <atomic> // for __xindex_
223 #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
224 #pragma GCC system_header
227 _LIBCPP_BEGIN_NAMESPACE_STD
229 typedef ptrdiff_t streamsize;
231 class _LIBCPP_TYPE_VIS ios_base
234 class _LIBCPP_EXCEPTION_ABI failure;
236 typedef unsigned int fmtflags;
237 static const fmtflags boolalpha = 0x0001;
238 static const fmtflags dec = 0x0002;
239 static const fmtflags fixed = 0x0004;
240 static const fmtflags hex = 0x0008;
241 static const fmtflags internal = 0x0010;
242 static const fmtflags left = 0x0020;
243 static const fmtflags oct = 0x0040;
244 static const fmtflags right = 0x0080;
245 static const fmtflags scientific = 0x0100;
246 static const fmtflags showbase = 0x0200;
247 static const fmtflags showpoint = 0x0400;
248 static const fmtflags showpos = 0x0800;
249 static const fmtflags skipws = 0x1000;
250 static const fmtflags unitbuf = 0x2000;
251 static const fmtflags uppercase = 0x4000;
252 static const fmtflags adjustfield = left | right | internal;
253 static const fmtflags basefield = dec | oct | hex;
254 static const fmtflags floatfield = scientific | fixed;
256 typedef unsigned int iostate;
257 static const iostate badbit = 0x1;
258 static const iostate eofbit = 0x2;
259 static const iostate failbit = 0x4;
260 static const iostate goodbit = 0x0;
262 typedef unsigned int openmode;
263 static const openmode app = 0x01;
264 static const openmode ate = 0x02;
265 static const openmode binary = 0x04;
266 static const openmode in = 0x08;
267 static const openmode out = 0x10;
268 static const openmode trunc = 0x20;
270 enum seekdir {beg, cur, end};
272 #if _LIBCPP_STD_VER <= 14
273 typedef iostate io_state;
274 typedef openmode open_mode;
275 typedef seekdir seek_dir;
277 typedef _VSTD::streamoff streamoff;
278 typedef _VSTD::streampos streampos;
281 class _LIBCPP_TYPE_VIS Init;
283 // 27.5.2.2 fmtflags state:
284 _LIBCPP_INLINE_VISIBILITY fmtflags flags() const;
285 _LIBCPP_INLINE_VISIBILITY fmtflags flags(fmtflags __fmtfl);
286 _LIBCPP_INLINE_VISIBILITY fmtflags setf(fmtflags __fmtfl);
287 _LIBCPP_INLINE_VISIBILITY fmtflags setf(fmtflags __fmtfl, fmtflags __mask);
288 _LIBCPP_INLINE_VISIBILITY void unsetf(fmtflags __mask);
290 _LIBCPP_INLINE_VISIBILITY streamsize precision() const;
291 _LIBCPP_INLINE_VISIBILITY streamsize precision(streamsize __prec);
292 _LIBCPP_INLINE_VISIBILITY streamsize width() const;
293 _LIBCPP_INLINE_VISIBILITY streamsize width(streamsize __wide);
296 locale imbue(const locale& __loc);
297 locale getloc() const;
301 long& iword(int __index);
302 void*& pword(int __index);
307 // 27.5.2.6 callbacks;
308 enum event { erase_event, imbue_event, copyfmt_event };
309 typedef void (*event_callback)(event, ios_base&, int __index);
310 void register_callback(event_callback __fn, int __index);
312 ios_base(const ios_base&) = delete;
313 ios_base& operator=(const ios_base&) = delete;
315 static bool sync_with_stdio(bool __sync = true);
317 _LIBCPP_INLINE_VISIBILITY iostate rdstate() const;
318 void clear(iostate __state = goodbit);
319 _LIBCPP_INLINE_VISIBILITY void setstate(iostate __state);
321 _LIBCPP_INLINE_VISIBILITY bool good() const;
322 _LIBCPP_INLINE_VISIBILITY bool eof() const;
323 _LIBCPP_INLINE_VISIBILITY bool fail() const;
324 _LIBCPP_INLINE_VISIBILITY bool bad() const;
326 _LIBCPP_INLINE_VISIBILITY iostate exceptions() const;
327 _LIBCPP_INLINE_VISIBILITY void exceptions(iostate __iostate);
329 void __set_badbit_and_consider_rethrow();
330 void __set_failbit_and_consider_rethrow();
332 _LIBCPP_INLINE_VISIBILITY
333 void __setstate_nothrow(iostate __state)
336 __rdstate_ |= __state;
338 __rdstate_ |= __state | ios_base::badbit;
342 _LIBCPP_INLINE_VISIBILITY
343 ios_base() {// purposefully does no initialization
346 void init(void* __sb);
347 _LIBCPP_INLINE_VISIBILITY void* rdbuf() const {return __rdbuf_;}
349 _LIBCPP_INLINE_VISIBILITY
350 void rdbuf(void* __sb)
356 void __call_callbacks(event);
357 void copyfmt(const ios_base&);
358 void move(ios_base&);
359 void swap(ios_base&) _NOEXCEPT;
361 _LIBCPP_INLINE_VISIBILITY
362 void set_rdbuf(void* __sb)
368 // All data members must be scalars
369 fmtflags __fmtflags_;
370 streamsize __precision_;
373 iostate __exceptions_;
376 event_callback* __fn_;
378 size_t __event_size_;
380 // TODO(EricWF): Enable this for both Clang and GCC. Currently it is only
381 // enabled with clang.
382 #if defined(_LIBCPP_HAS_C_ATOMIC_IMP) && !defined(_LIBCPP_HAS_NO_THREADS)
383 static atomic<int> __xindex_;
385 static int __xindex_;
388 size_t __iarray_size_;
389 size_t __iarray_cap_;
391 size_t __parray_size_;
392 size_t __parray_cap_;
396 _LIBCPP_DECLARE_STRONG_ENUM(io_errc)
400 _LIBCPP_DECLARE_STRONG_ENUM_EPILOG(io_errc)
403 struct _LIBCPP_TEMPLATE_VIS is_error_code_enum<io_errc> : public true_type { };
405 #ifdef _LIBCPP_HAS_NO_STRONG_ENUMS
407 struct _LIBCPP_TEMPLATE_VIS is_error_code_enum<io_errc::__lx> : public true_type { };
411 const error_category& iostream_category() _NOEXCEPT;
413 inline _LIBCPP_INLINE_VISIBILITY
415 make_error_code(io_errc __e) _NOEXCEPT
417 return error_code(static_cast<int>(__e), iostream_category());
420 inline _LIBCPP_INLINE_VISIBILITY
422 make_error_condition(io_errc __e) _NOEXCEPT
424 return error_condition(static_cast<int>(__e), iostream_category());
427 class _LIBCPP_EXCEPTION_ABI ios_base::failure
428 : public system_error
431 explicit failure(const string& __msg, const error_code& __ec = io_errc::stream);
432 explicit failure(const char* __msg, const error_code& __ec = io_errc::stream);
433 failure(const failure&) _NOEXCEPT = default;
434 virtual ~failure() _NOEXCEPT;
437 _LIBCPP_NORETURN inline _LIBCPP_INLINE_VISIBILITY
438 void __throw_failure(char const* __msg) {
439 #ifndef _LIBCPP_NO_EXCEPTIONS
440 throw ios_base::failure(__msg);
447 class _LIBCPP_TYPE_VIS ios_base::Init
456 inline _LIBCPP_INLINE_VISIBILITY
458 ios_base::flags() const
463 inline _LIBCPP_INLINE_VISIBILITY
465 ios_base::flags(fmtflags __fmtfl)
467 fmtflags __r = __fmtflags_;
468 __fmtflags_ = __fmtfl;
472 inline _LIBCPP_INLINE_VISIBILITY
474 ios_base::setf(fmtflags __fmtfl)
476 fmtflags __r = __fmtflags_;
477 __fmtflags_ |= __fmtfl;
481 inline _LIBCPP_INLINE_VISIBILITY
483 ios_base::unsetf(fmtflags __mask)
485 __fmtflags_ &= ~__mask;
488 inline _LIBCPP_INLINE_VISIBILITY
490 ios_base::setf(fmtflags __fmtfl, fmtflags __mask)
492 fmtflags __r = __fmtflags_;
494 __fmtflags_ |= __fmtfl & __mask;
500 inline _LIBCPP_INLINE_VISIBILITY
502 ios_base::precision() const
507 inline _LIBCPP_INLINE_VISIBILITY
509 ios_base::precision(streamsize __prec)
511 streamsize __r = __precision_;
512 __precision_ = __prec;
518 inline _LIBCPP_INLINE_VISIBILITY
520 ios_base::width() const
525 inline _LIBCPP_INLINE_VISIBILITY
527 ios_base::width(streamsize __wide)
529 streamsize __r = __width_;
536 inline _LIBCPP_INLINE_VISIBILITY
538 ios_base::rdstate() const
543 inline _LIBCPP_INLINE_VISIBILITY
545 ios_base::setstate(iostate __state)
547 clear(__rdstate_ | __state);
550 inline _LIBCPP_INLINE_VISIBILITY
552 ios_base::good() const
554 return __rdstate_ == 0;
557 inline _LIBCPP_INLINE_VISIBILITY
559 ios_base::eof() const
561 return (__rdstate_ & eofbit) != 0;
564 inline _LIBCPP_INLINE_VISIBILITY
566 ios_base::fail() const
568 return (__rdstate_ & (failbit | badbit)) != 0;
571 inline _LIBCPP_INLINE_VISIBILITY
573 ios_base::bad() const
575 return (__rdstate_ & badbit) != 0;
578 inline _LIBCPP_INLINE_VISIBILITY
580 ios_base::exceptions() const
582 return __exceptions_;
585 inline _LIBCPP_INLINE_VISIBILITY
587 ios_base::exceptions(iostate __iostate)
589 __exceptions_ = __iostate;
593 template <class _CharT, class _Traits>
594 class _LIBCPP_TEMPLATE_VIS basic_ios
599 typedef _CharT char_type;
600 typedef _Traits traits_type;
602 typedef typename traits_type::int_type int_type;
603 typedef typename traits_type::pos_type pos_type;
604 typedef typename traits_type::off_type off_type;
606 static_assert((is_same<_CharT, typename traits_type::char_type>::value),
607 "traits_type::char_type must be the same type as CharT");
609 #ifdef _LIBCPP_CXX03_LANG
610 // Preserve the ability to compare with literal 0,
611 // and implicitly convert to bool, but not implicitly convert to int.
612 _LIBCPP_INLINE_VISIBILITY
613 operator void*() const {return fail() ? nullptr : (void*)this;}
615 _LIBCPP_INLINE_VISIBILITY
616 explicit operator bool() const {return !fail();}
619 _LIBCPP_INLINE_VISIBILITY bool operator!() const {return fail();}
620 _LIBCPP_INLINE_VISIBILITY iostate rdstate() const {return ios_base::rdstate();}
621 _LIBCPP_INLINE_VISIBILITY void clear(iostate __state = goodbit) {ios_base::clear(__state);}
622 _LIBCPP_INLINE_VISIBILITY void setstate(iostate __state) {ios_base::setstate(__state);}
623 _LIBCPP_INLINE_VISIBILITY bool good() const {return ios_base::good();}
624 _LIBCPP_INLINE_VISIBILITY bool eof() const {return ios_base::eof();}
625 _LIBCPP_INLINE_VISIBILITY bool fail() const {return ios_base::fail();}
626 _LIBCPP_INLINE_VISIBILITY bool bad() const {return ios_base::bad();}
628 _LIBCPP_INLINE_VISIBILITY iostate exceptions() const {return ios_base::exceptions();}
629 _LIBCPP_INLINE_VISIBILITY void exceptions(iostate __iostate) {ios_base::exceptions(__iostate);}
631 // 27.5.4.1 Constructor/destructor:
632 _LIBCPP_INLINE_VISIBILITY
633 explicit basic_ios(basic_streambuf<char_type,traits_type>* __sb);
634 virtual ~basic_ios();
637 _LIBCPP_INLINE_VISIBILITY
638 basic_ostream<char_type, traits_type>* tie() const;
639 _LIBCPP_INLINE_VISIBILITY
640 basic_ostream<char_type, traits_type>* tie(basic_ostream<char_type, traits_type>* __tiestr);
642 _LIBCPP_INLINE_VISIBILITY
643 basic_streambuf<char_type, traits_type>* rdbuf() const;
644 _LIBCPP_INLINE_VISIBILITY
645 basic_streambuf<char_type, traits_type>* rdbuf(basic_streambuf<char_type, traits_type>* __sb);
647 basic_ios& copyfmt(const basic_ios& __rhs);
649 _LIBCPP_INLINE_VISIBILITY
650 char_type fill() const;
651 _LIBCPP_INLINE_VISIBILITY
652 char_type fill(char_type __ch);
654 _LIBCPP_INLINE_VISIBILITY
655 locale imbue(const locale& __loc);
657 _LIBCPP_INLINE_VISIBILITY
658 char narrow(char_type __c, char __dfault) const;
659 _LIBCPP_INLINE_VISIBILITY
660 char_type widen(char __c) const;
663 _LIBCPP_INLINE_VISIBILITY
664 basic_ios() {// purposefully does no initialization
666 _LIBCPP_INLINE_VISIBILITY
667 void init(basic_streambuf<char_type, traits_type>* __sb);
669 _LIBCPP_INLINE_VISIBILITY
670 void move(basic_ios& __rhs);
671 _LIBCPP_INLINE_VISIBILITY
672 void move(basic_ios&& __rhs) {move(__rhs);}
673 _LIBCPP_INLINE_VISIBILITY
674 void swap(basic_ios& __rhs) _NOEXCEPT;
675 _LIBCPP_INLINE_VISIBILITY
676 void set_rdbuf(basic_streambuf<char_type, traits_type>* __sb);
678 basic_ostream<char_type, traits_type>* __tie_;
679 mutable int_type __fill_;
682 template <class _CharT, class _Traits>
683 inline _LIBCPP_INLINE_VISIBILITY
684 basic_ios<_CharT, _Traits>::basic_ios(basic_streambuf<char_type,traits_type>* __sb)
689 template <class _CharT, class _Traits>
690 basic_ios<_CharT, _Traits>::~basic_ios()
694 template <class _CharT, class _Traits>
695 inline _LIBCPP_INLINE_VISIBILITY
697 basic_ios<_CharT, _Traits>::init(basic_streambuf<char_type, traits_type>* __sb)
699 ios_base::init(__sb);
701 __fill_ = traits_type::eof();
704 template <class _CharT, class _Traits>
705 inline _LIBCPP_INLINE_VISIBILITY
706 basic_ostream<_CharT, _Traits>*
707 basic_ios<_CharT, _Traits>::tie() const
712 template <class _CharT, class _Traits>
713 inline _LIBCPP_INLINE_VISIBILITY
714 basic_ostream<_CharT, _Traits>*
715 basic_ios<_CharT, _Traits>::tie(basic_ostream<char_type, traits_type>* __tiestr)
717 basic_ostream<char_type, traits_type>* __r = __tie_;
722 template <class _CharT, class _Traits>
723 inline _LIBCPP_INLINE_VISIBILITY
724 basic_streambuf<_CharT, _Traits>*
725 basic_ios<_CharT, _Traits>::rdbuf() const
727 return static_cast<basic_streambuf<char_type, traits_type>*>(ios_base::rdbuf());
730 template <class _CharT, class _Traits>
731 inline _LIBCPP_INLINE_VISIBILITY
732 basic_streambuf<_CharT, _Traits>*
733 basic_ios<_CharT, _Traits>::rdbuf(basic_streambuf<char_type, traits_type>* __sb)
735 basic_streambuf<char_type, traits_type>* __r = rdbuf();
736 ios_base::rdbuf(__sb);
740 template <class _CharT, class _Traits>
741 inline _LIBCPP_INLINE_VISIBILITY
743 basic_ios<_CharT, _Traits>::imbue(const locale& __loc)
745 locale __r = getloc();
746 ios_base::imbue(__loc);
748 rdbuf()->pubimbue(__loc);
752 template <class _CharT, class _Traits>
753 inline _LIBCPP_INLINE_VISIBILITY
755 basic_ios<_CharT, _Traits>::narrow(char_type __c, char __dfault) const
757 return use_facet<ctype<char_type> >(getloc()).narrow(__c, __dfault);
760 template <class _CharT, class _Traits>
761 inline _LIBCPP_INLINE_VISIBILITY
763 basic_ios<_CharT, _Traits>::widen(char __c) const
765 return use_facet<ctype<char_type> >(getloc()).widen(__c);
768 template <class _CharT, class _Traits>
769 inline _LIBCPP_INLINE_VISIBILITY
771 basic_ios<_CharT, _Traits>::fill() const
773 if (traits_type::eq_int_type(traits_type::eof(), __fill_))
774 __fill_ = widen(' ');
778 template <class _CharT, class _Traits>
779 inline _LIBCPP_INLINE_VISIBILITY
781 basic_ios<_CharT, _Traits>::fill(char_type __ch)
783 char_type __r = __fill_;
788 template <class _CharT, class _Traits>
789 basic_ios<_CharT, _Traits>&
790 basic_ios<_CharT, _Traits>::copyfmt(const basic_ios& __rhs)
794 __call_callbacks(erase_event);
795 ios_base::copyfmt(__rhs);
796 __tie_ = __rhs.__tie_;
797 __fill_ = __rhs.__fill_;
798 __call_callbacks(copyfmt_event);
799 exceptions(__rhs.exceptions());
804 template <class _CharT, class _Traits>
805 inline _LIBCPP_INLINE_VISIBILITY
807 basic_ios<_CharT, _Traits>::move(basic_ios& __rhs)
809 ios_base::move(__rhs);
810 __tie_ = __rhs.__tie_;
811 __rhs.__tie_ = nullptr;
812 __fill_ = __rhs.__fill_;
815 template <class _CharT, class _Traits>
816 inline _LIBCPP_INLINE_VISIBILITY
818 basic_ios<_CharT, _Traits>::swap(basic_ios& __rhs) _NOEXCEPT
820 ios_base::swap(__rhs);
821 _VSTD::swap(__tie_, __rhs.__tie_);
822 _VSTD::swap(__fill_, __rhs.__fill_);
825 template <class _CharT, class _Traits>
826 inline _LIBCPP_INLINE_VISIBILITY
828 basic_ios<_CharT, _Traits>::set_rdbuf(basic_streambuf<char_type, traits_type>* __sb)
830 ios_base::set_rdbuf(__sb);
835 boolalpha(ios_base& __str)
837 __str.setf(ios_base::boolalpha);
843 noboolalpha(ios_base& __str)
845 __str.unsetf(ios_base::boolalpha);
851 showbase(ios_base& __str)
853 __str.setf(ios_base::showbase);
859 noshowbase(ios_base& __str)
861 __str.unsetf(ios_base::showbase);
867 showpoint(ios_base& __str)
869 __str.setf(ios_base::showpoint);
875 noshowpoint(ios_base& __str)
877 __str.unsetf(ios_base::showpoint);
883 showpos(ios_base& __str)
885 __str.setf(ios_base::showpos);
891 noshowpos(ios_base& __str)
893 __str.unsetf(ios_base::showpos);
899 skipws(ios_base& __str)
901 __str.setf(ios_base::skipws);
907 noskipws(ios_base& __str)
909 __str.unsetf(ios_base::skipws);
915 uppercase(ios_base& __str)
917 __str.setf(ios_base::uppercase);
923 nouppercase(ios_base& __str)
925 __str.unsetf(ios_base::uppercase);
931 unitbuf(ios_base& __str)
933 __str.setf(ios_base::unitbuf);
939 nounitbuf(ios_base& __str)
941 __str.unsetf(ios_base::unitbuf);
947 internal(ios_base& __str)
949 __str.setf(ios_base::internal, ios_base::adjustfield);
955 left(ios_base& __str)
957 __str.setf(ios_base::left, ios_base::adjustfield);
963 right(ios_base& __str)
965 __str.setf(ios_base::right, ios_base::adjustfield);
973 __str.setf(ios_base::dec, ios_base::basefield);
981 __str.setf(ios_base::hex, ios_base::basefield);
989 __str.setf(ios_base::oct, ios_base::basefield);
995 fixed(ios_base& __str)
997 __str.setf(ios_base::fixed, ios_base::floatfield);
1003 scientific(ios_base& __str)
1005 __str.setf(ios_base::scientific, ios_base::floatfield);
1011 hexfloat(ios_base& __str)
1013 __str.setf(ios_base::fixed | ios_base::scientific, ios_base::floatfield);
1019 defaultfloat(ios_base& __str)
1021 __str.unsetf(ios_base::floatfield);
1025 _LIBCPP_END_NAMESPACE_STD
1027 #endif // _LIBCPP_IOS