37 #pragma GCC system_header
43 namespace std _GLIBCXX_VISIBILITY(default)
45 _GLIBCXX_BEGIN_NAMESPACE_VERSION
53 _S_boolalpha = 1L << 0,
57 _S_internal = 1L << 4,
61 _S_scientific = 1L << 8,
62 _S_showbase = 1L << 9,
63 _S_showpoint = 1L << 10,
64 _S_showpos = 1L << 11,
66 _S_unitbuf = 1L << 13,
67 _S_uppercase = 1L << 14,
68 _S_adjustfield = _S_left | _S_right | _S_internal,
69 _S_basefield = _S_dec | _S_oct | _S_hex,
70 _S_floatfield = _S_scientific | _S_fixed,
71 _S_ios_fmtflags_end = 1L << 16
74 inline _GLIBCXX_CONSTEXPR _Ios_Fmtflags
75 operator&(_Ios_Fmtflags __a, _Ios_Fmtflags __b)
76 {
return _Ios_Fmtflags(static_cast<int>(__a) & static_cast<int>(__b)); }
78 inline _GLIBCXX_CONSTEXPR _Ios_Fmtflags
79 operator|(_Ios_Fmtflags __a, _Ios_Fmtflags __b)
80 {
return _Ios_Fmtflags(static_cast<int>(__a) | static_cast<int>(__b)); }
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
88 {
return _Ios_Fmtflags(~static_cast<int>(__a)); }
90 inline const _Ios_Fmtflags&
91 operator|=(_Ios_Fmtflags& __a, _Ios_Fmtflags __b)
92 {
return __a = __a | __b; }
94 inline const _Ios_Fmtflags&
95 operator&=(_Ios_Fmtflags& __a, _Ios_Fmtflags __b)
96 {
return __a = __a & __b; }
98 inline const _Ios_Fmtflags&
99 operator^=(_Ios_Fmtflags& __a, _Ios_Fmtflags __b)
100 {
return __a = __a ^ __b; }
111 _S_ios_openmode_end = 1L << 16
114 inline _GLIBCXX_CONSTEXPR _Ios_Openmode
115 operator&(_Ios_Openmode __a, _Ios_Openmode __b)
116 {
return _Ios_Openmode(static_cast<int>(__a) & static_cast<int>(__b)); }
118 inline _GLIBCXX_CONSTEXPR _Ios_Openmode
119 operator|(_Ios_Openmode __a, _Ios_Openmode __b)
120 {
return _Ios_Openmode(static_cast<int>(__a) | static_cast<int>(__b)); }
122 inline _GLIBCXX_CONSTEXPR _Ios_Openmode
123 operator^(_Ios_Openmode __a, _Ios_Openmode __b)
124 {
return _Ios_Openmode(static_cast<int>(__a) ^ static_cast<int>(__b)); }
126 inline _GLIBCXX_CONSTEXPR _Ios_Openmode
128 {
return _Ios_Openmode(~static_cast<int>(__a)); }
130 inline const _Ios_Openmode&
131 operator|=(_Ios_Openmode& __a, _Ios_Openmode __b)
132 {
return __a = __a | __b; }
134 inline const _Ios_Openmode&
135 operator&=(_Ios_Openmode& __a, _Ios_Openmode __b)
136 {
return __a = __a & __b; }
138 inline const _Ios_Openmode&
139 operator^=(_Ios_Openmode& __a, _Ios_Openmode __b)
140 {
return __a = __a ^ __b; }
148 _S_failbit = 1L << 2,
149 _S_ios_iostate_end = 1L << 16
152 inline _GLIBCXX_CONSTEXPR _Ios_Iostate
153 operator&(_Ios_Iostate __a, _Ios_Iostate __b)
154 {
return _Ios_Iostate(static_cast<int>(__a) & static_cast<int>(__b)); }
156 inline _GLIBCXX_CONSTEXPR _Ios_Iostate
157 operator|(_Ios_Iostate __a, _Ios_Iostate __b)
158 {
return _Ios_Iostate(static_cast<int>(__a) | static_cast<int>(__b)); }
160 inline _GLIBCXX_CONSTEXPR _Ios_Iostate
161 operator^(_Ios_Iostate __a, _Ios_Iostate __b)
162 {
return _Ios_Iostate(static_cast<int>(__a) ^ static_cast<int>(__b)); }
164 inline _GLIBCXX_CONSTEXPR _Ios_Iostate
166 {
return _Ios_Iostate(~static_cast<int>(__a)); }
168 inline const _Ios_Iostate&
169 operator|=(_Ios_Iostate& __a, _Ios_Iostate __b)
170 {
return __a = __a | __b; }
172 inline const _Ios_Iostate&
173 operator&=(_Ios_Iostate& __a, _Ios_Iostate __b)
174 {
return __a = __a & __b; }
176 inline const _Ios_Iostate&
177 operator^=(_Ios_Iostate& __a, _Ios_Iostate __b)
178 {
return __a = __a ^ __b; }
184 _S_cur = _GLIBCXX_STDIO_SEEK_CUR,
185 _S_end = _GLIBCXX_STDIO_SEEK_END,
186 _S_ios_seekdir_end = 1L << 16
215 failure(
const string& __str)
throw();
223 what()
const throw();
261 static const fmtflags
dec = _S_dec;
264 static const fmtflags
fixed = _S_fixed;
267 static const fmtflags
hex = _S_hex;
272 static const fmtflags
internal = _S_internal;
276 static const fmtflags
left = _S_left;
279 static const fmtflags
oct = _S_oct;
283 static const fmtflags
right = _S_right;
300 static const fmtflags
skipws = _S_skipws;
364 static const openmode
app = _S_app;
367 static const openmode
ate = _S_ate;
375 static const openmode
in = _S_in;
378 static const openmode
out = _S_out;
381 static const openmode
trunc = _S_trunc;
396 static const seekdir
beg = _S_beg;
399 static const seekdir
cur = _S_cur;
402 static const seekdir
end = _S_end;
405 typedef int io_state;
406 typedef int open_mode;
407 typedef int seek_dir;
455 iostate _M_exception;
456 iostate _M_streambuf_state;
460 struct _Callback_list
463 _Callback_list* _M_next;
466 _Atomic_word _M_refcount;
469 _Callback_list* __cb)
470 : _M_next(__cb), _M_fn(__fn), _M_index(__index), _M_refcount(0) { }
473 _M_add_reference() { __gnu_cxx::__atomic_add_dispatch(&_M_refcount, 1); }
477 _M_remove_reference()
480 _GLIBCXX_SYNCHRONIZATION_HAPPENS_BEFORE(&_M_refcount);
481 int __res = __gnu_cxx::__exchange_and_add_dispatch(&_M_refcount, -1);
484 _GLIBCXX_SYNCHRONIZATION_HAPPENS_AFTER(&_M_refcount);
490 _Callback_list* _M_callbacks;
493 _M_call_callbacks(
event __ev)
throw();
496 _M_dispose_callbacks(
void) throw();
503 _Words() : _M_pword(0), _M_iword(0) { }
511 enum { _S_local_word_size = 8 };
512 _Words _M_local_word[_S_local_word_size];
519 _M_grow_words(
int __index,
bool __iword);
522 locale _M_ios_locale;
535 friend class ios_base;
541 static _Atomic_word _S_refcount;
542 static bool _S_synced_with_stdio;
564 fmtflags __old = _M_flags;
580 fmtflags __old = _M_flags;
595 setf(fmtflags __fmtfl, fmtflags __mask)
597 fmtflags __old = _M_flags;
599 _M_flags |= (__fmtfl & __mask);
611 { _M_flags &= ~__mask; }
622 {
return _M_precision; }
633 _M_precision = __prec;
696 {
return _M_ios_locale; }
707 {
return _M_ios_locale; }
743 _Words& __word = (__ix < _M_word_size)
744 ? _M_word[__ix] : _M_grow_words(__ix,
true);
745 return __word._M_iword;
764 _Words& __word = (__ix < _M_word_size)
765 ? _M_word[__ix] : _M_grow_words(__ix,
false);
766 return __word._M_pword;
789 operator=(const ios_base&);
972 _GLIBCXX_END_NAMESPACE_VERSION
static const fmtflags showpoint
Generates a decimal-point character unconditionally in generated floating-point output.
static const openmode app
Seek to end before each write.
static const fmtflags basefield
A mask of dec|oct|hex. Useful for the 2-arg form of setf.
_Ios_Iostate iostate
This is a bitmask type.
static const fmtflags scientific
Generates floating-point output in scientific notation.
streamsize width(streamsize __wide)
Changing flags.
static const fmtflags showpos
Generates a + sign in non-negative generated numeric output.
static const iostate failbit
Indicates that an input operation failed to read the expected characters, or that an output operation...
bitset< _Nb > operator~() const noexcept
See the no-argument flip().
bitset< _Nb > operator|(const bitset< _Nb > &__x, const bitset< _Nb > &__y) noexcept
Global bitwise operations on bitsets.
void register_callback(event_callback __fn, int __index)
Add the callback __fn with parameter __index.
_Ios_Fmtflags fmtflags
This is a bitmask type.
void unsetf(fmtflags __mask)
Clearing format flags.
streamsize precision() const
Flags access.
static const fmtflags unitbuf
Flushes output after each output operation.
static const fmtflags adjustfield
A mask of left|right|internal. Useful for the 2-arg form of setf.
fmtflags setf(fmtflags __fmtfl)
Setting new format flags.
The base of the I/O class hierarchy.This class defines everything that can be defined about I/O that ...
static const fmtflags boolalpha
Insert/extract bool in alphabetic rather than numeric format.
event
The set of events that may be passed to an event callback.
Base class for all library exceptions.
static const openmode in
Open for input. Default for ifstream and fstream.
void *& pword(int __ix)
Access to void pointer array.
ios_base & noskipws(ios_base &__base)
Calls base.unsetf(ios_base::skipws).
ios_base & noshowbase(ios_base &__base)
Calls base.unsetf(ios_base::showbase).
static const iostate goodbit
Indicates all is well.
locale getloc() const
Locale access.
static const iostate badbit
Indicates a loss of integrity in an input or output sequence (such as an irrecoverable read error fro...
ios_base & noshowpoint(ios_base &__base)
Calls base.unsetf(ios_base::showpoint).
static const fmtflags oct
Converts integer input or generates integer output in octal base.
static const fmtflags dec
Converts integer input or generates integer output in decimal base.
static const openmode binary
Perform input and output in binary mode (as opposed to text mode). This is probably not what you thin...
static const openmode trunc
Open for input. Default for ofstream.
static const seekdir cur
Request a seek relative to the current position within the sequence.
virtual const char * what() const
static bool sync_with_stdio(bool __sync=true)
Interaction with the standard C I/O objects.
static int xalloc()
Access to unique indices.
static const fmtflags showbase
Generates a prefix indicating the numeric base of generated integer output.
static const fmtflags skipws
Skips leading white space before certain input operations.
static const fmtflags fixed
Generate floating-point output in fixed-point notation.
Container class for localization functionality.The locale class is first a class wrapper for C librar...
ios_base & nounitbuf(ios_base &__base)
Calls base.unsetf(ios_base::unitbuf).
Class representing stream positions.
static const fmtflags right
Adds fill characters on the left (initial positions) of certain generated output. (I...
static const seekdir beg
Request a seek relative to the beginning of the stream.
fmtflags setf(fmtflags __fmtfl, fmtflags __mask)
Setting new format flags.
static const fmtflags uppercase
Replaces certain lowercase letters with their uppercase equivalents in generated output.
streamsize precision(streamsize __prec)
Changing flags.
static const fmtflags floatfield
A mask of scientific|fixed. Useful for the 2-arg form of setf.
long long streamoff
Type used by fpos, char_traits<char>, and char_traits<wchar_t>.
static const openmode ate
Open and seek to end immediately after opening.
_Ios_Openmode openmode
This is a bitmask type.
void(* event_callback)(event __e, ios_base &__b, int __i)
The type of an event callback function.
static const openmode out
Open for output. Default for ofstream and fstream.
ios_base & noshowpos(ios_base &__base)
Calls base.unsetf(ios_base::showpos).
static const seekdir end
Request a seek relative to the current end of the sequence.
locale imbue(const locale &__loc)
Setting a new locale.
fmtflags flags(fmtflags __fmtfl)
Setting new format flags all at once.
static const fmtflags hex
Converts integer input or generates integer output in hexadecimal base.
ios_base & nouppercase(ios_base &__base)
Calls base.unsetf(ios_base::uppercase).
bitset< _Nb > operator&(const bitset< _Nb > &__x, const bitset< _Nb > &__y) noexcept
Global bitwise operations on bitsets.
static const iostate eofbit
Indicates that an input operation reached the end of an input sequence.
fmtflags flags() const
Access to format flags.
These are thrown to indicate problems with io.27.4.2.1.1 Class ios_base::failure. ...
_Siter_base< _Iterator >::iterator_type __base(_Iterator __it)
streamsize width() const
Flags access.
static const fmtflags internal
Adds fill characters at a designated internal point in certain generated output, or identical to righ...
long & iword(int __ix)
Access to integer array.
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.)
ptrdiff_t streamsize
Integral type for I/O operation counts and buffer sizes.
bitset< _Nb > operator^(const bitset< _Nb > &__x, const bitset< _Nb > &__y) noexcept
Global bitwise operations on bitsets.
const locale & _M_getloc() const
Locale access.
_Ios_Seekdir seekdir
This is an enumerated type.
ios_base & noboolalpha(ios_base &__base)
Calls base.unsetf(ios_base::boolalpha).