37 #ifdef _GLIBCXX_SYSHDR 38 #pragma GCC system_header 45 #if __cplusplus < 201103L 51 namespace std _GLIBCXX_VISIBILITY(default)
53 _GLIBCXX_BEGIN_NAMESPACE_VERSION
59 enum __attribute__((__flag_enum__)) _Ios_Fmtflags
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 __attribute__((__unused__)) = 1L << 16,
80 _S_ios_fmtflags_max __attribute__((__unused__)) = __INT_MAX__,
81 _S_ios_fmtflags_min __attribute__((__unused__)) = ~__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; }
179 enum __attribute__((__flag_enum__)) _Ios_Iostate
184 _S_failbit = 1L << 2,
185 _S_ios_iostate_end __attribute__((__unused__)) = 1L << 16,
186 _S_ios_iostate_max __attribute__((__unused__)) = __INT_MAX__,
187 _S_ios_iostate_min __attribute__((__unused__)) = ~__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 __attribute__((__unused__)) = 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
ios_base & unitbuf(ios_base &__base)
Calls base.setf(ios_base::unitbuf).
static const fmtflags skipws
Skips leading white space before certain input operations.
_Ios_Iostate iostate
This is a bitmask type.
static const fmtflags internal
Adds fill characters at a designated internal point in certain generated output, or identical to righ...
static const fmtflags oct
Converts integer input or generates integer output in octal base.
An exception type that includes an error_code value.
fmtflags setf(fmtflags __fmtfl, fmtflags __mask)
Setting new format flags.
constexpr bitset< _Nb > operator &(const bitset< _Nb > &__x, const bitset< _Nb > &__y) noexcept
Global bitwise operations on bitsets.
static const fmtflags fixed
Generate floating-point output in fixed-point notation.
static const fmtflags dec
Converts integer input or generates integer output in decimal base.
fmtflags flags(fmtflags __fmtfl)
Setting new format flags all at once.
static const fmtflags basefield
A mask of dec|oct|hex. Useful for the 2-arg form of setf.
ios_base & oct(ios_base &__base)
Calls base.setf(ios_base::oct, ios_base::basefield).
fmtflags setf(fmtflags __fmtfl)
Setting new format flags.
static const fmtflags hex
Converts integer input or generates integer output in hexadecimal base.
fmtflags flags() const
Access to format flags.
__bool_constant< true > true_type
The type used as a compile-time boolean with true value.
ios_base & defaultfloat(ios_base &__base)
Calls base.unsetf(ios_base::floatfield)
ios_base & showpos(ios_base &__base)
Calls base.setf(ios_base::showpos).
static const fmtflags floatfield
A mask of scientific|fixed. Useful for the 2-arg form of setf.
ios_base & skipws(ios_base &__base)
Calls base.setf(ios_base::skipws).
constexpr bitset< _Nb > operator^(const bitset< _Nb > &__x, const bitset< _Nb > &__y) noexcept
Global bitwise operations on bitsets.
static const fmtflags showbase
Generates a prefix indicating the numeric base of generated integer output.
ios_base & uppercase(ios_base &__base)
Calls base.setf(ios_base::uppercase).
ios_base & nounitbuf(ios_base &__base)
Calls base.unsetf(ios_base::unitbuf).
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).
error_code make_error_code(future_errc __errc) noexcept
Overload of make_error_code for future_errc.
static const fmtflags right
Adds fill characters on the left (initial positions) of certain generated output. (I...
ios_base & boolalpha(ios_base &__base)
Calls base.setf(ios_base::boolalpha).
ios_base & dec(ios_base &__base)
Calls base.setf(ios_base::dec, ios_base::basefield).
streamsize width() const
Flags access.
ISO C++ entities toplevel namespace is std.
streamsize precision(streamsize __prec)
Changing flags.
ios_base & showbase(ios_base &__base)
Calls base.setf(ios_base::showbase).
_Ios_Seekdir seekdir
This is an enumerated type.
ios_base & right(ios_base &__base)
Calls base.setf(ios_base::right, ios_base::adjustfield).
Container class for localization functionality.The locale class is first a class wrapper for C librar...
ios_base & noshowpos(ios_base &__base)
Calls base.unsetf(ios_base::showpos).
_Tp * end(valarray< _Tp > &__va) noexcept
Return an iterator pointing to one past the last element of the valarray.
The base of the I/O class hierarchy.This class defines everything that can be defined about I/O that ...
static const fmtflags adjustfield
A mask of left|right|internal. Useful for the 2-arg form of setf.
One of two subclasses of exception.
void(* event_callback)(event __e, ios_base &__b, int __i)
The type of an event callback function.
ios_base & fixed(ios_base &__base)
Calls base.setf(ios_base::fixed, ios_base::floatfield).
static const fmtflags showpos
Generates a + sign in non-negative generated numeric output.
long & iword(int __ix)
Access to integer array.
error_condition make_error_condition(future_errc __errc) noexcept
Overload of make_error_condition for future_errc.
ios_base & hexfloat(ios_base &__base)
Calls base.setf(ios_base::fixed|ios_basescientific, ios_base::floatfield)
ios_base & nouppercase(ios_base &__base)
Calls base.unsetf(ios_base::uppercase).
ios_base & scientific(ios_base &__base)
Calls base.setf(ios_base::scientific, ios_base::floatfield).
static const fmtflags uppercase
Replaces certain lowercase letters with their uppercase equivalents in generated output.
static const fmtflags unitbuf
Flushes output after each output operation.
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.)
long long streamoff
Type used by fpos, char_traits<char>, and char_traits<wchar_t>.
static const fmtflags boolalpha
Insert/extract bool in alphabetic rather than numeric format.
static const fmtflags scientific
Generates floating-point output in scientific notation.
ios_base & noskipws(ios_base &__base)
Calls base.unsetf(ios_base::skipws).
locale getloc() const
Locale access.
ptrdiff_t streamsize
Integral type for I/O operation counts and buffer sizes.
ios_base & noshowpoint(ios_base &__base)
Calls base.unsetf(ios_base::showpoint).
void unsetf(fmtflags __mask)
Clearing format flags.
Class representing stream positions.
ios_base & noboolalpha(ios_base &__base)
Calls base.unsetf(ios_base::boolalpha).
void *& pword(int __ix)
Access to void pointer array.
constexpr _Iterator __base(_Iterator __it)
constexpr bitset< _Nb > operator|(const bitset< _Nb > &__x, const bitset< _Nb > &__y) noexcept
Global bitwise operations on bitsets.
_Ios_Openmode openmode
This is a bitmask type.
Base class for all library exceptions.
_Ios_Fmtflags fmtflags
This is a bitmask type.
event
The set of events that may be passed to an event callback.
streamsize width(streamsize __wide)
Changing flags.
ios_base & noshowbase(ios_base &__base)
Calls base.unsetf(ios_base::showbase).
const locale & _M_getloc() const
Locale access.
streamsize precision() const
Flags access.
static const fmtflags showpoint
Generates a decimal-point character unconditionally in generated floating-point output.
ios_base & showpoint(ios_base &__base)
Calls base.setf(ios_base::showpoint).