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;
215 #if defined(_LIBCPP_HAS_NO_LOCALIZATION)
216 # error "The iostreams library is not supported since libc++ has been configured without support for localization."
219 #include <__assert> // all public C++ headers provide the assertion handler
220 #include <__fwd/ios.h>
221 #include <__ios/fpos.h>
223 #include <__system_error/error_category.h>
224 #include <__system_error/error_code.h>
225 #include <__system_error/error_condition.h>
226 #include <__system_error/system_error.h>
227 #include <__utility/swap.h>
228 #include <__verbose_abort>
231 // standard-mandated includes
236 #if !defined(_LIBCPP_HAS_NO_ATOMIC_HEADER)
237 # include <__atomic/atomic.h> // for __xindex_
240 #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
241 # pragma GCC system_header
244 _LIBCPP_BEGIN_NAMESPACE_STD
246 typedef ptrdiff_t streamsize;
248 class _LIBCPP_EXPORTED_FROM_ABI ios_base
251 class _LIBCPP_EXPORTED_FROM_ABI failure;
253 typedef unsigned int fmtflags;
254 static const fmtflags boolalpha = 0x0001;
255 static const fmtflags dec = 0x0002;
256 static const fmtflags fixed = 0x0004;
257 static const fmtflags hex = 0x0008;
258 static const fmtflags internal = 0x0010;
259 static const fmtflags left = 0x0020;
260 static const fmtflags oct = 0x0040;
261 static const fmtflags right = 0x0080;
262 static const fmtflags scientific = 0x0100;
263 static const fmtflags showbase = 0x0200;
264 static const fmtflags showpoint = 0x0400;
265 static const fmtflags showpos = 0x0800;
266 static const fmtflags skipws = 0x1000;
267 static const fmtflags unitbuf = 0x2000;
268 static const fmtflags uppercase = 0x4000;
269 static const fmtflags adjustfield = left | right | internal;
270 static const fmtflags basefield = dec | oct | hex;
271 static const fmtflags floatfield = scientific | fixed;
273 typedef unsigned int iostate;
274 static const iostate badbit = 0x1;
275 static const iostate eofbit = 0x2;
276 static const iostate failbit = 0x4;
277 static const iostate goodbit = 0x0;
279 typedef unsigned int openmode;
280 static const openmode app = 0x01;
281 static const openmode ate = 0x02;
282 static const openmode binary = 0x04;
283 static const openmode in = 0x08;
284 static const openmode out = 0x10;
285 static const openmode trunc = 0x20;
287 enum seekdir {beg, cur, end};
289 #if _LIBCPP_STD_VER <= 14
290 typedef iostate io_state;
291 typedef openmode open_mode;
292 typedef seekdir seek_dir;
294 typedef _VSTD::streamoff streamoff;
295 typedef _VSTD::streampos streampos;
298 class _LIBCPP_EXPORTED_FROM_ABI Init;
300 // 27.5.2.2 fmtflags state:
301 _LIBCPP_INLINE_VISIBILITY fmtflags flags() const;
302 _LIBCPP_INLINE_VISIBILITY fmtflags flags(fmtflags __fmtfl);
303 _LIBCPP_INLINE_VISIBILITY fmtflags setf(fmtflags __fmtfl);
304 _LIBCPP_INLINE_VISIBILITY fmtflags setf(fmtflags __fmtfl, fmtflags __mask);
305 _LIBCPP_INLINE_VISIBILITY void unsetf(fmtflags __mask);
307 _LIBCPP_INLINE_VISIBILITY streamsize precision() const;
308 _LIBCPP_INLINE_VISIBILITY streamsize precision(streamsize __prec);
309 _LIBCPP_INLINE_VISIBILITY streamsize width() const;
310 _LIBCPP_INLINE_VISIBILITY streamsize width(streamsize __wide);
313 locale imbue(const locale& __loc);
314 locale getloc() const;
318 long& iword(int __index);
319 void*& pword(int __index);
324 // 27.5.2.6 callbacks;
325 enum event { erase_event, imbue_event, copyfmt_event };
326 typedef void (*event_callback)(event, ios_base&, int __index);
327 void register_callback(event_callback __fn, int __index);
329 ios_base(const ios_base&) = delete;
330 ios_base& operator=(const ios_base&) = delete;
332 static bool sync_with_stdio(bool __sync = true);
334 _LIBCPP_INLINE_VISIBILITY iostate rdstate() const;
335 void clear(iostate __state = goodbit);
336 _LIBCPP_INLINE_VISIBILITY void setstate(iostate __state);
338 _LIBCPP_INLINE_VISIBILITY bool good() const;
339 _LIBCPP_INLINE_VISIBILITY bool eof() const;
340 _LIBCPP_INLINE_VISIBILITY bool fail() const;
341 _LIBCPP_INLINE_VISIBILITY bool bad() const;
343 _LIBCPP_INLINE_VISIBILITY iostate exceptions() const;
344 _LIBCPP_INLINE_VISIBILITY void exceptions(iostate __iostate);
346 void __set_badbit_and_consider_rethrow();
347 void __set_failbit_and_consider_rethrow();
349 _LIBCPP_INLINE_VISIBILITY
350 void __setstate_nothrow(iostate __state)
353 __rdstate_ |= __state;
355 __rdstate_ |= __state | ios_base::badbit;
359 _LIBCPP_INLINE_VISIBILITY
360 ios_base() {// purposefully does no initialization
363 void init(void* __sb);
364 _LIBCPP_INLINE_VISIBILITY void* rdbuf() const {return __rdbuf_;}
366 _LIBCPP_INLINE_VISIBILITY
367 void rdbuf(void* __sb)
373 void __call_callbacks(event);
374 void copyfmt(const ios_base&);
375 void move(ios_base&);
376 void swap(ios_base&) _NOEXCEPT;
378 _LIBCPP_INLINE_VISIBILITY
379 void set_rdbuf(void* __sb)
385 // All data members must be scalars
386 fmtflags __fmtflags_;
387 streamsize __precision_;
390 iostate __exceptions_;
393 event_callback* __fn_;
395 size_t __event_size_;
397 // TODO(EricWF): Enable this for both Clang and GCC. Currently it is only
398 // enabled with clang.
399 #if defined(_LIBCPP_HAS_C_ATOMIC_IMP) && !defined(_LIBCPP_HAS_NO_THREADS)
400 static atomic<int> __xindex_;
402 static int __xindex_;
405 size_t __iarray_size_;
406 size_t __iarray_cap_;
408 size_t __parray_size_;
409 size_t __parray_cap_;
413 _LIBCPP_DECLARE_STRONG_ENUM(io_errc)
417 _LIBCPP_DECLARE_STRONG_ENUM_EPILOG(io_errc)
420 struct _LIBCPP_TEMPLATE_VIS is_error_code_enum<io_errc> : public true_type { };
422 #ifdef _LIBCPP_CXX03_LANG
424 struct _LIBCPP_TEMPLATE_VIS is_error_code_enum<io_errc::__lx> : public true_type { };
427 _LIBCPP_EXPORTED_FROM_ABI const error_category& iostream_category() _NOEXCEPT;
429 inline _LIBCPP_INLINE_VISIBILITY
431 make_error_code(io_errc __e) _NOEXCEPT
433 return error_code(static_cast<int>(__e), iostream_category());
436 inline _LIBCPP_INLINE_VISIBILITY
438 make_error_condition(io_errc __e) _NOEXCEPT
440 return error_condition(static_cast<int>(__e), iostream_category());
443 class _LIBCPP_EXPORTED_FROM_ABI ios_base::failure
444 : public system_error
447 explicit failure(const string& __msg, const error_code& __ec = io_errc::stream);
448 explicit failure(const char* __msg, const error_code& __ec = io_errc::stream);
449 _LIBCPP_HIDE_FROM_ABI failure(const failure&) _NOEXCEPT = default;
450 ~failure() _NOEXCEPT override;
453 _LIBCPP_NORETURN inline _LIBCPP_INLINE_VISIBILITY
454 void __throw_failure(char const* __msg) {
455 #ifndef _LIBCPP_HAS_NO_EXCEPTIONS
456 throw ios_base::failure(__msg);
458 _LIBCPP_VERBOSE_ABORT("ios_base::failure was thrown in -fno-exceptions mode with message \"%s\"", __msg);
462 class _LIBCPP_EXPORTED_FROM_ABI ios_base::Init
471 inline _LIBCPP_INLINE_VISIBILITY
473 ios_base::flags() const
478 inline _LIBCPP_INLINE_VISIBILITY
480 ios_base::flags(fmtflags __fmtfl)
482 fmtflags __r = __fmtflags_;
483 __fmtflags_ = __fmtfl;
487 inline _LIBCPP_INLINE_VISIBILITY
489 ios_base::setf(fmtflags __fmtfl)
491 fmtflags __r = __fmtflags_;
492 __fmtflags_ |= __fmtfl;
496 inline _LIBCPP_INLINE_VISIBILITY
498 ios_base::unsetf(fmtflags __mask)
500 __fmtflags_ &= ~__mask;
503 inline _LIBCPP_INLINE_VISIBILITY
505 ios_base::setf(fmtflags __fmtfl, fmtflags __mask)
507 fmtflags __r = __fmtflags_;
509 __fmtflags_ |= __fmtfl & __mask;
515 inline _LIBCPP_INLINE_VISIBILITY
517 ios_base::precision() const
522 inline _LIBCPP_INLINE_VISIBILITY
524 ios_base::precision(streamsize __prec)
526 streamsize __r = __precision_;
527 __precision_ = __prec;
533 inline _LIBCPP_INLINE_VISIBILITY
535 ios_base::width() const
540 inline _LIBCPP_INLINE_VISIBILITY
542 ios_base::width(streamsize __wide)
544 streamsize __r = __width_;
551 inline _LIBCPP_INLINE_VISIBILITY
553 ios_base::rdstate() const
558 inline _LIBCPP_INLINE_VISIBILITY
560 ios_base::setstate(iostate __state)
562 clear(__rdstate_ | __state);
565 inline _LIBCPP_INLINE_VISIBILITY
567 ios_base::good() const
569 return __rdstate_ == 0;
572 inline _LIBCPP_INLINE_VISIBILITY
574 ios_base::eof() const
576 return (__rdstate_ & eofbit) != 0;
579 inline _LIBCPP_INLINE_VISIBILITY
581 ios_base::fail() const
583 return (__rdstate_ & (failbit | badbit)) != 0;
586 inline _LIBCPP_INLINE_VISIBILITY
588 ios_base::bad() const
590 return (__rdstate_ & badbit) != 0;
593 inline _LIBCPP_INLINE_VISIBILITY
595 ios_base::exceptions() const
597 return __exceptions_;
600 inline _LIBCPP_INLINE_VISIBILITY
602 ios_base::exceptions(iostate __iostate)
604 __exceptions_ = __iostate;
608 template <class _CharT, class _Traits>
609 class _LIBCPP_TEMPLATE_VIS basic_ios
614 typedef _CharT char_type;
615 typedef _Traits traits_type;
617 typedef typename traits_type::int_type int_type;
618 typedef typename traits_type::pos_type pos_type;
619 typedef typename traits_type::off_type off_type;
621 static_assert((is_same<_CharT, typename traits_type::char_type>::value),
622 "traits_type::char_type must be the same type as CharT");
624 #ifdef _LIBCPP_CXX03_LANG
625 // Preserve the ability to compare with literal 0,
626 // and implicitly convert to bool, but not implicitly convert to int.
627 _LIBCPP_INLINE_VISIBILITY
628 operator void*() const {return fail() ? nullptr : (void*)this;}
630 _LIBCPP_INLINE_VISIBILITY
631 explicit operator bool() const {return !fail();}
634 _LIBCPP_INLINE_VISIBILITY bool operator!() const {return fail();}
635 _LIBCPP_INLINE_VISIBILITY iostate rdstate() const {return ios_base::rdstate();}
636 _LIBCPP_INLINE_VISIBILITY void clear(iostate __state = goodbit) {ios_base::clear(__state);}
637 _LIBCPP_INLINE_VISIBILITY void setstate(iostate __state) {ios_base::setstate(__state);}
638 _LIBCPP_INLINE_VISIBILITY bool good() const {return ios_base::good();}
639 _LIBCPP_INLINE_VISIBILITY bool eof() const {return ios_base::eof();}
640 _LIBCPP_INLINE_VISIBILITY bool fail() const {return ios_base::fail();}
641 _LIBCPP_INLINE_VISIBILITY bool bad() const {return ios_base::bad();}
643 _LIBCPP_INLINE_VISIBILITY iostate exceptions() const {return ios_base::exceptions();}
644 _LIBCPP_INLINE_VISIBILITY void exceptions(iostate __iostate) {ios_base::exceptions(__iostate);}
646 // 27.5.4.1 Constructor/destructor:
647 _LIBCPP_INLINE_VISIBILITY
648 explicit basic_ios(basic_streambuf<char_type,traits_type>* __sb);
649 ~basic_ios() override;
652 _LIBCPP_INLINE_VISIBILITY
653 basic_ostream<char_type, traits_type>* tie() const;
654 _LIBCPP_INLINE_VISIBILITY
655 basic_ostream<char_type, traits_type>* tie(basic_ostream<char_type, traits_type>* __tiestr);
657 _LIBCPP_INLINE_VISIBILITY
658 basic_streambuf<char_type, traits_type>* rdbuf() const;
659 _LIBCPP_INLINE_VISIBILITY
660 basic_streambuf<char_type, traits_type>* rdbuf(basic_streambuf<char_type, traits_type>* __sb);
662 basic_ios& copyfmt(const basic_ios& __rhs);
664 _LIBCPP_INLINE_VISIBILITY
665 char_type fill() const;
666 _LIBCPP_INLINE_VISIBILITY
667 char_type fill(char_type __ch);
669 _LIBCPP_INLINE_VISIBILITY
670 locale imbue(const locale& __loc);
672 _LIBCPP_INLINE_VISIBILITY
673 char narrow(char_type __c, char __dfault) const;
674 _LIBCPP_INLINE_VISIBILITY
675 char_type widen(char __c) const;
678 _LIBCPP_INLINE_VISIBILITY
679 basic_ios() {// purposefully does no initialization
681 _LIBCPP_INLINE_VISIBILITY
682 void init(basic_streambuf<char_type, traits_type>* __sb);
684 _LIBCPP_INLINE_VISIBILITY
685 void move(basic_ios& __rhs);
686 _LIBCPP_INLINE_VISIBILITY
687 void move(basic_ios&& __rhs) {move(__rhs);}
688 _LIBCPP_INLINE_VISIBILITY
689 void swap(basic_ios& __rhs) _NOEXCEPT;
690 _LIBCPP_INLINE_VISIBILITY
691 void set_rdbuf(basic_streambuf<char_type, traits_type>* __sb);
693 basic_ostream<char_type, traits_type>* __tie_;
694 mutable int_type __fill_;
697 template <class _CharT, class _Traits>
698 inline _LIBCPP_INLINE_VISIBILITY
699 basic_ios<_CharT, _Traits>::basic_ios(basic_streambuf<char_type,traits_type>* __sb)
704 template <class _CharT, class _Traits>
705 basic_ios<_CharT, _Traits>::~basic_ios()
709 template <class _CharT, class _Traits>
710 inline _LIBCPP_INLINE_VISIBILITY
712 basic_ios<_CharT, _Traits>::init(basic_streambuf<char_type, traits_type>* __sb)
714 ios_base::init(__sb);
716 __fill_ = traits_type::eof();
719 template <class _CharT, class _Traits>
720 inline _LIBCPP_INLINE_VISIBILITY
721 basic_ostream<_CharT, _Traits>*
722 basic_ios<_CharT, _Traits>::tie() const
727 template <class _CharT, class _Traits>
728 inline _LIBCPP_INLINE_VISIBILITY
729 basic_ostream<_CharT, _Traits>*
730 basic_ios<_CharT, _Traits>::tie(basic_ostream<char_type, traits_type>* __tiestr)
732 basic_ostream<char_type, traits_type>* __r = __tie_;
737 template <class _CharT, class _Traits>
738 inline _LIBCPP_INLINE_VISIBILITY
739 basic_streambuf<_CharT, _Traits>*
740 basic_ios<_CharT, _Traits>::rdbuf() const
742 return static_cast<basic_streambuf<char_type, traits_type>*>(ios_base::rdbuf());
745 template <class _CharT, class _Traits>
746 inline _LIBCPP_INLINE_VISIBILITY
747 basic_streambuf<_CharT, _Traits>*
748 basic_ios<_CharT, _Traits>::rdbuf(basic_streambuf<char_type, traits_type>* __sb)
750 basic_streambuf<char_type, traits_type>* __r = rdbuf();
751 ios_base::rdbuf(__sb);
755 template <class _CharT, class _Traits>
756 inline _LIBCPP_INLINE_VISIBILITY
758 basic_ios<_CharT, _Traits>::imbue(const locale& __loc)
760 locale __r = getloc();
761 ios_base::imbue(__loc);
763 rdbuf()->pubimbue(__loc);
767 template <class _CharT, class _Traits>
768 inline _LIBCPP_INLINE_VISIBILITY
770 basic_ios<_CharT, _Traits>::narrow(char_type __c, char __dfault) const
772 return std::use_facet<ctype<char_type> >(getloc()).narrow(__c, __dfault);
775 template <class _CharT, class _Traits>
776 inline _LIBCPP_INLINE_VISIBILITY
778 basic_ios<_CharT, _Traits>::widen(char __c) const
780 return std::use_facet<ctype<char_type> >(getloc()).widen(__c);
783 template <class _CharT, class _Traits>
784 inline _LIBCPP_INLINE_VISIBILITY
786 basic_ios<_CharT, _Traits>::fill() const
788 if (traits_type::eq_int_type(traits_type::eof(), __fill_))
789 __fill_ = widen(' ');
793 template <class _CharT, class _Traits>
794 inline _LIBCPP_INLINE_VISIBILITY
796 basic_ios<_CharT, _Traits>::fill(char_type __ch)
798 if (traits_type::eq_int_type(traits_type::eof(), __fill_))
799 __fill_ = widen(' ');
800 char_type __r = __fill_;
805 template <class _CharT, class _Traits>
806 basic_ios<_CharT, _Traits>&
807 basic_ios<_CharT, _Traits>::copyfmt(const basic_ios& __rhs)
811 __call_callbacks(erase_event);
812 ios_base::copyfmt(__rhs);
813 __tie_ = __rhs.__tie_;
814 __fill_ = __rhs.__fill_;
815 __call_callbacks(copyfmt_event);
816 exceptions(__rhs.exceptions());
821 template <class _CharT, class _Traits>
822 inline _LIBCPP_INLINE_VISIBILITY
824 basic_ios<_CharT, _Traits>::move(basic_ios& __rhs)
826 ios_base::move(__rhs);
827 __tie_ = __rhs.__tie_;
828 __rhs.__tie_ = nullptr;
829 __fill_ = __rhs.__fill_;
832 template <class _CharT, class _Traits>
833 inline _LIBCPP_INLINE_VISIBILITY
835 basic_ios<_CharT, _Traits>::swap(basic_ios& __rhs) _NOEXCEPT
837 ios_base::swap(__rhs);
838 _VSTD::swap(__tie_, __rhs.__tie_);
839 _VSTD::swap(__fill_, __rhs.__fill_);
842 template <class _CharT, class _Traits>
843 inline _LIBCPP_INLINE_VISIBILITY
845 basic_ios<_CharT, _Traits>::set_rdbuf(basic_streambuf<char_type, traits_type>* __sb)
847 ios_base::set_rdbuf(__sb);
850 extern template class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS basic_ios<char>;
852 #ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
853 extern template class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS basic_ios<wchar_t>;
856 _LIBCPP_HIDE_FROM_ABI inline
858 boolalpha(ios_base& __str)
860 __str.setf(ios_base::boolalpha);
864 _LIBCPP_HIDE_FROM_ABI inline
866 noboolalpha(ios_base& __str)
868 __str.unsetf(ios_base::boolalpha);
872 _LIBCPP_HIDE_FROM_ABI inline
874 showbase(ios_base& __str)
876 __str.setf(ios_base::showbase);
880 _LIBCPP_HIDE_FROM_ABI inline
882 noshowbase(ios_base& __str)
884 __str.unsetf(ios_base::showbase);
888 _LIBCPP_HIDE_FROM_ABI inline
890 showpoint(ios_base& __str)
892 __str.setf(ios_base::showpoint);
896 _LIBCPP_HIDE_FROM_ABI inline
898 noshowpoint(ios_base& __str)
900 __str.unsetf(ios_base::showpoint);
904 _LIBCPP_HIDE_FROM_ABI inline
906 showpos(ios_base& __str)
908 __str.setf(ios_base::showpos);
912 _LIBCPP_HIDE_FROM_ABI inline
914 noshowpos(ios_base& __str)
916 __str.unsetf(ios_base::showpos);
920 _LIBCPP_HIDE_FROM_ABI inline
922 skipws(ios_base& __str)
924 __str.setf(ios_base::skipws);
928 _LIBCPP_HIDE_FROM_ABI inline
930 noskipws(ios_base& __str)
932 __str.unsetf(ios_base::skipws);
936 _LIBCPP_HIDE_FROM_ABI inline
938 uppercase(ios_base& __str)
940 __str.setf(ios_base::uppercase);
944 _LIBCPP_HIDE_FROM_ABI inline
946 nouppercase(ios_base& __str)
948 __str.unsetf(ios_base::uppercase);
952 _LIBCPP_HIDE_FROM_ABI inline
954 unitbuf(ios_base& __str)
956 __str.setf(ios_base::unitbuf);
960 _LIBCPP_HIDE_FROM_ABI inline
962 nounitbuf(ios_base& __str)
964 __str.unsetf(ios_base::unitbuf);
968 _LIBCPP_HIDE_FROM_ABI inline
970 internal(ios_base& __str)
972 __str.setf(ios_base::internal, ios_base::adjustfield);
976 _LIBCPP_HIDE_FROM_ABI inline
978 left(ios_base& __str)
980 __str.setf(ios_base::left, ios_base::adjustfield);
984 _LIBCPP_HIDE_FROM_ABI inline
986 right(ios_base& __str)
988 __str.setf(ios_base::right, ios_base::adjustfield);
992 _LIBCPP_HIDE_FROM_ABI inline
996 __str.setf(ios_base::dec, ios_base::basefield);
1000 _LIBCPP_HIDE_FROM_ABI inline
1002 hex(ios_base& __str)
1004 __str.setf(ios_base::hex, ios_base::basefield);
1008 _LIBCPP_HIDE_FROM_ABI inline
1010 oct(ios_base& __str)
1012 __str.setf(ios_base::oct, ios_base::basefield);
1016 _LIBCPP_HIDE_FROM_ABI inline
1018 fixed(ios_base& __str)
1020 __str.setf(ios_base::fixed, ios_base::floatfield);
1024 _LIBCPP_HIDE_FROM_ABI inline
1026 scientific(ios_base& __str)
1028 __str.setf(ios_base::scientific, ios_base::floatfield);
1032 _LIBCPP_HIDE_FROM_ABI inline
1034 hexfloat(ios_base& __str)
1036 __str.setf(ios_base::fixed | ios_base::scientific, ios_base::floatfield);
1040 _LIBCPP_HIDE_FROM_ABI inline
1042 defaultfloat(ios_base& __str)
1044 __str.unsetf(ios_base::floatfield);
1048 _LIBCPP_END_NAMESPACE_STD
1050 #if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
1052 # include <concepts>
1056 # include <initializer_list>
1060 # include <stdexcept>
1061 # include <system_error>
1062 # include <type_traits>
1063 # include <typeinfo>
1066 #endif // _LIBCPP_IOS