37 #pragma GCC system_header 43 #if __cplusplus < 201103L 49 namespace std _GLIBCXX_VISIBILITY(default)
51 _GLIBCXX_BEGIN_NAMESPACE_VERSION
59 _S_boolalpha = 1L << 0,
63 _S_internal = 1L << 4,
67 _S_scientific = 1L << 8,
68 _S_showbase = 1L << 9,
69 _S_showpoint = 1L << 10,
70 _S_showpos = 1L << 11,
72 _S_unitbuf = 1L << 13,
73 _S_uppercase = 1L << 14,
74 _S_adjustfield = _S_left | _S_right | _S_internal,
75 _S_basefield = _S_dec | _S_oct | _S_hex,
76 _S_floatfield = _S_scientific | _S_fixed,
77 _S_ios_fmtflags_end = 1L << 16,
78 _S_ios_fmtflags_max = __INT_MAX__,
79 _S_ios_fmtflags_min = ~__INT_MAX__
82 inline _GLIBCXX_CONSTEXPR _Ios_Fmtflags
83 operator&(_Ios_Fmtflags __a, _Ios_Fmtflags __b)
84 {
return _Ios_Fmtflags(static_cast<int>(__a) & static_cast<int>(__b)); }
86 inline _GLIBCXX_CONSTEXPR _Ios_Fmtflags
87 operator|(_Ios_Fmtflags __a, _Ios_Fmtflags __b)
88 {
return _Ios_Fmtflags(static_cast<int>(__a) | static_cast<int>(__b)); }
90 inline _GLIBCXX_CONSTEXPR _Ios_Fmtflags
91 operator^(_Ios_Fmtflags __a, _Ios_Fmtflags __b)
92 {
return _Ios_Fmtflags(static_cast<int>(__a) ^ static_cast<int>(__b)); }
94 inline _GLIBCXX_CONSTEXPR _Ios_Fmtflags
95 operator~(_Ios_Fmtflags __a)
96 {
return _Ios_Fmtflags(~static_cast<int>(__a)); }
98 inline const _Ios_Fmtflags&
99 operator|=(_Ios_Fmtflags& __a, _Ios_Fmtflags __b)
100 {
return __a = __a | __b; }
102 inline const _Ios_Fmtflags&
103 operator&=(_Ios_Fmtflags& __a, _Ios_Fmtflags __b)
104 {
return __a = __a & __b; }
106 inline const _Ios_Fmtflags&
107 operator^=(_Ios_Fmtflags& __a, _Ios_Fmtflags __b)
108 {
return __a = __a ^ __b; }
119 _S_ios_openmode_end = 1L << 16,
120 _S_ios_openmode_max = __INT_MAX__,
121 _S_ios_openmode_min = ~__INT_MAX__
124 inline _GLIBCXX_CONSTEXPR _Ios_Openmode
125 operator&(_Ios_Openmode __a, _Ios_Openmode __b)
126 {
return _Ios_Openmode(static_cast<int>(__a) & static_cast<int>(__b)); }
128 inline _GLIBCXX_CONSTEXPR _Ios_Openmode
129 operator|(_Ios_Openmode __a, _Ios_Openmode __b)
130 {
return _Ios_Openmode(static_cast<int>(__a) | static_cast<int>(__b)); }
132 inline _GLIBCXX_CONSTEXPR _Ios_Openmode
133 operator^(_Ios_Openmode __a, _Ios_Openmode __b)
134 {
return _Ios_Openmode(static_cast<int>(__a) ^ static_cast<int>(__b)); }
136 inline _GLIBCXX_CONSTEXPR _Ios_Openmode
137 operator~(_Ios_Openmode __a)
138 {
return _Ios_Openmode(~static_cast<int>(__a)); }
140 inline const _Ios_Openmode&
141 operator|=(_Ios_Openmode& __a, _Ios_Openmode __b)
142 {
return __a = __a | __b; }
144 inline const _Ios_Openmode&
145 operator&=(_Ios_Openmode& __a, _Ios_Openmode __b)
146 {
return __a = __a & __b; }
148 inline const _Ios_Openmode&
149 operator^=(_Ios_Openmode& __a, _Ios_Openmode __b)
150 {
return __a = __a ^ __b; }
158 _S_failbit = 1L << 2,
159 _S_ios_iostate_end = 1L << 16,
160 _S_ios_iostate_max = __INT_MAX__,
161 _S_ios_iostate_min = ~__INT_MAX__
164 inline _GLIBCXX_CONSTEXPR _Ios_Iostate
165 operator&(_Ios_Iostate __a, _Ios_Iostate __b)
166 {
return _Ios_Iostate(static_cast<int>(__a) & static_cast<int>(__b)); }
168 inline _GLIBCXX_CONSTEXPR _Ios_Iostate
169 operator|(_Ios_Iostate __a, _Ios_Iostate __b)
170 {
return _Ios_Iostate(static_cast<int>(__a) | static_cast<int>(__b)); }
172 inline _GLIBCXX_CONSTEXPR _Ios_Iostate
173 operator^(_Ios_Iostate __a, _Ios_Iostate __b)
174 {
return _Ios_Iostate(static_cast<int>(__a) ^ static_cast<int>(__b)); }
176 inline _GLIBCXX_CONSTEXPR _Ios_Iostate
177 operator~(_Ios_Iostate __a)
178 {
return _Ios_Iostate(~static_cast<int>(__a)); }
180 inline const _Ios_Iostate&
181 operator|=(_Ios_Iostate& __a, _Ios_Iostate __b)
182 {
return __a = __a | __b; }
184 inline const _Ios_Iostate&
185 operator&=(_Ios_Iostate& __a, _Ios_Iostate __b)
186 {
return __a = __a & __b; }
188 inline const _Ios_Iostate&
189 operator^=(_Ios_Iostate& __a, _Ios_Iostate __b)
190 {
return __a = __a ^ __b; }
196 _S_cur = _GLIBCXX_STDIO_SEEK_CUR,
197 _S_end = _GLIBCXX_STDIO_SEEK_END,
198 _S_ios_seekdir_end = 1L << 16
201 #if __cplusplus >= 201103L 207 const error_category& iostream_category() noexcept;
210 make_error_code(io_errc __e) noexcept
211 {
return error_code(static_cast<int>(__e), iostream_category()); }
214 make_error_condition(io_errc __e) noexcept
215 {
return error_condition(static_cast<int>(__e), iostream_category()); }
230 #if _GLIBCXX_USE_CXX11_ABI 231 #if __cplusplus < 201103L 254 #if _GLIBCXX_USE_CXX11_ABI 255 class _GLIBCXX_ABI_TAG_CXX11 failure :
public system_error 259 failure(
const string& __str);
261 #if __cplusplus >= 201103L 266 failure(
const char*,
const error_code& = io_errc::stream);
273 what()
const throw();
282 failure(
const string& __str)
throw();
290 what()
const throw();
329 static const fmtflags
dec = _S_dec;
332 static const fmtflags
fixed = _S_fixed;
335 static const fmtflags
hex = _S_hex;
340 static const fmtflags
internal = _S_internal;
344 static const fmtflags
left = _S_left;
347 static const fmtflags
oct = _S_oct;
351 static const fmtflags
right = _S_right;
368 static const fmtflags
skipws = _S_skipws;
378 static const fmtflags adjustfield = _S_adjustfield;
381 static const fmtflags basefield = _S_basefield;
384 static const fmtflags floatfield = _S_floatfield;
402 static const iostate badbit = _S_badbit;
405 static const iostate eofbit = _S_eofbit;
410 static const iostate failbit = _S_failbit;
413 static const iostate goodbit = _S_goodbit;
432 static const openmode app = _S_app;
435 static const openmode ate = _S_ate;
440 static const openmode binary = _S_bin;
443 static const openmode in = _S_in;
446 static const openmode out = _S_out;
449 static const openmode trunc = _S_trunc;
464 static const seekdir beg = _S_beg;
467 static const seekdir cur = _S_cur;
470 static const seekdir
end = _S_end;
473 typedef int io_state;
474 typedef int open_mode;
475 typedef int seek_dir;
504 typedef void (*event_callback) (
event __e,
ios_base& __b,
int __i);
517 register_callback(event_callback __fn,
int __index);
523 iostate _M_exception;
524 iostate _M_streambuf_state;
528 struct _Callback_list
531 _Callback_list* _M_next;
534 _Atomic_word _M_refcount;
537 _Callback_list* __cb)
538 : _M_next(__cb), _M_fn(__fn), _M_index(__index), _M_refcount(0) { }
541 _M_add_reference() { __gnu_cxx::__atomic_add_dispatch(&_M_refcount, 1); }
545 _M_remove_reference()
548 _GLIBCXX_SYNCHRONIZATION_HAPPENS_BEFORE(&_M_refcount);
549 int __res = __gnu_cxx::__exchange_and_add_dispatch(&_M_refcount, -1);
552 _GLIBCXX_SYNCHRONIZATION_HAPPENS_AFTER(&_M_refcount);
558 _Callback_list* _M_callbacks;
561 _M_call_callbacks(
event __ev)
throw();
564 _M_dispose_callbacks(
void)
throw();
571 _Words() : _M_pword(0), _M_iword(0) { }
579 enum { _S_local_word_size = 8 };
580 _Words _M_local_word[_S_local_word_size];
587 _M_grow_words(
int __index,
bool __iword);
609 static _Atomic_word _S_refcount;
610 static bool _S_synced_with_stdio;
632 fmtflags __old = _M_flags;
648 fmtflags __old = _M_flags;
663 setf(fmtflags __fmtfl, fmtflags __mask)
665 fmtflags __old = _M_flags;
667 _M_flags |= (__fmtfl & __mask);
679 { _M_flags &= ~__mask; }
690 {
return _M_precision; }
701 _M_precision = __prec;
740 sync_with_stdio(
bool __sync =
true);
752 imbue(
const locale& __loc)
throw();
764 {
return _M_ios_locale; }
775 {
return _M_ios_locale; }
811 _Words& __word = (__ix < _M_word_size)
812 ? _M_word[__ix] : _M_grow_words(__ix,
true);
813 return __word._M_iword;
832 _Words& __word = (__ix < _M_word_size)
833 ? _M_word[__ix] : _M_grow_words(__ix,
false);
834 return __word._M_pword;
851 #if __cplusplus < 201103L 864 operator=(
const ios_base&) =
delete;
1055 #if __cplusplus >= 201103L 1076 _GLIBCXX_END_NAMESPACE_VERSION
ios_base & left(ios_base &__base)
Calls base.setf(ios_base::left, ios_base::adjustfield).
void(* event_callback)(event __e, ios_base &__b, int __i)
The type of an event callback function.
void unsetf(fmtflags __mask)
Clearing format flags.
ios_base & noshowbase(ios_base &__base)
Calls base.unsetf(ios_base::showbase).
ios_base & uppercase(ios_base &__base)
Calls base.setf(ios_base::uppercase).
fmtflags setf(fmtflags __fmtfl)
Setting new format flags.
fmtflags flags(fmtflags __fmtfl)
Setting new format flags all at once.
constexpr const _Tp * end(initializer_list< _Tp > __ils) noexcept
Return an iterator pointing to one past the last element of the initializer_list. ...
_Ios_Iostate iostate
This is a bitmask type.
_Ios_Openmode openmode
This is a bitmask type.
Base class for all library exceptions.
streamsize width() const
Flags access.
static const fmtflags boolalpha
Insert/extract bool in alphabetic rather than numeric format.
void *& pword(int __ix)
Access to void pointer array.
ISO C++ entities toplevel namespace is std.
streamsize width(streamsize __wide)
Changing flags.
_Ios_Fmtflags fmtflags
This is a bitmask type.
locale getloc() const
Locale access.
const locale & _M_getloc() const
Locale access.
static const fmtflags showbase
Generates a prefix indicating the numeric base of generated integer output.
streamsize precision() const
Flags access.
event
The set of events that may be passed to an event callback.
long & iword(int __ix)
Access to integer array.
Thrown to indicate error code of underlying system.
ios_base & showbase(ios_base &__base)
Calls base.setf(ios_base::showbase).
ios_base & nouppercase(ios_base &__base)
Calls base.unsetf(ios_base::uppercase).
_Ios_Seekdir seekdir
This is an enumerated type.
ios_base & noshowpoint(ios_base &__base)
Calls base.unsetf(ios_base::showpoint).
static const fmtflags unitbuf
Flushes output after each output operation.
static const fmtflags showpoint
Generates a decimal-point character unconditionally in generated floating-point output.
bitset< _Nb > operator|(const bitset< _Nb > &__x, const bitset< _Nb > &__y) noexcept
Global bitwise operations on bitsets.
ios_base & defaultfloat(ios_base &__base)
Calls base.unsetf(ios_base::floatfield)
static const fmtflags uppercase
Replaces certain lowercase letters with their uppercase equivalents in generated output.
static const fmtflags showpos
Generates a + sign in non-negative generated numeric output.
bitset< _Nb > operator^(const bitset< _Nb > &__x, const bitset< _Nb > &__y) noexcept
Global bitwise operations on bitsets.
static const fmtflags skipws
Skips leading white space before certain input operations.
static const fmtflags floatfield
A mask of scientific|fixed. Useful for the 2-arg form of setf.
ios_base & nounitbuf(ios_base &__base)
Calls base.unsetf(ios_base::unitbuf).
ios_base & noboolalpha(ios_base &__base)
Calls base.unsetf(ios_base::boolalpha).
fmtflags flags() const
Access to format flags.
ios_base & scientific(ios_base &__base)
Calls base.setf(ios_base::scientific, ios_base::floatfield).
ios_base & dec(ios_base &__base)
Calls base.setf(ios_base::dec, ios_base::basefield).
static const fmtflags left
Adds fill characters on the right (final positions) of certain generated output. (I.e., the thing you print is flush left.)
streamsize precision(streamsize __prec)
Changing flags.
fmtflags setf(fmtflags __fmtfl, fmtflags __mask)
Setting new format flags.
static const fmtflags internal
Adds fill characters at a designated internal point in certain generated output, or identical to righ...
static const fmtflags adjustfield
A mask of left|right|internal. Useful for the 2-arg form of setf.
ios_base & showpos(ios_base &__base)
Calls base.setf(ios_base::showpos).
The base of the I/O class hierarchy.This class defines everything that can be defined about I/O that ...
ptrdiff_t streamsize
Integral type for I/O operation counts and buffer sizes.
static const fmtflags scientific
Generates floating-point output in scientific notation.
static const fmtflags right
Adds fill characters on the left (initial positions) of certain generated output. (I...
Class representing stream positions.
static const fmtflags basefield
A mask of dec|oct|hex. Useful for the 2-arg form of setf.
static const fmtflags hex
Converts integer input or generates integer output in hexadecimal base.
ios_base & oct(ios_base &__base)
Calls base.setf(ios_base::oct, ios_base::basefield).
One of two subclasses of exception.
ios_base & showpoint(ios_base &__base)
Calls base.setf(ios_base::showpoint).
ios_base & hex(ios_base &__base)
Calls base.setf(ios_base::hex, ios_base::basefield).
Container class for localization functionality.The locale class is first a class wrapper for C librar...
ios_base & boolalpha(ios_base &__base)
Calls base.setf(ios_base::boolalpha).
bitset< _Nb > operator &(const bitset< _Nb > &__x, const bitset< _Nb > &__y) noexcept
Global bitwise operations on bitsets.
ios_base & noskipws(ios_base &__base)
Calls base.unsetf(ios_base::skipws).
ios_base & noshowpos(ios_base &__base)
Calls base.unsetf(ios_base::showpos).
fpos< mbstate_t > streampos
File position for char streams.
ios_base & hexfloat(ios_base &__base)
Calls base.setf(ios_base::fixed|ios_basescientific, ios_base::floatfield)
ios_base & fixed(ios_base &__base)
Calls base.setf(ios_base::fixed, ios_base::floatfield).
long long streamoff
Type used by fpos, char_traits<char>, and char_traits<wchar_t>.
ios_base & skipws(ios_base &__base)
Calls base.setf(ios_base::skipws).
ios_base & right(ios_base &__base)
Calls base.setf(ios_base::right, ios_base::adjustfield).
static const fmtflags fixed
Generate floating-point output in fixed-point notation.
static const fmtflags oct
Converts integer input or generates integer output in octal base.
ios_base & unitbuf(ios_base &__base)
Calls base.setf(ios_base::unitbuf).
static const fmtflags dec
Converts integer input or generates integer output in decimal base.