37 #ifdef _GLIBCXX_SYSHDR 38 #pragma GCC system_header 45 #if __cplusplus < 201103L 51 namespace std _GLIBCXX_VISIBILITY(default)
53 _GLIBCXX_BEGIN_NAMESPACE_VERSION
61 _S_boolalpha = 1L << 0,
65 _S_internal = 1L << 4,
69 _S_scientific = 1L << 8,
70 _S_showbase = 1L << 9,
71 _S_showpoint = 1L << 10,
72 _S_showpos = 1L << 11,
74 _S_unitbuf = 1L << 13,
75 _S_uppercase = 1L << 14,
76 _S_adjustfield = _S_left | _S_right | _S_internal,
77 _S_basefield = _S_dec | _S_oct | _S_hex,
78 _S_floatfield = _S_scientific | _S_fixed,
79 _S_ios_fmtflags_end = 1L << 16,
80 _S_ios_fmtflags_max = __INT_MAX__,
81 _S_ios_fmtflags_min = ~__INT_MAX__
84 _GLIBCXX_NODISCARD _GLIBCXX_CONSTEXPR
86 operator&(_Ios_Fmtflags __a, _Ios_Fmtflags __b) _GLIBCXX_NOTHROW
87 {
return _Ios_Fmtflags(static_cast<int>(__a) & static_cast<int>(__b)); }
89 _GLIBCXX_NODISCARD _GLIBCXX_CONSTEXPR
91 operator|(_Ios_Fmtflags __a, _Ios_Fmtflags __b) _GLIBCXX_NOTHROW
92 {
return _Ios_Fmtflags(static_cast<int>(__a) | static_cast<int>(__b)); }
94 _GLIBCXX_NODISCARD _GLIBCXX_CONSTEXPR
96 operator^(_Ios_Fmtflags __a, _Ios_Fmtflags __b) _GLIBCXX_NOTHROW
97 {
return _Ios_Fmtflags(static_cast<int>(__a) ^ static_cast<int>(__b)); }
99 _GLIBCXX_NODISCARD _GLIBCXX_CONSTEXPR
101 operator~(_Ios_Fmtflags __a) _GLIBCXX_NOTHROW
102 {
return _Ios_Fmtflags(~static_cast<int>(__a)); }
105 inline const _Ios_Fmtflags&
106 operator|=(_Ios_Fmtflags& __a, _Ios_Fmtflags __b) _GLIBCXX_NOTHROW
107 {
return __a = __a | __b; }
110 inline const _Ios_Fmtflags&
111 operator&=(_Ios_Fmtflags& __a, _Ios_Fmtflags __b) _GLIBCXX_NOTHROW
112 {
return __a = __a & __b; }
115 inline const _Ios_Fmtflags&
116 operator^=(_Ios_Fmtflags& __a, _Ios_Fmtflags __b) _GLIBCXX_NOTHROW
117 {
return __a = __a ^ __b; }
121 #ifdef __glibcxx_ios_noreplace 122 #define _NOREPLACE_UNUSED 124 #define _NOREPLACE_UNUSED __attribute__((__unused__)) 127 enum __attribute__((__flag_enum__)) _Ios_Openmode
135 _S_noreplace _NOREPLACE_UNUSED = 1L << 6,
136 _S_ios_openmode_end __attribute__((__unused__)) = 1L << 16,
137 _S_ios_openmode_max __attribute__((__unused__)) = __INT_MAX__,
138 _S_ios_openmode_min __attribute__((__unused__)) = ~__INT_MAX__
141 #undef _NOREPLACE_UNUSED 143 _GLIBCXX_NODISCARD _GLIBCXX_CONSTEXPR
145 operator&(_Ios_Openmode __a, _Ios_Openmode __b) _GLIBCXX_NOTHROW
146 {
return _Ios_Openmode(static_cast<int>(__a) & static_cast<int>(__b)); }
148 _GLIBCXX_NODISCARD _GLIBCXX_CONSTEXPR
150 operator|(_Ios_Openmode __a, _Ios_Openmode __b) _GLIBCXX_NOTHROW
151 {
return _Ios_Openmode(static_cast<int>(__a) | static_cast<int>(__b)); }
153 _GLIBCXX_NODISCARD _GLIBCXX_CONSTEXPR
155 operator^(_Ios_Openmode __a, _Ios_Openmode __b) _GLIBCXX_NOTHROW
156 {
return _Ios_Openmode(static_cast<int>(__a) ^ static_cast<int>(__b)); }
158 _GLIBCXX_NODISCARD _GLIBCXX_CONSTEXPR
160 operator~(_Ios_Openmode __a) _GLIBCXX_NOTHROW
161 {
return _Ios_Openmode(~static_cast<int>(__a)); }
164 inline const _Ios_Openmode&
165 operator|=(_Ios_Openmode& __a, _Ios_Openmode __b) _GLIBCXX_NOTHROW
166 {
return __a = __a | __b; }
169 inline const _Ios_Openmode&
170 operator&=(_Ios_Openmode& __a, _Ios_Openmode __b) _GLIBCXX_NOTHROW
171 {
return __a = __a & __b; }
174 inline const _Ios_Openmode&
175 operator^=(_Ios_Openmode& __a, _Ios_Openmode __b) _GLIBCXX_NOTHROW
176 {
return __a = __a ^ __b; }
184 _S_failbit = 1L << 2,
185 _S_ios_iostate_end = 1L << 16,
186 _S_ios_iostate_max = __INT_MAX__,
187 _S_ios_iostate_min = ~__INT_MAX__
190 _GLIBCXX_NODISCARD _GLIBCXX_CONSTEXPR
192 operator&(_Ios_Iostate __a, _Ios_Iostate __b) _GLIBCXX_NOTHROW
193 {
return _Ios_Iostate(static_cast<int>(__a) & static_cast<int>(__b)); }
195 _GLIBCXX_NODISCARD _GLIBCXX_CONSTEXPR
197 operator|(_Ios_Iostate __a, _Ios_Iostate __b) _GLIBCXX_NOTHROW
198 {
return _Ios_Iostate(static_cast<int>(__a) | static_cast<int>(__b)); }
200 _GLIBCXX_NODISCARD _GLIBCXX_CONSTEXPR
202 operator^(_Ios_Iostate __a, _Ios_Iostate __b) _GLIBCXX_NOTHROW
203 {
return _Ios_Iostate(static_cast<int>(__a) ^ static_cast<int>(__b)); }
205 _GLIBCXX_NODISCARD _GLIBCXX_CONSTEXPR
207 operator~(_Ios_Iostate __a) _GLIBCXX_NOTHROW
208 {
return _Ios_Iostate(~static_cast<int>(__a)); }
211 inline const _Ios_Iostate&
212 operator|=(_Ios_Iostate& __a, _Ios_Iostate __b) _GLIBCXX_NOTHROW
213 {
return __a = __a | __b; }
216 inline const _Ios_Iostate&
217 operator&=(_Ios_Iostate& __a, _Ios_Iostate __b) _GLIBCXX_NOTHROW
218 {
return __a = __a & __b; }
221 inline const _Ios_Iostate&
222 operator^=(_Ios_Iostate& __a, _Ios_Iostate __b) _GLIBCXX_NOTHROW
223 {
return __a = __a ^ __b; }
229 _S_cur = _GLIBCXX_STDIO_SEEK_CUR,
230 _S_end = _GLIBCXX_STDIO_SEEK_END,
231 _S_ios_seekdir_end = 1L << 16
234 #if __cplusplus >= 201103L 240 [[__nodiscard__, __gnu__::__const__]]
242 iostream_category() noexcept;
247 {
return error_code(static_cast<int>(__e), iostream_category()); }
252 {
return error_condition(static_cast<int>(__e), iostream_category()); }
267 #if _GLIBCXX_USE_CXX11_ABI 268 #if __cplusplus < 201103L 291 #if _GLIBCXX_USE_CXX11_ABI 292 class _GLIBCXX_ABI_TAG_CXX11 failure :
public system_error 296 failure(
const string& __str);
298 #if __cplusplus >= 201103L 303 failure(
const char*,
const error_code& = io_errc::stream);
310 what()
const throw();
319 failure(
const string& __str)
throw();
327 what()
const throw();
329 #if __cplusplus >= 201103L 334 failure(
const string& __s,
const error_code&) noexcept
340 : failure(
string(__s))
384 static const fmtflags
dec = _S_dec;
387 static const fmtflags
fixed = _S_fixed;
390 static const fmtflags
hex = _S_hex;
395 static const fmtflags
internal = _S_internal;
399 static const fmtflags
left = _S_left;
402 static const fmtflags
oct = _S_oct;
406 static const fmtflags
right = _S_right;
423 static const fmtflags
skipws = _S_skipws;
433 static const fmtflags adjustfield = _S_adjustfield;
436 static const fmtflags basefield = _S_basefield;
439 static const fmtflags floatfield = _S_floatfield;
457 static const iostate badbit = _S_badbit;
460 static const iostate eofbit = _S_eofbit;
465 static const iostate failbit = _S_failbit;
468 static const iostate goodbit = _S_goodbit;
487 static const openmode app = _S_app;
490 static const openmode ate = _S_ate;
495 static const openmode binary = _S_bin;
498 static const openmode in = _S_in;
501 static const openmode out = _S_out;
504 static const openmode trunc = _S_trunc;
506 static const openmode __noreplace = _S_noreplace;
508 #ifdef __glibcxx_ios_noreplace // C++ >= 23 && HOSTED 510 static const openmode noreplace = _S_noreplace;
526 static const seekdir beg = _S_beg;
529 static const seekdir cur = _S_cur;
532 static const seekdir
end = _S_end;
534 #if __cplusplus <= 201402L 537 _GLIBCXX_DEPRECATED_SUGGEST(
"std::iostate");
538 typedef int open_mode
539 _GLIBCXX_DEPRECATED_SUGGEST(
"std::openmode");
541 _GLIBCXX_DEPRECATED_SUGGEST(
"std::seekdir");
544 _GLIBCXX_DEPRECATED_SUGGEST(
"std::streampos");
546 _GLIBCXX_DEPRECATED_SUGGEST(
"std::streamoff");
573 typedef void (*event_callback) (
event __e,
ios_base& __b,
int __i);
586 register_callback(event_callback __fn,
int __index);
592 iostate _M_exception;
593 iostate _M_streambuf_state;
597 struct _Callback_list
600 _Callback_list* _M_next;
603 _Atomic_word _M_refcount;
606 _Callback_list* __cb)
607 : _M_next(__cb), _M_fn(__fn), _M_index(__index), _M_refcount(0) { }
610 _M_add_reference() { __gnu_cxx::__atomic_add_dispatch(&_M_refcount, 1); }
614 _M_remove_reference()
617 _GLIBCXX_SYNCHRONIZATION_HAPPENS_BEFORE(&_M_refcount);
618 int __res = __gnu_cxx::__exchange_and_add_dispatch(&_M_refcount, -1);
621 _GLIBCXX_SYNCHRONIZATION_HAPPENS_AFTER(&_M_refcount);
627 _Callback_list* _M_callbacks;
630 _M_call_callbacks(
event __ev)
throw();
633 _M_dispose_callbacks(
void)
throw();
640 _Words() : _M_pword(0), _M_iword(0) { }
648 enum { _S_local_word_size = 8 };
649 _Words _M_local_word[_S_local_word_size];
656 _M_grow_words(
int __index,
bool __iword);
677 #if __cplusplus >= 201103L 678 Init(
const Init&) =
default;
679 Init& operator=(
const Init&) =
default;
683 static _Atomic_word _S_refcount;
684 static bool _S_synced_with_stdio;
707 fmtflags __old = _M_flags;
723 fmtflags __old = _M_flags;
738 setf(fmtflags __fmtfl, fmtflags __mask)
740 fmtflags __old = _M_flags;
742 _M_flags |= (__fmtfl & __mask);
754 { _M_flags &= ~__mask; }
766 {
return _M_precision; }
777 _M_precision = __prec;
817 sync_with_stdio(
bool __sync =
true);
829 imbue(
const locale& __loc)
throw();
842 {
return _M_ios_locale; }
853 {
return _M_ios_locale; }
889 _Words& __word = ((unsigned)__ix < (
unsigned)_M_word_size)
890 ? _M_word[__ix] : _M_grow_words(__ix,
true);
891 return __word._M_iword;
910 _Words& __word = ((unsigned)__ix < (
unsigned)_M_word_size)
911 ? _M_word[__ix] : _M_grow_words(__ix,
false);
912 return __word._M_pword;
929 #if __cplusplus < 201103L 942 operator=(
const ios_base&) =
delete;
1133 #if __cplusplus >= 201103L 1154 _GLIBCXX_END_NAMESPACE_VERSION
_Tp * end(valarray< _Tp > &__va) noexcept
Return an iterator pointing to one past the last element of the valarray.
ios_base & boolalpha(ios_base &__base)
Calls base.setf(ios_base::boolalpha).
ios_base & uppercase(ios_base &__base)
Calls base.setf(ios_base::uppercase).
static const fmtflags skipws
Skips leading white space before certain input operations.
ios_base & showpoint(ios_base &__base)
Calls base.setf(ios_base::showpoint).
ios_base & defaultfloat(ios_base &__base)
Calls base.unsetf(ios_base::floatfield)
static const fmtflags scientific
Generates floating-point output in scientific notation.
constexpr bitset< _Nb > operator &(const bitset< _Nb > &__x, const bitset< _Nb > &__y) noexcept
Global bitwise operations on bitsets.
_Ios_Fmtflags fmtflags
This is a bitmask type.
void *& pword(int __ix)
Access to void pointer array.
static const fmtflags fixed
Generate floating-point output in fixed-point notation.
ios_base & oct(ios_base &__base)
Calls base.setf(ios_base::oct, ios_base::basefield).
static const fmtflags showpos
Generates a + sign in non-negative generated numeric output.
ios_base & fixed(ios_base &__base)
Calls base.setf(ios_base::fixed, ios_base::floatfield).
One of two subclasses of exception.
static const fmtflags adjustfield
A mask of left|right|internal. Useful for the 2-arg form of setf.
void unsetf(fmtflags __mask)
Clearing format flags.
streamsize precision(streamsize __prec)
Changing flags.
ios_base & dec(ios_base &__base)
Calls base.setf(ios_base::dec, ios_base::basefield).
ios_base & showbase(ios_base &__base)
Calls base.setf(ios_base::showbase).
constexpr _Iterator __base(_Iterator __it)
fmtflags flags(fmtflags __fmtfl)
Setting new format flags all at once.
ios_base & right(ios_base &__base)
Calls base.setf(ios_base::right, ios_base::adjustfield).
_Ios_Seekdir seekdir
This is an enumerated type.
streamsize width(streamsize __wide)
Changing flags.
ios_base & noshowpoint(ios_base &__base)
Calls base.unsetf(ios_base::showpoint).
static const fmtflags basefield
A mask of dec|oct|hex. Useful for the 2-arg form of setf.
constexpr bitset< _Nb > operator^(const bitset< _Nb > &__x, const bitset< _Nb > &__y) noexcept
Global bitwise operations on bitsets.
streamsize precision() const
Flags access.
ios_base & nouppercase(ios_base &__base)
Calls base.unsetf(ios_base::uppercase).
static const fmtflags unitbuf
Flushes output after each output operation.
ios_base & left(ios_base &__base)
Calls base.setf(ios_base::left, ios_base::adjustfield).
constexpr bitset< _Nb > operator|(const bitset< _Nb > &__x, const bitset< _Nb > &__y) noexcept
Global bitwise operations on bitsets.
ios_base & skipws(ios_base &__base)
Calls base.setf(ios_base::skipws).
ios_base & noshowpos(ios_base &__base)
Calls base.unsetf(ios_base::showpos).
static const fmtflags oct
Converts integer input or generates integer output in octal base.
void(* event_callback)(event __e, ios_base &__b, int __i)
The type of an event callback function.
static const fmtflags right
Adds fill characters on the left (initial positions) of certain generated output. (I...
_Ios_Iostate iostate
This is a bitmask type.
static const fmtflags dec
Converts integer input or generates integer output in decimal base.
ios_base & showpos(ios_base &__base)
Calls base.setf(ios_base::showpos).
ios_base & noboolalpha(ios_base &__base)
Calls base.unsetf(ios_base::boolalpha).
static const fmtflags hex
Converts integer input or generates integer output in hexadecimal base.
Container class for localization functionality.The locale class is first a class wrapper for C librar...
ios_base & hexfloat(ios_base &__base)
Calls base.setf(ios_base::fixed|ios_basescientific, ios_base::floatfield)
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...
fmtflags setf(fmtflags __fmtfl)
Setting new format flags.
_Ios_Openmode openmode
This is a bitmask type.
An exception type that includes an error_code value.
ios_base & hex(ios_base &__base)
Calls base.setf(ios_base::hex, ios_base::basefield).
locale getloc() const
Locale access.
const locale & _M_getloc() const
Locale access.
Base class for all library exceptions.
ISO C++ entities toplevel namespace is std.
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.)
ios_base & nounitbuf(ios_base &__base)
Calls base.unsetf(ios_base::unitbuf).
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.
static const fmtflags floatfield
A mask of scientific|fixed. Useful for the 2-arg form of setf.
event
The set of events that may be passed to an event callback.
ios_base & noshowbase(ios_base &__base)
Calls base.unsetf(ios_base::showbase).
__bool_constant< true > true_type
The type used as a compile-time boolean with true value.
static const fmtflags showbase
Generates a prefix indicating the numeric base of generated integer output.
streamsize width() const
Flags access.
static const fmtflags showpoint
Generates a decimal-point character unconditionally in generated floating-point output.
ios_base & noskipws(ios_base &__base)
Calls base.unsetf(ios_base::skipws).
Class representing stream positions.
ptrdiff_t streamsize
Integral type for I/O operation counts and buffer sizes.
static const fmtflags uppercase
Replaces certain lowercase letters with their uppercase equivalents in generated output.
error_condition make_error_condition(future_errc __errc) noexcept
Overload of make_error_condition for future_errc.
ios_base & unitbuf(ios_base &__base)
Calls base.setf(ios_base::unitbuf).
long long streamoff
Type used by fpos, char_traits<char>, and char_traits<wchar_t>.
fmtflags flags() const
Access to format flags.
ios_base & scientific(ios_base &__base)
Calls base.setf(ios_base::scientific, ios_base::floatfield).
error_code make_error_code(future_errc __errc) noexcept
Overload of make_error_code for future_errc.