2 //===---------------------------- ios -------------------------------------===//
4 // The LLVM Compiler Infrastructure
6 // This file is dual licensed under the MIT and the University of Illinois Open
7 // Source Licenses. See LICENSE.TXT for details.
9 //===----------------------------------------------------------------------===//
22 typedef OFF_T streamoff;
23 typedef SZ_T streamsize;
24 template <class stateT> class fpos;
32 static constexpr fmtflags boolalpha;
33 static constexpr fmtflags dec;
34 static constexpr fmtflags fixed;
35 static constexpr fmtflags hex;
36 static constexpr fmtflags internal;
37 static constexpr fmtflags left;
38 static constexpr fmtflags oct;
39 static constexpr fmtflags right;
40 static constexpr fmtflags scientific;
41 static constexpr fmtflags showbase;
42 static constexpr fmtflags showpoint;
43 static constexpr fmtflags showpos;
44 static constexpr fmtflags skipws;
45 static constexpr fmtflags unitbuf;
46 static constexpr fmtflags uppercase;
47 static constexpr fmtflags adjustfield;
48 static constexpr fmtflags basefield;
49 static constexpr fmtflags floatfield;
52 static constexpr iostate badbit;
53 static constexpr iostate eofbit;
54 static constexpr iostate failbit;
55 static constexpr iostate goodbit;
58 static constexpr openmode app;
59 static constexpr openmode ate;
60 static constexpr openmode binary;
61 static constexpr openmode in;
62 static constexpr openmode out;
63 static constexpr openmode trunc;
66 static constexpr seekdir beg;
67 static constexpr seekdir cur;
68 static constexpr seekdir end;
72 // 27.5.2.2 fmtflags state:
73 fmtflags flags() const;
74 fmtflags flags(fmtflags fmtfl);
75 fmtflags setf(fmtflags fmtfl);
76 fmtflags setf(fmtflags fmtfl, fmtflags mask);
77 void unsetf(fmtflags mask);
79 streamsize precision() const;
80 streamsize precision(streamsize prec);
81 streamsize width() const;
82 streamsize width(streamsize wide);
85 locale imbue(const locale& loc);
86 locale getloc() const;
90 long& iword(int index);
91 void*& pword(int index);
96 // 27.5.2.6 callbacks;
97 enum event { erase_event, imbue_event, copyfmt_event };
98 typedef void (*event_callback)(event, ios_base&, int index);
99 void register_callback(event_callback fn, int index);
101 ios_base(const ios_base&) = delete;
102 ios_base& operator=(const ios_base&) = delete;
104 static bool sync_with_stdio(bool sync = true);
110 template <class charT, class traits = char_traits<charT> >
116 typedef charT char_type;
117 typedef typename traits::int_type int_type; // removed in C++17
118 typedef typename traits::pos_type pos_type; // removed in C++17
119 typedef typename traits::off_type off_type; // removed in C++17
120 typedef traits traits_type;
122 operator unspecified-bool-type() const;
123 bool operator!() const;
124 iostate rdstate() const;
125 void clear(iostate state = goodbit);
126 void setstate(iostate state);
132 iostate exceptions() const;
133 void exceptions(iostate except);
135 // 27.5.4.1 Constructor/destructor:
136 explicit basic_ios(basic_streambuf<charT,traits>* sb);
137 virtual ~basic_ios();
140 basic_ostream<charT,traits>* tie() const;
141 basic_ostream<charT,traits>* tie(basic_ostream<charT,traits>* tiestr);
143 basic_streambuf<charT,traits>* rdbuf() const;
144 basic_streambuf<charT,traits>* rdbuf(basic_streambuf<charT,traits>* sb);
146 basic_ios& copyfmt(const basic_ios& rhs);
148 char_type fill() const;
149 char_type fill(char_type ch);
151 locale imbue(const locale& loc);
153 char narrow(char_type c, char dfault) const;
154 char_type widen(char c) const;
156 basic_ios(const basic_ios& ) = delete;
157 basic_ios& operator=(const basic_ios&) = delete;
161 void init(basic_streambuf<charT,traits>* sb);
162 void move(basic_ios& rhs);
163 void swap(basic_ios& rhs) noexcept;
164 void set_rdbuf(basic_streambuf<charT, traits>* sb);
167 // 27.5.5, manipulators:
168 ios_base& boolalpha (ios_base& str);
169 ios_base& noboolalpha(ios_base& str);
170 ios_base& showbase (ios_base& str);
171 ios_base& noshowbase (ios_base& str);
172 ios_base& showpoint (ios_base& str);
173 ios_base& noshowpoint(ios_base& str);
174 ios_base& showpos (ios_base& str);
175 ios_base& noshowpos (ios_base& str);
176 ios_base& skipws (ios_base& str);
177 ios_base& noskipws (ios_base& str);
178 ios_base& uppercase (ios_base& str);
179 ios_base& nouppercase(ios_base& str);
180 ios_base& unitbuf (ios_base& str);
181 ios_base& nounitbuf (ios_base& str);
183 // 27.5.5.2 adjustfield:
184 ios_base& internal (ios_base& str);
185 ios_base& left (ios_base& str);
186 ios_base& right (ios_base& str);
188 // 27.5.5.3 basefield:
189 ios_base& dec (ios_base& str);
190 ios_base& hex (ios_base& str);
191 ios_base& oct (ios_base& str);
193 // 27.5.5.4 floatfield:
194 ios_base& fixed (ios_base& str);
195 ios_base& scientific (ios_base& str);
196 ios_base& hexfloat (ios_base& str);
197 ios_base& defaultfloat(ios_base& str);
199 // 27.5.5.5 error reporting:
205 concept_map ErrorCodeEnum<io_errc> { };
206 error_code make_error_code(io_errc e) noexcept;
207 error_condition make_error_condition(io_errc e) noexcept;
208 storage-class-specifier const error_category& iostream_category() noexcept;
217 #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_TYPE_VIS 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);
313 ios_base(const ios_base&); // = delete;
314 ios_base& operator=(const ios_base&); // = delete;
317 static bool sync_with_stdio(bool __sync = true);
319 _LIBCPP_INLINE_VISIBILITY iostate rdstate() const;
320 void clear(iostate __state = goodbit);
321 _LIBCPP_INLINE_VISIBILITY void setstate(iostate __state);
323 _LIBCPP_INLINE_VISIBILITY bool good() const;
324 _LIBCPP_INLINE_VISIBILITY bool eof() const;
325 _LIBCPP_INLINE_VISIBILITY bool fail() const;
326 _LIBCPP_INLINE_VISIBILITY bool bad() const;
328 _LIBCPP_INLINE_VISIBILITY iostate exceptions() const;
329 _LIBCPP_INLINE_VISIBILITY void exceptions(iostate __iostate);
331 void __set_badbit_and_consider_rethrow();
332 void __set_failbit_and_consider_rethrow();
335 _LIBCPP_INLINE_VISIBILITY
336 ios_base() {// purposefully does no initialization
339 void init(void* __sb);
340 _LIBCPP_ALWAYS_INLINE void* rdbuf() const {return __rdbuf_;}
342 _LIBCPP_ALWAYS_INLINE
343 void rdbuf(void* __sb)
349 void __call_callbacks(event);
350 void copyfmt(const ios_base&);
351 void move(ios_base&);
352 void swap(ios_base&) _NOEXCEPT;
354 _LIBCPP_ALWAYS_INLINE
355 void set_rdbuf(void* __sb)
361 // All data members must be scalars
362 fmtflags __fmtflags_;
363 streamsize __precision_;
366 iostate __exceptions_;
369 event_callback* __fn_;
371 size_t __event_size_;
373 // TODO(EricWF): Enable this for both Clang and GCC. Currently it is only
374 // enabled with clang.
375 #if defined(_LIBCPP_HAS_C_ATOMIC_IMP) && !defined(_LIBCPP_HAS_NO_THREADS)
376 static atomic<int> __xindex_;
378 static int __xindex_;
381 size_t __iarray_size_;
382 size_t __iarray_cap_;
384 size_t __parray_size_;
385 size_t __parray_cap_;
389 _LIBCPP_DECLARE_STRONG_ENUM(io_errc)
393 _LIBCPP_DECLARE_STRONG_ENUM_EPILOG(io_errc)
396 struct _LIBCPP_TYPE_VIS_ONLY is_error_code_enum<io_errc> : public true_type { };
398 #ifdef _LIBCPP_HAS_NO_STRONG_ENUMS
400 struct _LIBCPP_TYPE_VIS_ONLY is_error_code_enum<io_errc::__lx> : public true_type { };
404 const error_category& iostream_category() _NOEXCEPT;
406 inline _LIBCPP_INLINE_VISIBILITY
408 make_error_code(io_errc __e) _NOEXCEPT
410 return error_code(static_cast<int>(__e), iostream_category());
413 inline _LIBCPP_INLINE_VISIBILITY
415 make_error_condition(io_errc __e) _NOEXCEPT
417 return error_condition(static_cast<int>(__e), iostream_category());
420 class _LIBCPP_EXCEPTION_ABI ios_base::failure
421 : public system_error
424 explicit failure(const string& __msg, const error_code& __ec = io_errc::stream);
425 explicit failure(const char* __msg, const error_code& __ec = io_errc::stream);
426 virtual ~failure() throw();
429 class _LIBCPP_TYPE_VIS ios_base::Init
438 inline _LIBCPP_INLINE_VISIBILITY
440 ios_base::flags() const
445 inline _LIBCPP_INLINE_VISIBILITY
447 ios_base::flags(fmtflags __fmtfl)
449 fmtflags __r = __fmtflags_;
450 __fmtflags_ = __fmtfl;
454 inline _LIBCPP_INLINE_VISIBILITY
456 ios_base::setf(fmtflags __fmtfl)
458 fmtflags __r = __fmtflags_;
459 __fmtflags_ |= __fmtfl;
463 inline _LIBCPP_INLINE_VISIBILITY
465 ios_base::unsetf(fmtflags __mask)
467 __fmtflags_ &= ~__mask;
470 inline _LIBCPP_INLINE_VISIBILITY
472 ios_base::setf(fmtflags __fmtfl, fmtflags __mask)
474 fmtflags __r = __fmtflags_;
476 __fmtflags_ |= __fmtfl & __mask;
482 inline _LIBCPP_INLINE_VISIBILITY
484 ios_base::precision() const
489 inline _LIBCPP_INLINE_VISIBILITY
491 ios_base::precision(streamsize __prec)
493 streamsize __r = __precision_;
494 __precision_ = __prec;
500 inline _LIBCPP_INLINE_VISIBILITY
502 ios_base::width() const
507 inline _LIBCPP_INLINE_VISIBILITY
509 ios_base::width(streamsize __wide)
511 streamsize __r = __width_;
518 inline _LIBCPP_INLINE_VISIBILITY
520 ios_base::rdstate() const
525 inline _LIBCPP_INLINE_VISIBILITY
527 ios_base::setstate(iostate __state)
529 clear(__rdstate_ | __state);
532 inline _LIBCPP_INLINE_VISIBILITY
534 ios_base::good() const
536 return __rdstate_ == 0;
539 inline _LIBCPP_INLINE_VISIBILITY
541 ios_base::eof() const
543 return (__rdstate_ & eofbit) != 0;
546 inline _LIBCPP_INLINE_VISIBILITY
548 ios_base::fail() const
550 return (__rdstate_ & (failbit | badbit)) != 0;
553 inline _LIBCPP_INLINE_VISIBILITY
555 ios_base::bad() const
557 return (__rdstate_ & badbit) != 0;
560 inline _LIBCPP_INLINE_VISIBILITY
562 ios_base::exceptions() const
564 return __exceptions_;
567 inline _LIBCPP_INLINE_VISIBILITY
569 ios_base::exceptions(iostate __iostate)
571 __exceptions_ = __iostate;
575 template <class _CharT, class _Traits>
576 class _LIBCPP_TYPE_VIS_ONLY basic_ios
581 typedef _CharT char_type;
582 typedef _Traits traits_type;
584 typedef typename traits_type::int_type int_type;
585 typedef typename traits_type::pos_type pos_type;
586 typedef typename traits_type::off_type off_type;
588 _LIBCPP_ALWAYS_INLINE
590 operator bool() const {return !fail();}
591 _LIBCPP_ALWAYS_INLINE bool operator!() const {return fail();}
592 _LIBCPP_ALWAYS_INLINE iostate rdstate() const {return ios_base::rdstate();}
593 _LIBCPP_ALWAYS_INLINE void clear(iostate __state = goodbit) {ios_base::clear(__state);}
594 _LIBCPP_ALWAYS_INLINE void setstate(iostate __state) {ios_base::setstate(__state);}
595 _LIBCPP_ALWAYS_INLINE bool good() const {return ios_base::good();}
596 _LIBCPP_ALWAYS_INLINE bool eof() const {return ios_base::eof();}
597 _LIBCPP_ALWAYS_INLINE bool fail() const {return ios_base::fail();}
598 _LIBCPP_ALWAYS_INLINE bool bad() const {return ios_base::bad();}
600 _LIBCPP_ALWAYS_INLINE iostate exceptions() const {return ios_base::exceptions();}
601 _LIBCPP_ALWAYS_INLINE void exceptions(iostate __iostate) {ios_base::exceptions(__iostate);}
603 // 27.5.4.1 Constructor/destructor:
604 _LIBCPP_INLINE_VISIBILITY
605 explicit basic_ios(basic_streambuf<char_type,traits_type>* __sb);
606 virtual ~basic_ios();
609 _LIBCPP_INLINE_VISIBILITY
610 basic_ostream<char_type, traits_type>* tie() const;
611 _LIBCPP_INLINE_VISIBILITY
612 basic_ostream<char_type, traits_type>* tie(basic_ostream<char_type, traits_type>* __tiestr);
614 _LIBCPP_INLINE_VISIBILITY
615 basic_streambuf<char_type, traits_type>* rdbuf() const;
616 _LIBCPP_INLINE_VISIBILITY
617 basic_streambuf<char_type, traits_type>* rdbuf(basic_streambuf<char_type, traits_type>* __sb);
619 basic_ios& copyfmt(const basic_ios& __rhs);
621 _LIBCPP_INLINE_VISIBILITY
622 char_type fill() const;
623 _LIBCPP_INLINE_VISIBILITY
624 char_type fill(char_type __ch);
626 _LIBCPP_INLINE_VISIBILITY
627 locale imbue(const locale& __loc);
629 _LIBCPP_INLINE_VISIBILITY
630 char narrow(char_type __c, char __dfault) const;
631 _LIBCPP_INLINE_VISIBILITY
632 char_type widen(char __c) const;
635 _LIBCPP_ALWAYS_INLINE
636 basic_ios() {// purposefully does no initialization
638 _LIBCPP_INLINE_VISIBILITY
639 void init(basic_streambuf<char_type, traits_type>* __sb);
641 _LIBCPP_INLINE_VISIBILITY
642 void move(basic_ios& __rhs);
643 #ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
644 _LIBCPP_ALWAYS_INLINE
645 void move(basic_ios&& __rhs) {move(__rhs);}
647 _LIBCPP_INLINE_VISIBILITY
648 void swap(basic_ios& __rhs) _NOEXCEPT;
649 _LIBCPP_INLINE_VISIBILITY
650 void set_rdbuf(basic_streambuf<char_type, traits_type>* __sb);
652 basic_ostream<char_type, traits_type>* __tie_;
653 mutable int_type __fill_;
656 template <class _CharT, class _Traits>
657 inline _LIBCPP_INLINE_VISIBILITY
658 basic_ios<_CharT, _Traits>::basic_ios(basic_streambuf<char_type,traits_type>* __sb)
663 template <class _CharT, class _Traits>
664 basic_ios<_CharT, _Traits>::~basic_ios()
668 template <class _CharT, class _Traits>
669 inline _LIBCPP_INLINE_VISIBILITY
671 basic_ios<_CharT, _Traits>::init(basic_streambuf<char_type, traits_type>* __sb)
673 ios_base::init(__sb);
675 __fill_ = traits_type::eof();
678 template <class _CharT, class _Traits>
679 inline _LIBCPP_INLINE_VISIBILITY
680 basic_ostream<_CharT, _Traits>*
681 basic_ios<_CharT, _Traits>::tie() const
686 template <class _CharT, class _Traits>
687 inline _LIBCPP_INLINE_VISIBILITY
688 basic_ostream<_CharT, _Traits>*
689 basic_ios<_CharT, _Traits>::tie(basic_ostream<char_type, traits_type>* __tiestr)
691 basic_ostream<char_type, traits_type>* __r = __tie_;
696 template <class _CharT, class _Traits>
697 inline _LIBCPP_INLINE_VISIBILITY
698 basic_streambuf<_CharT, _Traits>*
699 basic_ios<_CharT, _Traits>::rdbuf() const
701 return static_cast<basic_streambuf<char_type, traits_type>*>(ios_base::rdbuf());
704 template <class _CharT, class _Traits>
705 inline _LIBCPP_INLINE_VISIBILITY
706 basic_streambuf<_CharT, _Traits>*
707 basic_ios<_CharT, _Traits>::rdbuf(basic_streambuf<char_type, traits_type>* __sb)
709 basic_streambuf<char_type, traits_type>* __r = rdbuf();
710 ios_base::rdbuf(__sb);
714 template <class _CharT, class _Traits>
715 inline _LIBCPP_INLINE_VISIBILITY
717 basic_ios<_CharT, _Traits>::imbue(const locale& __loc)
719 locale __r = getloc();
720 ios_base::imbue(__loc);
722 rdbuf()->pubimbue(__loc);
726 template <class _CharT, class _Traits>
727 inline _LIBCPP_INLINE_VISIBILITY
729 basic_ios<_CharT, _Traits>::narrow(char_type __c, char __dfault) const
731 return use_facet<ctype<char_type> >(getloc()).narrow(__c, __dfault);
734 template <class _CharT, class _Traits>
735 inline _LIBCPP_INLINE_VISIBILITY
737 basic_ios<_CharT, _Traits>::widen(char __c) const
739 return use_facet<ctype<char_type> >(getloc()).widen(__c);
742 template <class _CharT, class _Traits>
743 inline _LIBCPP_INLINE_VISIBILITY
745 basic_ios<_CharT, _Traits>::fill() const
747 if (traits_type::eq_int_type(traits_type::eof(), __fill_))
748 __fill_ = widen(' ');
752 template <class _CharT, class _Traits>
753 inline _LIBCPP_INLINE_VISIBILITY
755 basic_ios<_CharT, _Traits>::fill(char_type __ch)
757 char_type __r = __fill_;
762 template <class _CharT, class _Traits>
763 basic_ios<_CharT, _Traits>&
764 basic_ios<_CharT, _Traits>::copyfmt(const basic_ios& __rhs)
768 __call_callbacks(erase_event);
769 ios_base::copyfmt(__rhs);
770 __tie_ = __rhs.__tie_;
771 __fill_ = __rhs.__fill_;
772 __call_callbacks(copyfmt_event);
773 exceptions(__rhs.exceptions());
778 template <class _CharT, class _Traits>
779 inline _LIBCPP_INLINE_VISIBILITY
781 basic_ios<_CharT, _Traits>::move(basic_ios& __rhs)
783 ios_base::move(__rhs);
784 __tie_ = __rhs.__tie_;
786 __fill_ = __rhs.__fill_;
789 template <class _CharT, class _Traits>
790 inline _LIBCPP_INLINE_VISIBILITY
792 basic_ios<_CharT, _Traits>::swap(basic_ios& __rhs) _NOEXCEPT
794 ios_base::swap(__rhs);
795 _VSTD::swap(__tie_, __rhs.__tie_);
796 _VSTD::swap(__fill_, __rhs.__fill_);
799 template <class _CharT, class _Traits>
800 inline _LIBCPP_INLINE_VISIBILITY
802 basic_ios<_CharT, _Traits>::set_rdbuf(basic_streambuf<char_type, traits_type>* __sb)
804 ios_base::set_rdbuf(__sb);
807 inline _LIBCPP_INLINE_VISIBILITY
809 boolalpha(ios_base& __str)
811 __str.setf(ios_base::boolalpha);
815 inline _LIBCPP_INLINE_VISIBILITY
817 noboolalpha(ios_base& __str)
819 __str.unsetf(ios_base::boolalpha);
823 inline _LIBCPP_INLINE_VISIBILITY
825 showbase(ios_base& __str)
827 __str.setf(ios_base::showbase);
831 inline _LIBCPP_INLINE_VISIBILITY
833 noshowbase(ios_base& __str)
835 __str.unsetf(ios_base::showbase);
839 inline _LIBCPP_INLINE_VISIBILITY
841 showpoint(ios_base& __str)
843 __str.setf(ios_base::showpoint);
847 inline _LIBCPP_INLINE_VISIBILITY
849 noshowpoint(ios_base& __str)
851 __str.unsetf(ios_base::showpoint);
855 inline _LIBCPP_INLINE_VISIBILITY
857 showpos(ios_base& __str)
859 __str.setf(ios_base::showpos);
863 inline _LIBCPP_INLINE_VISIBILITY
865 noshowpos(ios_base& __str)
867 __str.unsetf(ios_base::showpos);
871 inline _LIBCPP_INLINE_VISIBILITY
873 skipws(ios_base& __str)
875 __str.setf(ios_base::skipws);
879 inline _LIBCPP_INLINE_VISIBILITY
881 noskipws(ios_base& __str)
883 __str.unsetf(ios_base::skipws);
887 inline _LIBCPP_INLINE_VISIBILITY
889 uppercase(ios_base& __str)
891 __str.setf(ios_base::uppercase);
895 inline _LIBCPP_INLINE_VISIBILITY
897 nouppercase(ios_base& __str)
899 __str.unsetf(ios_base::uppercase);
903 inline _LIBCPP_INLINE_VISIBILITY
905 unitbuf(ios_base& __str)
907 __str.setf(ios_base::unitbuf);
911 inline _LIBCPP_INLINE_VISIBILITY
913 nounitbuf(ios_base& __str)
915 __str.unsetf(ios_base::unitbuf);
919 inline _LIBCPP_INLINE_VISIBILITY
921 internal(ios_base& __str)
923 __str.setf(ios_base::internal, ios_base::adjustfield);
927 inline _LIBCPP_INLINE_VISIBILITY
929 left(ios_base& __str)
931 __str.setf(ios_base::left, ios_base::adjustfield);
935 inline _LIBCPP_INLINE_VISIBILITY
937 right(ios_base& __str)
939 __str.setf(ios_base::right, ios_base::adjustfield);
943 inline _LIBCPP_INLINE_VISIBILITY
947 __str.setf(ios_base::dec, ios_base::basefield);
951 inline _LIBCPP_INLINE_VISIBILITY
955 __str.setf(ios_base::hex, ios_base::basefield);
959 inline _LIBCPP_INLINE_VISIBILITY
963 __str.setf(ios_base::oct, ios_base::basefield);
967 inline _LIBCPP_INLINE_VISIBILITY
969 fixed(ios_base& __str)
971 __str.setf(ios_base::fixed, ios_base::floatfield);
975 inline _LIBCPP_INLINE_VISIBILITY
977 scientific(ios_base& __str)
979 __str.setf(ios_base::scientific, ios_base::floatfield);
983 inline _LIBCPP_INLINE_VISIBILITY
985 hexfloat(ios_base& __str)
987 __str.setf(ios_base::fixed | ios_base::scientific, ios_base::floatfield);
991 inline _LIBCPP_INLINE_VISIBILITY
993 defaultfloat(ios_base& __str)
995 __str.unsetf(ios_base::floatfield);
999 template <class _CharT, class _Traits>
1002 typedef basic_ios<_CharT, _Traits> __stream_type;
1003 typedef typename __stream_type::fmtflags fmtflags;
1005 __stream_type& __stream_;
1006 fmtflags __fmtflags_;
1009 __save_flags(const __save_flags&);
1010 __save_flags& operator=(const __save_flags&);
1012 _LIBCPP_INLINE_VISIBILITY
1013 explicit __save_flags(__stream_type& __stream)
1014 : __stream_(__stream),
1015 __fmtflags_(__stream.flags()),
1016 __fill_(__stream.fill())
1018 _LIBCPP_INLINE_VISIBILITY
1021 __stream_.flags(__fmtflags_);
1022 __stream_.fill(__fill_);
1026 _LIBCPP_END_NAMESPACE_STD
1028 #endif // _LIBCPP_IOS