37#pragma GCC system_header
43#if __cplusplus < 201103L
49namespace 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 _GLIBCXX_NODISCARD _GLIBCXX_CONSTEXPR
84 operator&(_Ios_Fmtflags __a, _Ios_Fmtflags __b) _GLIBCXX_NOTHROW
85 {
return _Ios_Fmtflags(
static_cast<int>(__a) &
static_cast<int>(__b)); }
87 _GLIBCXX_NODISCARD _GLIBCXX_CONSTEXPR
89 operator|(_Ios_Fmtflags __a, _Ios_Fmtflags __b) _GLIBCXX_NOTHROW
90 {
return _Ios_Fmtflags(
static_cast<int>(__a) |
static_cast<int>(__b)); }
92 _GLIBCXX_NODISCARD _GLIBCXX_CONSTEXPR
94 operator^(_Ios_Fmtflags __a, _Ios_Fmtflags __b) _GLIBCXX_NOTHROW
95 {
return _Ios_Fmtflags(
static_cast<int>(__a) ^
static_cast<int>(__b)); }
97 _GLIBCXX_NODISCARD _GLIBCXX_CONSTEXPR
99 operator~(_Ios_Fmtflags __a) _GLIBCXX_NOTHROW
100 {
return _Ios_Fmtflags(~
static_cast<int>(__a)); }
103 inline const _Ios_Fmtflags&
104 operator|=(_Ios_Fmtflags& __a, _Ios_Fmtflags __b) _GLIBCXX_NOTHROW
105 {
return __a = __a | __b; }
108 inline const _Ios_Fmtflags&
109 operator&=(_Ios_Fmtflags& __a, _Ios_Fmtflags __b) _GLIBCXX_NOTHROW
110 {
return __a = __a & __b; }
113 inline const _Ios_Fmtflags&
114 operator^=(_Ios_Fmtflags& __a, _Ios_Fmtflags __b) _GLIBCXX_NOTHROW
115 {
return __a = __a ^ __b; }
126 _S_noreplace = 1L << 6,
127 _S_ios_openmode_end = 1L << 16,
128 _S_ios_openmode_max = __INT_MAX__,
129 _S_ios_openmode_min = ~__INT_MAX__
132 _GLIBCXX_NODISCARD _GLIBCXX_CONSTEXPR
134 operator&(_Ios_Openmode __a, _Ios_Openmode __b) _GLIBCXX_NOTHROW
135 {
return _Ios_Openmode(
static_cast<int>(__a) &
static_cast<int>(__b)); }
137 _GLIBCXX_NODISCARD _GLIBCXX_CONSTEXPR
139 operator|(_Ios_Openmode __a, _Ios_Openmode __b) _GLIBCXX_NOTHROW
140 {
return _Ios_Openmode(
static_cast<int>(__a) |
static_cast<int>(__b)); }
142 _GLIBCXX_NODISCARD _GLIBCXX_CONSTEXPR
144 operator^(_Ios_Openmode __a, _Ios_Openmode __b) _GLIBCXX_NOTHROW
145 {
return _Ios_Openmode(
static_cast<int>(__a) ^
static_cast<int>(__b)); }
147 _GLIBCXX_NODISCARD _GLIBCXX_CONSTEXPR
149 operator~(_Ios_Openmode __a) _GLIBCXX_NOTHROW
150 {
return _Ios_Openmode(~
static_cast<int>(__a)); }
153 inline const _Ios_Openmode&
154 operator|=(_Ios_Openmode& __a, _Ios_Openmode __b) _GLIBCXX_NOTHROW
155 {
return __a = __a | __b; }
158 inline const _Ios_Openmode&
159 operator&=(_Ios_Openmode& __a, _Ios_Openmode __b) _GLIBCXX_NOTHROW
160 {
return __a = __a & __b; }
163 inline const _Ios_Openmode&
164 operator^=(_Ios_Openmode& __a, _Ios_Openmode __b) _GLIBCXX_NOTHROW
165 {
return __a = __a ^ __b; }
173 _S_failbit = 1L << 2,
174 _S_ios_iostate_end = 1L << 16,
175 _S_ios_iostate_max = __INT_MAX__,
176 _S_ios_iostate_min = ~__INT_MAX__
179 _GLIBCXX_NODISCARD _GLIBCXX_CONSTEXPR
181 operator&(_Ios_Iostate __a, _Ios_Iostate __b) _GLIBCXX_NOTHROW
182 {
return _Ios_Iostate(
static_cast<int>(__a) &
static_cast<int>(__b)); }
184 _GLIBCXX_NODISCARD _GLIBCXX_CONSTEXPR
186 operator|(_Ios_Iostate __a, _Ios_Iostate __b) _GLIBCXX_NOTHROW
187 {
return _Ios_Iostate(
static_cast<int>(__a) |
static_cast<int>(__b)); }
189 _GLIBCXX_NODISCARD _GLIBCXX_CONSTEXPR
191 operator^(_Ios_Iostate __a, _Ios_Iostate __b) _GLIBCXX_NOTHROW
192 {
return _Ios_Iostate(
static_cast<int>(__a) ^
static_cast<int>(__b)); }
194 _GLIBCXX_NODISCARD _GLIBCXX_CONSTEXPR
196 operator~(_Ios_Iostate __a) _GLIBCXX_NOTHROW
197 {
return _Ios_Iostate(~
static_cast<int>(__a)); }
200 inline const _Ios_Iostate&
201 operator|=(_Ios_Iostate& __a, _Ios_Iostate __b) _GLIBCXX_NOTHROW
202 {
return __a = __a | __b; }
205 inline const _Ios_Iostate&
206 operator&=(_Ios_Iostate& __a, _Ios_Iostate __b) _GLIBCXX_NOTHROW
207 {
return __a = __a & __b; }
210 inline const _Ios_Iostate&
211 operator^=(_Ios_Iostate& __a, _Ios_Iostate __b) _GLIBCXX_NOTHROW
212 {
return __a = __a ^ __b; }
218 _S_cur = _GLIBCXX_STDIO_SEEK_CUR,
219 _S_end = _GLIBCXX_STDIO_SEEK_END,
220 _S_ios_seekdir_end = 1L << 16
223#if __cplusplus >= 201103L
227 template <>
struct is_error_code_enum<
io_errc> :
public true_type { };
229 [[__nodiscard__, __gnu__::__const__]]
230 const error_category&
231 iostream_category() noexcept;
236 {
return error_code(
static_cast<int>(__e), iostream_category()); }
239 inline error_condition
241 {
return error_condition(
static_cast<int>(__e), iostream_category()); }
256#if _GLIBCXX_USE_CXX11_ABI
257#if __cplusplus < 201103L
280#if _GLIBCXX_USE_CXX11_ABI
281 class _GLIBCXX_ABI_TAG_CXX11 failure :
public system_error
285 failure(
const string& __str);
287#if __cplusplus >= 201103L
292 failure(
const char*,
const error_code& = io_errc::stream);
299 what()
const throw();
308 failure(
const string& __str)
throw();
316 what()
const throw();
318#if __cplusplus >= 201103L
323 failure(
const string& __s,
const error_code&) noexcept
329 : failure(
string(__s))
476 static const openmode
app = _S_app;
479 static const openmode
ate = _S_ate;
487 static const openmode
in = _S_in;
490 static const openmode
out = _S_out;
493 static const openmode trunc = _S_trunc;
495 static const openmode __noreplace = _S_noreplace;
497#ifdef __glibcxx_ios_noreplace
499 static const openmode noreplace = _S_noreplace;
515 static const seekdir
beg = _S_beg;
518 static const seekdir
cur = _S_cur;
521 static const seekdir
end = _S_end;
523#if __cplusplus <= 201402L
526 _GLIBCXX_DEPRECATED_SUGGEST(
"std::iostate");
527 typedef int open_mode
528 _GLIBCXX_DEPRECATED_SUGGEST(
"std::openmode");
530 _GLIBCXX_DEPRECATED_SUGGEST(
"std::seekdir");
533 _GLIBCXX_DEPRECATED_SUGGEST(
"std::streampos");
535 _GLIBCXX_DEPRECATED_SUGGEST(
"std::streamoff");
581 iostate _M_exception;
582 iostate _M_streambuf_state;
586 struct _Callback_list
589 _Callback_list* _M_next;
592 _Atomic_word _M_refcount;
595 _Callback_list* __cb)
596 : _M_next(__cb), _M_fn(__fn), _M_index(__index), _M_refcount(0) { }
599 _M_add_reference() { __gnu_cxx::__atomic_add_dispatch(&_M_refcount, 1); }
603 _M_remove_reference()
606 _GLIBCXX_SYNCHRONIZATION_HAPPENS_BEFORE(&_M_refcount);
607 int __res = __gnu_cxx::__exchange_and_add_dispatch(&_M_refcount, -1);
610 _GLIBCXX_SYNCHRONIZATION_HAPPENS_AFTER(&_M_refcount);
616 _Callback_list* _M_callbacks;
619 _M_call_callbacks(
event __ev)
throw();
622 _M_dispose_callbacks(
void)
throw();
629 _Words() : _M_pword(0), _M_iword(0) { }
637 enum { _S_local_word_size = 8 };
638 _Words _M_local_word[_S_local_word_size];
645 _M_grow_words(
int __index,
bool __iword);
648 locale _M_ios_locale;
661 friend class ios_base;
666#if __cplusplus >= 201103L
667 Init(
const Init&) =
default;
668 Init& operator=(
const Init&) =
default;
672 static _Atomic_word _S_refcount;
673 static bool _S_synced_with_stdio;
730 _M_flags |= (__fmtfl & __mask);
742 { _M_flags &= ~__mask; }
753 {
return _M_precision; }
764 _M_precision = __prec;
827 {
return _M_ios_locale; }
838 {
return _M_ios_locale; }
874 _Words& __word = ((unsigned)__ix < (unsigned)_M_word_size)
875 ? _M_word[__ix] : _M_grow_words(__ix,
true);
876 return __word._M_iword;
895 _Words& __word = ((unsigned)__ix < (unsigned)_M_word_size)
896 ? _M_word[__ix] : _M_grow_words(__ix,
false);
897 return __word._M_pword;
914#if __cplusplus < 201103L
927 operator=(
const ios_base&) =
delete;
1118#if __cplusplus >= 201103L
1139_GLIBCXX_END_NAMESPACE_VERSION
error_condition make_error_condition(future_errc __errc) noexcept
Overload of make_error_condition for future_errc.
error_code make_error_code(future_errc __errc) noexcept
Overload of make_error_code for future_errc.
class __attribute((__abi_tag__("cxx11"))) failure typedef _Ios_Fmtflags fmtflags
These are thrown to indicate problems with io.
ISO C++ entities toplevel namespace is std.
ios_base & scientific(ios_base &__base)
Calls base.setf(ios_base::scientific, ios_base::floatfield).
ios_base & internal(ios_base &__base)
Calls base.setf(ios_base::internal, ios_base::adjustfield).
ios_base & noskipws(ios_base &__base)
Calls base.unsetf(ios_base::skipws).
ptrdiff_t streamsize
Integral type for I/O operation counts and buffer sizes.
ios_base & hex(ios_base &__base)
Calls base.setf(ios_base::hex, ios_base::basefield).
ios_base & left(ios_base &__base)
Calls base.setf(ios_base::left, ios_base::adjustfield).
ios_base & noshowpoint(ios_base &__base)
Calls base.unsetf(ios_base::showpoint).
ios_base & unitbuf(ios_base &__base)
Calls base.setf(ios_base::unitbuf).
ios_base & nounitbuf(ios_base &__base)
Calls base.unsetf(ios_base::unitbuf).
ios_base & showbase(ios_base &__base)
Calls base.setf(ios_base::showbase).
long long streamoff
Type used by fpos, char_traits<char>, and char_traits<wchar_t>.
ios_base & noshowpos(ios_base &__base)
Calls base.unsetf(ios_base::showpos).
ios_base & nouppercase(ios_base &__base)
Calls base.unsetf(ios_base::uppercase).
ios_base & noshowbase(ios_base &__base)
Calls base.unsetf(ios_base::showbase).
ios_base & oct(ios_base &__base)
Calls base.setf(ios_base::oct, ios_base::basefield).
ios_base & dec(ios_base &__base)
Calls base.setf(ios_base::dec, ios_base::basefield).
ios_base & right(ios_base &__base)
Calls base.setf(ios_base::right, ios_base::adjustfield).
constexpr bitset< _Nb > operator^(const bitset< _Nb > &__x, const bitset< _Nb > &__y) noexcept
Global bitwise operations on bitsets.
ios_base & showpoint(ios_base &__base)
Calls base.setf(ios_base::showpoint).
ios_base & skipws(ios_base &__base)
Calls base.setf(ios_base::skipws).
ios_base & fixed(ios_base &__base)
Calls base.setf(ios_base::fixed, ios_base::floatfield).
ios_base & showpos(ios_base &__base)
Calls base.setf(ios_base::showpos).
ios_base & hexfloat(ios_base &__base)
Calls base.setf(ios_base::fixed|ios_basescientific, ios_base::floatfield)
ios_base & defaultfloat(ios_base &__base)
Calls base.unsetf(ios_base::floatfield)
constexpr bitset< _Nb > operator|(const bitset< _Nb > &__x, const bitset< _Nb > &__y) noexcept
Global bitwise operations on bitsets.
ios_base & uppercase(ios_base &__base)
Calls base.setf(ios_base::uppercase).
ios_base & boolalpha(ios_base &__base)
Calls base.setf(ios_base::boolalpha).
ios_base & noboolalpha(ios_base &__base)
Calls base.unsetf(ios_base::boolalpha).
constexpr bitset< _Nb > operator&(const bitset< _Nb > &__x, const bitset< _Nb > &__y) noexcept
Global bitwise operations on bitsets.
One of two subclasses of exception.
An exception type that includes an error_code value.
Base class for all library exceptions.
The base of the I/O class hierarchy.
fmtflags setf(fmtflags __fmtfl)
Setting new format flags.
static const fmtflags skipws
Skips leading white space before certain input operations.
static const fmtflags hex
Converts integer input or generates integer output in hexadecimal base.
_Ios_Seekdir seekdir
This is an enumerated type.
static const fmtflags right
Adds fill characters on the left (initial positions) of certain generated output. (I....
static const seekdir cur
Request a seek relative to the current position within the sequence.
static const fmtflags uppercase
Replaces certain lowercase letters with their uppercase equivalents in generated output.
static const fmtflags basefield
A mask of dec|oct|hex. Useful for the 2-arg form of setf.
void *& pword(int __ix)
Access to void pointer array.
static const seekdir beg
Request a seek relative to the beginning of the stream.
streamsize precision() const
Flags access.
void(*) event_callback(event __e, ios_base &__b, int __i)
The type of an event callback function.
locale imbue(const locale &__loc)
Setting a new locale.
static const fmtflags dec
Converts integer input or generates integer output in decimal base.
static int xalloc()
Access to unique indices.
event
The set of events that may be passed to an event callback.
fmtflags flags(fmtflags __fmtfl)
Setting new format flags all at once.
void unsetf(fmtflags __mask)
Clearing format flags.
static const fmtflags showpoint
Generates a decimal-point character unconditionally in generated floating-point output.
static const seekdir end
Request a seek relative to the current end of the sequence.
void register_callback(event_callback __fn, int __index)
Add the callback __fn with parameter __index.
static const openmode in
Open for input. Default for ifstream and fstream.
static const fmtflags showbase
Generates a prefix indicating the numeric base of generated integer output.
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 openmode out
Open for output. Default for ofstream and fstream.
static const fmtflags boolalpha
Insert/extract bool in alphabetic rather than numeric format.
fmtflags flags() const
Access to format flags.
static const iostate eofbit
Indicates that an input operation reached the end of an input sequence.
static const fmtflags floatfield
A mask of scientific|fixed. Useful for the 2-arg form of setf.
fmtflags setf(fmtflags __fmtfl, fmtflags __mask)
Setting new format flags.
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 iostate goodbit
Indicates all is well.
const locale & _M_getloc() const
Locale access.
static const fmtflags unitbuf
Flushes output after each output operation.
static const iostate badbit
Indicates a loss of integrity in an input or output sequence (such as an irrecoverable read error fro...
streamsize width() const
Flags access.
static bool sync_with_stdio(bool __sync=true)
Interaction with the standard C I/O objects.
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.
static const openmode app
Seek to end before each write.
streamsize width(streamsize __wide)
Changing flags.
static const fmtflags left
Adds fill characters on the right (final positions) of certain generated output. (I....
static const fmtflags showpos
Generates a + sign in non-negative generated numeric output.
_Ios_Openmode openmode
This is a bitmask type.
static const openmode ate
Open and seek to end immediately after opening.
_Ios_Iostate iostate
This is a bitmask type.
locale getloc() const
Locale access.
streamsize precision(streamsize __prec)
Changing flags.
static const iostate failbit
Indicates that an input operation failed to read the expected characters, or that an output operation...
static const fmtflags scientific
Generates floating-point output in scientific notation.
static const fmtflags adjustfield
A mask of left|right|internal. Useful for the 2-arg form of setf.
Container class for localization functionality.
Class representing stream positions.