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;
118 typedef typename traits::pos_type pos_type;
119 typedef typename traits::off_type off_type;
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);
207 error_condition make_error_condition(io_errc e);
208 storage-class-specifier const error_category& iostream_category;
217 #include <system_error>
219 #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
220 #pragma GCC system_header
223 _LIBCPP_BEGIN_NAMESPACE_STD
225 typedef ptrdiff_t streamsize;
227 class _LIBCPP_TYPE_VIS ios_base
230 class _LIBCPP_TYPE_VIS failure;
232 typedef unsigned int fmtflags;
233 static const fmtflags boolalpha = 0x0001;
234 static const fmtflags dec = 0x0002;
235 static const fmtflags fixed = 0x0004;
236 static const fmtflags hex = 0x0008;
237 static const fmtflags internal = 0x0010;
238 static const fmtflags left = 0x0020;
239 static const fmtflags oct = 0x0040;
240 static const fmtflags right = 0x0080;
241 static const fmtflags scientific = 0x0100;
242 static const fmtflags showbase = 0x0200;
243 static const fmtflags showpoint = 0x0400;
244 static const fmtflags showpos = 0x0800;
245 static const fmtflags skipws = 0x1000;
246 static const fmtflags unitbuf = 0x2000;
247 static const fmtflags uppercase = 0x4000;
248 static const fmtflags adjustfield = left | right | internal;
249 static const fmtflags basefield = dec | oct | hex;
250 static const fmtflags floatfield = scientific | fixed;
252 typedef unsigned int iostate;
253 typedef iostate io_state;
254 static const iostate badbit = 0x1;
255 static const iostate eofbit = 0x2;
256 static const iostate failbit = 0x4;
257 static const iostate goodbit = 0x0;
259 typedef unsigned int openmode;
260 typedef openmode open_mode;
261 static const openmode app = 0x01;
262 static const openmode ate = 0x02;
263 static const openmode binary = 0x04;
264 static const openmode in = 0x08;
265 static const openmode out = 0x10;
266 static const openmode trunc = 0x20;
268 enum seekdir {beg, cur, end};
269 typedef seekdir seek_dir;
271 typedef _VSTD::streamoff streamoff;
272 typedef _VSTD::streampos streampos;
274 class _LIBCPP_TYPE_VIS Init;
276 // 27.5.2.2 fmtflags state:
277 _LIBCPP_INLINE_VISIBILITY fmtflags flags() const;
278 _LIBCPP_INLINE_VISIBILITY fmtflags flags(fmtflags __fmtfl);
279 _LIBCPP_INLINE_VISIBILITY fmtflags setf(fmtflags __fmtfl);
280 _LIBCPP_INLINE_VISIBILITY fmtflags setf(fmtflags __fmtfl, fmtflags __mask);
281 _LIBCPP_INLINE_VISIBILITY void unsetf(fmtflags __mask);
283 _LIBCPP_INLINE_VISIBILITY streamsize precision() const;
284 _LIBCPP_INLINE_VISIBILITY streamsize precision(streamsize __prec);
285 _LIBCPP_INLINE_VISIBILITY streamsize width() const;
286 _LIBCPP_INLINE_VISIBILITY streamsize width(streamsize __wide);
289 locale imbue(const locale& __loc);
290 locale getloc() const;
294 long& iword(int __index);
295 void*& pword(int __index);
300 // 27.5.2.6 callbacks;
301 enum event { erase_event, imbue_event, copyfmt_event };
302 typedef void (*event_callback)(event, ios_base&, int __index);
303 void register_callback(event_callback __fn, int __index);
306 ios_base(const ios_base&); // = delete;
307 ios_base& operator=(const ios_base&); // = delete;
310 static bool sync_with_stdio(bool __sync = true);
312 _LIBCPP_INLINE_VISIBILITY iostate rdstate() const;
313 void clear(iostate __state = goodbit);
314 _LIBCPP_INLINE_VISIBILITY void setstate(iostate __state);
316 _LIBCPP_INLINE_VISIBILITY bool good() const;
317 _LIBCPP_INLINE_VISIBILITY bool eof() const;
318 _LIBCPP_INLINE_VISIBILITY bool fail() const;
319 _LIBCPP_INLINE_VISIBILITY bool bad() const;
321 _LIBCPP_INLINE_VISIBILITY iostate exceptions() const;
322 _LIBCPP_INLINE_VISIBILITY void exceptions(iostate __except);
324 void __set_badbit_and_consider_rethrow();
325 void __set_failbit_and_consider_rethrow();
328 _LIBCPP_INLINE_VISIBILITY
329 ios_base() {// purposefully does no initialization
332 void init(void* __sb);
333 _LIBCPP_ALWAYS_INLINE void* rdbuf() const {return __rdbuf_;}
335 _LIBCPP_ALWAYS_INLINE
336 void rdbuf(void* __sb)
342 void __call_callbacks(event);
343 void copyfmt(const ios_base&);
344 void move(ios_base&);
345 void swap(ios_base&) _NOEXCEPT;
347 _LIBCPP_ALWAYS_INLINE
348 void set_rdbuf(void* __sb)
354 // All data members must be scalars
355 fmtflags __fmtflags_;
356 streamsize __precision_;
359 iostate __exceptions_;
362 event_callback* __fn_;
364 size_t __event_size_;
366 static int __xindex_;
368 size_t __iarray_size_;
369 size_t __iarray_cap_;
371 size_t __parray_size_;
372 size_t __parray_cap_;
376 _LIBCPP_DECLARE_STRONG_ENUM(io_errc)
380 _LIBCPP_DECLARE_STRONG_ENUM_EPILOG(io_errc)
383 struct _LIBCPP_TYPE_VIS is_error_code_enum<io_errc> : public true_type { };
385 #ifdef _LIBCPP_HAS_NO_STRONG_ENUMS
387 struct _LIBCPP_TYPE_VIS is_error_code_enum<io_errc::__lx> : public true_type { };
391 const error_category& iostream_category();
393 inline _LIBCPP_INLINE_VISIBILITY
395 make_error_code(io_errc __e)
397 return error_code(static_cast<int>(__e), iostream_category());
400 inline _LIBCPP_INLINE_VISIBILITY
402 make_error_condition(io_errc __e)
404 return error_condition(static_cast<int>(__e), iostream_category());
407 class _LIBCPP_EXCEPTION_ABI ios_base::failure
408 : public system_error
411 explicit failure(const string& __msg, const error_code& __ec = io_errc::stream);
412 explicit failure(const char* __msg, const error_code& __ec = io_errc::stream);
413 virtual ~failure() throw();
416 class _LIBCPP_TYPE_VIS ios_base::Init
425 inline _LIBCPP_INLINE_VISIBILITY
427 ios_base::flags() const
432 inline _LIBCPP_INLINE_VISIBILITY
434 ios_base::flags(fmtflags __fmtfl)
436 fmtflags __r = __fmtflags_;
437 __fmtflags_ = __fmtfl;
441 inline _LIBCPP_INLINE_VISIBILITY
443 ios_base::setf(fmtflags __fmtfl)
445 fmtflags __r = __fmtflags_;
446 __fmtflags_ |= __fmtfl;
450 inline _LIBCPP_INLINE_VISIBILITY
452 ios_base::unsetf(fmtflags __mask)
454 __fmtflags_ &= ~__mask;
457 inline _LIBCPP_INLINE_VISIBILITY
459 ios_base::setf(fmtflags __fmtfl, fmtflags __mask)
461 fmtflags __r = __fmtflags_;
463 __fmtflags_ |= __fmtfl & __mask;
469 inline _LIBCPP_INLINE_VISIBILITY
471 ios_base::precision() const
476 inline _LIBCPP_INLINE_VISIBILITY
478 ios_base::precision(streamsize __prec)
480 streamsize __r = __precision_;
481 __precision_ = __prec;
487 inline _LIBCPP_INLINE_VISIBILITY
489 ios_base::width() const
494 inline _LIBCPP_INLINE_VISIBILITY
496 ios_base::width(streamsize __wide)
498 streamsize __r = __width_;
505 inline _LIBCPP_INLINE_VISIBILITY
507 ios_base::rdstate() const
512 inline _LIBCPP_INLINE_VISIBILITY
514 ios_base::setstate(iostate __state)
516 clear(__rdstate_ | __state);
519 inline _LIBCPP_INLINE_VISIBILITY
521 ios_base::good() const
523 return __rdstate_ == 0;
526 inline _LIBCPP_INLINE_VISIBILITY
528 ios_base::eof() const
530 return __rdstate_ & eofbit;
533 inline _LIBCPP_INLINE_VISIBILITY
535 ios_base::fail() const
537 return __rdstate_ & (failbit | badbit);
540 inline _LIBCPP_INLINE_VISIBILITY
542 ios_base::bad() const
544 return __rdstate_ & badbit;
547 inline _LIBCPP_INLINE_VISIBILITY
549 ios_base::exceptions() const
551 return __exceptions_;
554 inline _LIBCPP_INLINE_VISIBILITY
556 ios_base::exceptions(iostate __except)
558 __exceptions_ = __except;
562 template <class _CharT, class _Traits>
563 class _LIBCPP_TYPE_VIS basic_ios
568 typedef _CharT char_type;
569 typedef _Traits traits_type;
571 typedef typename traits_type::int_type int_type;
572 typedef typename traits_type::pos_type pos_type;
573 typedef typename traits_type::off_type off_type;
575 _LIBCPP_ALWAYS_INLINE
577 operator bool() const {return !fail();}
578 _LIBCPP_ALWAYS_INLINE bool operator!() const {return fail();}
579 _LIBCPP_ALWAYS_INLINE iostate rdstate() const {return ios_base::rdstate();}
580 _LIBCPP_ALWAYS_INLINE void clear(iostate __state = goodbit) {ios_base::clear(__state);}
581 _LIBCPP_ALWAYS_INLINE void setstate(iostate __state) {ios_base::setstate(__state);}
582 _LIBCPP_ALWAYS_INLINE bool good() const {return ios_base::good();}
583 _LIBCPP_ALWAYS_INLINE bool eof() const {return ios_base::eof();}
584 _LIBCPP_ALWAYS_INLINE bool fail() const {return ios_base::fail();}
585 _LIBCPP_ALWAYS_INLINE bool bad() const {return ios_base::bad();}
587 _LIBCPP_ALWAYS_INLINE iostate exceptions() const {return ios_base::exceptions();}
588 _LIBCPP_ALWAYS_INLINE void exceptions(iostate __except) {ios_base::exceptions(__except);}
590 // 27.5.4.1 Constructor/destructor:
591 _LIBCPP_INLINE_VISIBILITY
592 explicit basic_ios(basic_streambuf<char_type,traits_type>* __sb);
593 virtual ~basic_ios();
596 _LIBCPP_INLINE_VISIBILITY
597 basic_ostream<char_type, traits_type>* tie() const;
598 _LIBCPP_INLINE_VISIBILITY
599 basic_ostream<char_type, traits_type>* tie(basic_ostream<char_type, traits_type>* __tiestr);
601 _LIBCPP_INLINE_VISIBILITY
602 basic_streambuf<char_type, traits_type>* rdbuf() const;
603 _LIBCPP_INLINE_VISIBILITY
604 basic_streambuf<char_type, traits_type>* rdbuf(basic_streambuf<char_type, traits_type>* __sb);
606 basic_ios& copyfmt(const basic_ios& __rhs);
608 _LIBCPP_INLINE_VISIBILITY
609 char_type fill() const;
610 _LIBCPP_INLINE_VISIBILITY
611 char_type fill(char_type __ch);
613 _LIBCPP_INLINE_VISIBILITY
614 locale imbue(const locale& __loc);
616 _LIBCPP_INLINE_VISIBILITY
617 char narrow(char_type __c, char __dfault) const;
618 _LIBCPP_INLINE_VISIBILITY
619 char_type widen(char __c) const;
622 _LIBCPP_ALWAYS_INLINE
623 basic_ios() {// purposefully does no initialization
625 _LIBCPP_INLINE_VISIBILITY
626 void init(basic_streambuf<char_type, traits_type>* __sb);
628 _LIBCPP_INLINE_VISIBILITY
629 void move(basic_ios& __rhs);
630 #ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
631 _LIBCPP_ALWAYS_INLINE
632 void move(basic_ios&& __rhs) {move(__rhs);}
634 _LIBCPP_INLINE_VISIBILITY
635 void swap(basic_ios& __rhs) _NOEXCEPT;
636 _LIBCPP_INLINE_VISIBILITY
637 void set_rdbuf(basic_streambuf<char_type, traits_type>* __sb);
639 basic_ostream<char_type, traits_type>* __tie_;
640 mutable int_type __fill_;
643 template <class _CharT, class _Traits>
644 inline _LIBCPP_INLINE_VISIBILITY
645 basic_ios<_CharT, _Traits>::basic_ios(basic_streambuf<char_type,traits_type>* __sb)
650 template <class _CharT, class _Traits>
651 basic_ios<_CharT, _Traits>::~basic_ios()
655 template <class _CharT, class _Traits>
656 inline _LIBCPP_INLINE_VISIBILITY
658 basic_ios<_CharT, _Traits>::init(basic_streambuf<char_type, traits_type>* __sb)
660 ios_base::init(__sb);
662 __fill_ = traits_type::eof();
665 template <class _CharT, class _Traits>
666 inline _LIBCPP_INLINE_VISIBILITY
667 basic_ostream<_CharT, _Traits>*
668 basic_ios<_CharT, _Traits>::tie() const
673 template <class _CharT, class _Traits>
674 inline _LIBCPP_INLINE_VISIBILITY
675 basic_ostream<_CharT, _Traits>*
676 basic_ios<_CharT, _Traits>::tie(basic_ostream<char_type, traits_type>* __tiestr)
678 basic_ostream<char_type, traits_type>* __r = __tie_;
683 template <class _CharT, class _Traits>
684 inline _LIBCPP_INLINE_VISIBILITY
685 basic_streambuf<_CharT, _Traits>*
686 basic_ios<_CharT, _Traits>::rdbuf() const
688 return static_cast<basic_streambuf<char_type, traits_type>*>(ios_base::rdbuf());
691 template <class _CharT, class _Traits>
692 inline _LIBCPP_INLINE_VISIBILITY
693 basic_streambuf<_CharT, _Traits>*
694 basic_ios<_CharT, _Traits>::rdbuf(basic_streambuf<char_type, traits_type>* __sb)
696 basic_streambuf<char_type, traits_type>* __r = rdbuf();
697 ios_base::rdbuf(__sb);
701 template <class _CharT, class _Traits>
702 inline _LIBCPP_INLINE_VISIBILITY
704 basic_ios<_CharT, _Traits>::imbue(const locale& __loc)
706 locale __r = getloc();
707 ios_base::imbue(__loc);
709 rdbuf()->pubimbue(__loc);
713 template <class _CharT, class _Traits>
714 inline _LIBCPP_INLINE_VISIBILITY
716 basic_ios<_CharT, _Traits>::narrow(char_type __c, char __dfault) const
718 return use_facet<ctype<char_type> >(getloc()).narrow(__c, __dfault);
721 template <class _CharT, class _Traits>
722 inline _LIBCPP_INLINE_VISIBILITY
724 basic_ios<_CharT, _Traits>::widen(char __c) const
726 return use_facet<ctype<char_type> >(getloc()).widen(__c);
729 template <class _CharT, class _Traits>
730 inline _LIBCPP_INLINE_VISIBILITY
732 basic_ios<_CharT, _Traits>::fill() const
734 if (traits_type::eq_int_type(traits_type::eof(), __fill_))
735 __fill_ = widen(' ');
739 template <class _CharT, class _Traits>
740 inline _LIBCPP_INLINE_VISIBILITY
742 basic_ios<_CharT, _Traits>::fill(char_type __ch)
744 char_type __r = __fill_;
749 template <class _CharT, class _Traits>
750 basic_ios<_CharT, _Traits>&
751 basic_ios<_CharT, _Traits>::copyfmt(const basic_ios& __rhs)
755 __call_callbacks(erase_event);
756 ios_base::copyfmt(__rhs);
757 __tie_ = __rhs.__tie_;
758 __fill_ = __rhs.__fill_;
759 __call_callbacks(copyfmt_event);
760 exceptions(__rhs.exceptions());
765 template <class _CharT, class _Traits>
766 inline _LIBCPP_INLINE_VISIBILITY
768 basic_ios<_CharT, _Traits>::move(basic_ios& __rhs)
770 ios_base::move(__rhs);
771 __tie_ = __rhs.__tie_;
773 __fill_ = __rhs.__fill_;
776 template <class _CharT, class _Traits>
777 inline _LIBCPP_INLINE_VISIBILITY
779 basic_ios<_CharT, _Traits>::swap(basic_ios& __rhs) _NOEXCEPT
781 ios_base::swap(__rhs);
782 _VSTD::swap(__tie_, __rhs.__tie_);
783 _VSTD::swap(__fill_, __rhs.__fill_);
786 template <class _CharT, class _Traits>
787 inline _LIBCPP_INLINE_VISIBILITY
789 basic_ios<_CharT, _Traits>::set_rdbuf(basic_streambuf<char_type, traits_type>* __sb)
791 ios_base::set_rdbuf(__sb);
794 inline _LIBCPP_INLINE_VISIBILITY
796 boolalpha(ios_base& __str)
798 __str.setf(ios_base::boolalpha);
802 inline _LIBCPP_INLINE_VISIBILITY
804 noboolalpha(ios_base& __str)
806 __str.unsetf(ios_base::boolalpha);
810 inline _LIBCPP_INLINE_VISIBILITY
812 showbase(ios_base& __str)
814 __str.setf(ios_base::showbase);
818 inline _LIBCPP_INLINE_VISIBILITY
820 noshowbase(ios_base& __str)
822 __str.unsetf(ios_base::showbase);
826 inline _LIBCPP_INLINE_VISIBILITY
828 showpoint(ios_base& __str)
830 __str.setf(ios_base::showpoint);
834 inline _LIBCPP_INLINE_VISIBILITY
836 noshowpoint(ios_base& __str)
838 __str.unsetf(ios_base::showpoint);
842 inline _LIBCPP_INLINE_VISIBILITY
844 showpos(ios_base& __str)
846 __str.setf(ios_base::showpos);
850 inline _LIBCPP_INLINE_VISIBILITY
852 noshowpos(ios_base& __str)
854 __str.unsetf(ios_base::showpos);
858 inline _LIBCPP_INLINE_VISIBILITY
860 skipws(ios_base& __str)
862 __str.setf(ios_base::skipws);
866 inline _LIBCPP_INLINE_VISIBILITY
868 noskipws(ios_base& __str)
870 __str.unsetf(ios_base::skipws);
874 inline _LIBCPP_INLINE_VISIBILITY
876 uppercase(ios_base& __str)
878 __str.setf(ios_base::uppercase);
882 inline _LIBCPP_INLINE_VISIBILITY
884 nouppercase(ios_base& __str)
886 __str.unsetf(ios_base::uppercase);
890 inline _LIBCPP_INLINE_VISIBILITY
892 unitbuf(ios_base& __str)
894 __str.setf(ios_base::unitbuf);
898 inline _LIBCPP_INLINE_VISIBILITY
900 nounitbuf(ios_base& __str)
902 __str.unsetf(ios_base::unitbuf);
906 inline _LIBCPP_INLINE_VISIBILITY
908 internal(ios_base& __str)
910 __str.setf(ios_base::internal, ios_base::adjustfield);
914 inline _LIBCPP_INLINE_VISIBILITY
916 left(ios_base& __str)
918 __str.setf(ios_base::left, ios_base::adjustfield);
922 inline _LIBCPP_INLINE_VISIBILITY
924 right(ios_base& __str)
926 __str.setf(ios_base::right, ios_base::adjustfield);
930 inline _LIBCPP_INLINE_VISIBILITY
934 __str.setf(ios_base::dec, ios_base::basefield);
938 inline _LIBCPP_INLINE_VISIBILITY
942 __str.setf(ios_base::hex, ios_base::basefield);
946 inline _LIBCPP_INLINE_VISIBILITY
950 __str.setf(ios_base::oct, ios_base::basefield);
954 inline _LIBCPP_INLINE_VISIBILITY
956 fixed(ios_base& __str)
958 __str.setf(ios_base::fixed, ios_base::floatfield);
962 inline _LIBCPP_INLINE_VISIBILITY
964 scientific(ios_base& __str)
966 __str.setf(ios_base::scientific, ios_base::floatfield);
970 inline _LIBCPP_INLINE_VISIBILITY
972 hexfloat(ios_base& __str)
974 __str.setf(ios_base::fixed | ios_base::scientific, ios_base::floatfield);
978 inline _LIBCPP_INLINE_VISIBILITY
980 defaultfloat(ios_base& __str)
982 __str.unsetf(ios_base::floatfield);
986 _LIBCPP_END_NAMESPACE_STD
988 #endif // _LIBCPP_IOS