2 //===---------------------------- ios -------------------------------------===//
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>
218 #if !defined(_LIBCPP_HAS_NO_ATOMIC_HEADER)
219 #include <atomic> // for __xindex_
222 #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
223 #pragma GCC system_header
226 _LIBCPP_BEGIN_NAMESPACE_STD
228 typedef ptrdiff_t streamsize;
230 class _LIBCPP_TYPE_VIS ios_base
233 class _LIBCPP_EXCEPTION_ABI failure;
235 typedef unsigned int fmtflags;
236 static const fmtflags boolalpha = 0x0001;
237 static const fmtflags dec = 0x0002;
238 static const fmtflags fixed = 0x0004;
239 static const fmtflags hex = 0x0008;
240 static const fmtflags internal = 0x0010;
241 static const fmtflags left = 0x0020;
242 static const fmtflags oct = 0x0040;
243 static const fmtflags right = 0x0080;
244 static const fmtflags scientific = 0x0100;
245 static const fmtflags showbase = 0x0200;
246 static const fmtflags showpoint = 0x0400;
247 static const fmtflags showpos = 0x0800;
248 static const fmtflags skipws = 0x1000;
249 static const fmtflags unitbuf = 0x2000;
250 static const fmtflags uppercase = 0x4000;
251 static const fmtflags adjustfield = left | right | internal;
252 static const fmtflags basefield = dec | oct | hex;
253 static const fmtflags floatfield = scientific | fixed;
255 typedef unsigned int iostate;
256 static const iostate badbit = 0x1;
257 static const iostate eofbit = 0x2;
258 static const iostate failbit = 0x4;
259 static const iostate goodbit = 0x0;
261 typedef unsigned int openmode;
262 static const openmode app = 0x01;
263 static const openmode ate = 0x02;
264 static const openmode binary = 0x04;
265 static const openmode in = 0x08;
266 static const openmode out = 0x10;
267 static const openmode trunc = 0x20;
269 enum seekdir {beg, cur, end};
271 #if _LIBCPP_STD_VER <= 14
272 typedef iostate io_state;
273 typedef openmode open_mode;
274 typedef seekdir seek_dir;
276 typedef _VSTD::streamoff streamoff;
277 typedef _VSTD::streampos streampos;
280 class _LIBCPP_TYPE_VIS Init;
282 // 27.5.2.2 fmtflags state:
283 _LIBCPP_INLINE_VISIBILITY fmtflags flags() const;
284 _LIBCPP_INLINE_VISIBILITY fmtflags flags(fmtflags __fmtfl);
285 _LIBCPP_INLINE_VISIBILITY fmtflags setf(fmtflags __fmtfl);
286 _LIBCPP_INLINE_VISIBILITY fmtflags setf(fmtflags __fmtfl, fmtflags __mask);
287 _LIBCPP_INLINE_VISIBILITY void unsetf(fmtflags __mask);
289 _LIBCPP_INLINE_VISIBILITY streamsize precision() const;
290 _LIBCPP_INLINE_VISIBILITY streamsize precision(streamsize __prec);
291 _LIBCPP_INLINE_VISIBILITY streamsize width() const;
292 _LIBCPP_INLINE_VISIBILITY streamsize width(streamsize __wide);
295 locale imbue(const locale& __loc);
296 locale getloc() const;
300 long& iword(int __index);
301 void*& pword(int __index);
306 // 27.5.2.6 callbacks;
307 enum event { erase_event, imbue_event, copyfmt_event };
308 typedef void (*event_callback)(event, ios_base&, int __index);
309 void register_callback(event_callback __fn, int __index);
312 ios_base(const ios_base&); // = delete;
313 ios_base& operator=(const ios_base&); // = delete;
316 static bool sync_with_stdio(bool __sync = true);
318 _LIBCPP_INLINE_VISIBILITY iostate rdstate() const;
319 void clear(iostate __state = goodbit);
320 _LIBCPP_INLINE_VISIBILITY void setstate(iostate __state);
322 _LIBCPP_INLINE_VISIBILITY bool good() const;
323 _LIBCPP_INLINE_VISIBILITY bool eof() const;
324 _LIBCPP_INLINE_VISIBILITY bool fail() const;
325 _LIBCPP_INLINE_VISIBILITY bool bad() const;
327 _LIBCPP_INLINE_VISIBILITY iostate exceptions() const;
328 _LIBCPP_INLINE_VISIBILITY void exceptions(iostate __iostate);
330 void __set_badbit_and_consider_rethrow();
331 void __set_failbit_and_consider_rethrow();
333 _LIBCPP_INLINE_VISIBILITY
334 void __setstate_nothrow(iostate __state)
337 __rdstate_ |= __state;
339 __rdstate_ |= __state | ios_base::badbit;
343 _LIBCPP_INLINE_VISIBILITY
344 ios_base() {// purposefully does no initialization
347 void init(void* __sb);
348 _LIBCPP_INLINE_VISIBILITY void* rdbuf() const {return __rdbuf_;}
350 _LIBCPP_INLINE_VISIBILITY
351 void rdbuf(void* __sb)
357 void __call_callbacks(event);
358 void copyfmt(const ios_base&);
359 void move(ios_base&);
360 void swap(ios_base&) _NOEXCEPT;
362 _LIBCPP_INLINE_VISIBILITY
363 void set_rdbuf(void* __sb)
369 // All data members must be scalars
370 fmtflags __fmtflags_;
371 streamsize __precision_;
374 iostate __exceptions_;
377 event_callback* __fn_;
379 size_t __event_size_;
381 // TODO(EricWF): Enable this for both Clang and GCC. Currently it is only
382 // enabled with clang.
383 #if defined(_LIBCPP_HAS_C_ATOMIC_IMP) && !defined(_LIBCPP_HAS_NO_THREADS)
384 static atomic<int> __xindex_;
386 static int __xindex_;
389 size_t __iarray_size_;
390 size_t __iarray_cap_;
392 size_t __parray_size_;
393 size_t __parray_cap_;
397 _LIBCPP_DECLARE_STRONG_ENUM(io_errc)
401 _LIBCPP_DECLARE_STRONG_ENUM_EPILOG(io_errc)
404 struct _LIBCPP_TEMPLATE_VIS is_error_code_enum<io_errc> : public true_type { };
406 #ifdef _LIBCPP_HAS_NO_STRONG_ENUMS
408 struct _LIBCPP_TEMPLATE_VIS is_error_code_enum<io_errc::__lx> : public true_type { };
412 const error_category& iostream_category() _NOEXCEPT;
414 inline _LIBCPP_INLINE_VISIBILITY
416 make_error_code(io_errc __e) _NOEXCEPT
418 return error_code(static_cast<int>(__e), iostream_category());
421 inline _LIBCPP_INLINE_VISIBILITY
423 make_error_condition(io_errc __e) _NOEXCEPT
425 return error_condition(static_cast<int>(__e), iostream_category());
428 class _LIBCPP_EXCEPTION_ABI ios_base::failure
429 : public system_error
432 explicit failure(const string& __msg, const error_code& __ec = io_errc::stream);
433 explicit failure(const char* __msg, const error_code& __ec = io_errc::stream);
434 failure(const failure&) _NOEXCEPT = default;
435 virtual ~failure() _NOEXCEPT;
438 _LIBCPP_NORETURN inline _LIBCPP_INLINE_VISIBILITY
439 void __throw_failure(char const* __msg) {
440 #ifndef _LIBCPP_NO_EXCEPTIONS
441 throw ios_base::failure(__msg);
448 class _LIBCPP_TYPE_VIS ios_base::Init
457 inline _LIBCPP_INLINE_VISIBILITY
459 ios_base::flags() const
464 inline _LIBCPP_INLINE_VISIBILITY
466 ios_base::flags(fmtflags __fmtfl)
468 fmtflags __r = __fmtflags_;
469 __fmtflags_ = __fmtfl;
473 inline _LIBCPP_INLINE_VISIBILITY
475 ios_base::setf(fmtflags __fmtfl)
477 fmtflags __r = __fmtflags_;
478 __fmtflags_ |= __fmtfl;
482 inline _LIBCPP_INLINE_VISIBILITY
484 ios_base::unsetf(fmtflags __mask)
486 __fmtflags_ &= ~__mask;
489 inline _LIBCPP_INLINE_VISIBILITY
491 ios_base::setf(fmtflags __fmtfl, fmtflags __mask)
493 fmtflags __r = __fmtflags_;
495 __fmtflags_ |= __fmtfl & __mask;
501 inline _LIBCPP_INLINE_VISIBILITY
503 ios_base::precision() const
508 inline _LIBCPP_INLINE_VISIBILITY
510 ios_base::precision(streamsize __prec)
512 streamsize __r = __precision_;
513 __precision_ = __prec;
519 inline _LIBCPP_INLINE_VISIBILITY
521 ios_base::width() const
526 inline _LIBCPP_INLINE_VISIBILITY
528 ios_base::width(streamsize __wide)
530 streamsize __r = __width_;
537 inline _LIBCPP_INLINE_VISIBILITY
539 ios_base::rdstate() const
544 inline _LIBCPP_INLINE_VISIBILITY
546 ios_base::setstate(iostate __state)
548 clear(__rdstate_ | __state);
551 inline _LIBCPP_INLINE_VISIBILITY
553 ios_base::good() const
555 return __rdstate_ == 0;
558 inline _LIBCPP_INLINE_VISIBILITY
560 ios_base::eof() const
562 return (__rdstate_ & eofbit) != 0;
565 inline _LIBCPP_INLINE_VISIBILITY
567 ios_base::fail() const
569 return (__rdstate_ & (failbit | badbit)) != 0;
572 inline _LIBCPP_INLINE_VISIBILITY
574 ios_base::bad() const
576 return (__rdstate_ & badbit) != 0;
579 inline _LIBCPP_INLINE_VISIBILITY
581 ios_base::exceptions() const
583 return __exceptions_;
586 inline _LIBCPP_INLINE_VISIBILITY
588 ios_base::exceptions(iostate __iostate)
590 __exceptions_ = __iostate;
594 #if defined(_LIBCPP_CXX03_LANG)
595 struct _LIBCPP_TYPE_VIS __cxx03_bool {
596 typedef void (__cxx03_bool::*__bool_type)();
597 void __true_value() {}
601 template <class _CharT, class _Traits>
602 class _LIBCPP_TEMPLATE_VIS basic_ios
607 typedef _CharT char_type;
608 typedef _Traits traits_type;
610 typedef typename traits_type::int_type int_type;
611 typedef typename traits_type::pos_type pos_type;
612 typedef typename traits_type::off_type off_type;
614 static_assert((is_same<_CharT, typename traits_type::char_type>::value),
615 "traits_type::char_type must be the same type as CharT");
617 // __true_value will generate undefined references when linking unless
618 // we give it internal linkage.
620 #if defined(_LIBCPP_CXX03_LANG)
621 _LIBCPP_INLINE_VISIBILITY
622 operator __cxx03_bool::__bool_type() const {
623 return !fail() ? &__cxx03_bool::__true_value : nullptr;
626 _LIBCPP_INLINE_VISIBILITY
627 _LIBCPP_EXPLICIT operator bool() const {return !fail();}
630 _LIBCPP_INLINE_VISIBILITY bool operator!() const {return fail();}
631 _LIBCPP_INLINE_VISIBILITY iostate rdstate() const {return ios_base::rdstate();}
632 _LIBCPP_INLINE_VISIBILITY void clear(iostate __state = goodbit) {ios_base::clear(__state);}
633 _LIBCPP_INLINE_VISIBILITY void setstate(iostate __state) {ios_base::setstate(__state);}
634 _LIBCPP_INLINE_VISIBILITY bool good() const {return ios_base::good();}
635 _LIBCPP_INLINE_VISIBILITY bool eof() const {return ios_base::eof();}
636 _LIBCPP_INLINE_VISIBILITY bool fail() const {return ios_base::fail();}
637 _LIBCPP_INLINE_VISIBILITY bool bad() const {return ios_base::bad();}
639 _LIBCPP_INLINE_VISIBILITY iostate exceptions() const {return ios_base::exceptions();}
640 _LIBCPP_INLINE_VISIBILITY void exceptions(iostate __iostate) {ios_base::exceptions(__iostate);}
642 // 27.5.4.1 Constructor/destructor:
643 _LIBCPP_INLINE_VISIBILITY
644 explicit basic_ios(basic_streambuf<char_type,traits_type>* __sb);
645 virtual ~basic_ios();
648 _LIBCPP_INLINE_VISIBILITY
649 basic_ostream<char_type, traits_type>* tie() const;
650 _LIBCPP_INLINE_VISIBILITY
651 basic_ostream<char_type, traits_type>* tie(basic_ostream<char_type, traits_type>* __tiestr);
653 _LIBCPP_INLINE_VISIBILITY
654 basic_streambuf<char_type, traits_type>* rdbuf() const;
655 _LIBCPP_INLINE_VISIBILITY
656 basic_streambuf<char_type, traits_type>* rdbuf(basic_streambuf<char_type, traits_type>* __sb);
658 basic_ios& copyfmt(const basic_ios& __rhs);
660 _LIBCPP_INLINE_VISIBILITY
661 char_type fill() const;
662 _LIBCPP_INLINE_VISIBILITY
663 char_type fill(char_type __ch);
665 _LIBCPP_INLINE_VISIBILITY
666 locale imbue(const locale& __loc);
668 _LIBCPP_INLINE_VISIBILITY
669 char narrow(char_type __c, char __dfault) const;
670 _LIBCPP_INLINE_VISIBILITY
671 char_type widen(char __c) const;
674 _LIBCPP_INLINE_VISIBILITY
675 basic_ios() {// purposefully does no initialization
677 _LIBCPP_INLINE_VISIBILITY
678 void init(basic_streambuf<char_type, traits_type>* __sb);
680 _LIBCPP_INLINE_VISIBILITY
681 void move(basic_ios& __rhs);
682 #ifndef _LIBCPP_CXX03_LANG
683 _LIBCPP_INLINE_VISIBILITY
684 void move(basic_ios&& __rhs) {move(__rhs);}
686 _LIBCPP_INLINE_VISIBILITY
687 void swap(basic_ios& __rhs) _NOEXCEPT;
688 _LIBCPP_INLINE_VISIBILITY
689 void set_rdbuf(basic_streambuf<char_type, traits_type>* __sb);
691 basic_ostream<char_type, traits_type>* __tie_;
692 mutable int_type __fill_;
695 template <class _CharT, class _Traits>
696 inline _LIBCPP_INLINE_VISIBILITY
697 basic_ios<_CharT, _Traits>::basic_ios(basic_streambuf<char_type,traits_type>* __sb)
702 template <class _CharT, class _Traits>
703 basic_ios<_CharT, _Traits>::~basic_ios()
707 template <class _CharT, class _Traits>
708 inline _LIBCPP_INLINE_VISIBILITY
710 basic_ios<_CharT, _Traits>::init(basic_streambuf<char_type, traits_type>* __sb)
712 ios_base::init(__sb);
714 __fill_ = traits_type::eof();
717 template <class _CharT, class _Traits>
718 inline _LIBCPP_INLINE_VISIBILITY
719 basic_ostream<_CharT, _Traits>*
720 basic_ios<_CharT, _Traits>::tie() const
725 template <class _CharT, class _Traits>
726 inline _LIBCPP_INLINE_VISIBILITY
727 basic_ostream<_CharT, _Traits>*
728 basic_ios<_CharT, _Traits>::tie(basic_ostream<char_type, traits_type>* __tiestr)
730 basic_ostream<char_type, traits_type>* __r = __tie_;
735 template <class _CharT, class _Traits>
736 inline _LIBCPP_INLINE_VISIBILITY
737 basic_streambuf<_CharT, _Traits>*
738 basic_ios<_CharT, _Traits>::rdbuf() const
740 return static_cast<basic_streambuf<char_type, traits_type>*>(ios_base::rdbuf());
743 template <class _CharT, class _Traits>
744 inline _LIBCPP_INLINE_VISIBILITY
745 basic_streambuf<_CharT, _Traits>*
746 basic_ios<_CharT, _Traits>::rdbuf(basic_streambuf<char_type, traits_type>* __sb)
748 basic_streambuf<char_type, traits_type>* __r = rdbuf();
749 ios_base::rdbuf(__sb);
753 template <class _CharT, class _Traits>
754 inline _LIBCPP_INLINE_VISIBILITY
756 basic_ios<_CharT, _Traits>::imbue(const locale& __loc)
758 locale __r = getloc();
759 ios_base::imbue(__loc);
761 rdbuf()->pubimbue(__loc);
765 template <class _CharT, class _Traits>
766 inline _LIBCPP_INLINE_VISIBILITY
768 basic_ios<_CharT, _Traits>::narrow(char_type __c, char __dfault) const
770 return use_facet<ctype<char_type> >(getloc()).narrow(__c, __dfault);
773 template <class _CharT, class _Traits>
774 inline _LIBCPP_INLINE_VISIBILITY
776 basic_ios<_CharT, _Traits>::widen(char __c) const
778 return use_facet<ctype<char_type> >(getloc()).widen(__c);
781 template <class _CharT, class _Traits>
782 inline _LIBCPP_INLINE_VISIBILITY
784 basic_ios<_CharT, _Traits>::fill() const
786 if (traits_type::eq_int_type(traits_type::eof(), __fill_))
787 __fill_ = widen(' ');
791 template <class _CharT, class _Traits>
792 inline _LIBCPP_INLINE_VISIBILITY
794 basic_ios<_CharT, _Traits>::fill(char_type __ch)
796 char_type __r = __fill_;
801 template <class _CharT, class _Traits>
802 basic_ios<_CharT, _Traits>&
803 basic_ios<_CharT, _Traits>::copyfmt(const basic_ios& __rhs)
807 __call_callbacks(erase_event);
808 ios_base::copyfmt(__rhs);
809 __tie_ = __rhs.__tie_;
810 __fill_ = __rhs.__fill_;
811 __call_callbacks(copyfmt_event);
812 exceptions(__rhs.exceptions());
817 template <class _CharT, class _Traits>
818 inline _LIBCPP_INLINE_VISIBILITY
820 basic_ios<_CharT, _Traits>::move(basic_ios& __rhs)
822 ios_base::move(__rhs);
823 __tie_ = __rhs.__tie_;
825 __fill_ = __rhs.__fill_;
828 template <class _CharT, class _Traits>
829 inline _LIBCPP_INLINE_VISIBILITY
831 basic_ios<_CharT, _Traits>::swap(basic_ios& __rhs) _NOEXCEPT
833 ios_base::swap(__rhs);
834 _VSTD::swap(__tie_, __rhs.__tie_);
835 _VSTD::swap(__fill_, __rhs.__fill_);
838 template <class _CharT, class _Traits>
839 inline _LIBCPP_INLINE_VISIBILITY
841 basic_ios<_CharT, _Traits>::set_rdbuf(basic_streambuf<char_type, traits_type>* __sb)
843 ios_base::set_rdbuf(__sb);
846 inline _LIBCPP_INLINE_VISIBILITY
848 boolalpha(ios_base& __str)
850 __str.setf(ios_base::boolalpha);
854 inline _LIBCPP_INLINE_VISIBILITY
856 noboolalpha(ios_base& __str)
858 __str.unsetf(ios_base::boolalpha);
862 inline _LIBCPP_INLINE_VISIBILITY
864 showbase(ios_base& __str)
866 __str.setf(ios_base::showbase);
870 inline _LIBCPP_INLINE_VISIBILITY
872 noshowbase(ios_base& __str)
874 __str.unsetf(ios_base::showbase);
878 inline _LIBCPP_INLINE_VISIBILITY
880 showpoint(ios_base& __str)
882 __str.setf(ios_base::showpoint);
886 inline _LIBCPP_INLINE_VISIBILITY
888 noshowpoint(ios_base& __str)
890 __str.unsetf(ios_base::showpoint);
894 inline _LIBCPP_INLINE_VISIBILITY
896 showpos(ios_base& __str)
898 __str.setf(ios_base::showpos);
902 inline _LIBCPP_INLINE_VISIBILITY
904 noshowpos(ios_base& __str)
906 __str.unsetf(ios_base::showpos);
910 inline _LIBCPP_INLINE_VISIBILITY
912 skipws(ios_base& __str)
914 __str.setf(ios_base::skipws);
918 inline _LIBCPP_INLINE_VISIBILITY
920 noskipws(ios_base& __str)
922 __str.unsetf(ios_base::skipws);
926 inline _LIBCPP_INLINE_VISIBILITY
928 uppercase(ios_base& __str)
930 __str.setf(ios_base::uppercase);
934 inline _LIBCPP_INLINE_VISIBILITY
936 nouppercase(ios_base& __str)
938 __str.unsetf(ios_base::uppercase);
942 inline _LIBCPP_INLINE_VISIBILITY
944 unitbuf(ios_base& __str)
946 __str.setf(ios_base::unitbuf);
950 inline _LIBCPP_INLINE_VISIBILITY
952 nounitbuf(ios_base& __str)
954 __str.unsetf(ios_base::unitbuf);
958 inline _LIBCPP_INLINE_VISIBILITY
960 internal(ios_base& __str)
962 __str.setf(ios_base::internal, ios_base::adjustfield);
966 inline _LIBCPP_INLINE_VISIBILITY
968 left(ios_base& __str)
970 __str.setf(ios_base::left, ios_base::adjustfield);
974 inline _LIBCPP_INLINE_VISIBILITY
976 right(ios_base& __str)
978 __str.setf(ios_base::right, ios_base::adjustfield);
982 inline _LIBCPP_INLINE_VISIBILITY
986 __str.setf(ios_base::dec, ios_base::basefield);
990 inline _LIBCPP_INLINE_VISIBILITY
994 __str.setf(ios_base::hex, ios_base::basefield);
998 inline _LIBCPP_INLINE_VISIBILITY
1000 oct(ios_base& __str)
1002 __str.setf(ios_base::oct, ios_base::basefield);
1006 inline _LIBCPP_INLINE_VISIBILITY
1008 fixed(ios_base& __str)
1010 __str.setf(ios_base::fixed, ios_base::floatfield);
1014 inline _LIBCPP_INLINE_VISIBILITY
1016 scientific(ios_base& __str)
1018 __str.setf(ios_base::scientific, ios_base::floatfield);
1022 inline _LIBCPP_INLINE_VISIBILITY
1024 hexfloat(ios_base& __str)
1026 __str.setf(ios_base::fixed | ios_base::scientific, ios_base::floatfield);
1030 inline _LIBCPP_INLINE_VISIBILITY
1032 defaultfloat(ios_base& __str)
1034 __str.unsetf(ios_base::floatfield);
1038 template <class _CharT, class _Traits>
1041 typedef basic_ios<_CharT, _Traits> __stream_type;
1042 typedef typename __stream_type::fmtflags fmtflags;
1044 __stream_type& __stream_;
1045 fmtflags __fmtflags_;
1048 __save_flags(const __save_flags&);
1049 __save_flags& operator=(const __save_flags&);
1051 _LIBCPP_INLINE_VISIBILITY
1052 explicit __save_flags(__stream_type& __stream)
1053 : __stream_(__stream),
1054 __fmtflags_(__stream.flags()),
1055 __fill_(__stream.fill())
1057 _LIBCPP_INLINE_VISIBILITY
1060 __stream_.flags(__fmtflags_);
1061 __stream_.fill(__fill_);
1065 _LIBCPP_END_NAMESPACE_STD
1067 #endif // _LIBCPP_IOS