33#ifndef _GLIBCXX_IOMANIP
34#define _GLIBCXX_IOMANIP 1
36#pragma GCC system_header
44#if __cplusplus >= 201103L
46#if __cplusplus > 201103L
51namespace std _GLIBCXX_VISIBILITY(default)
53_GLIBCXX_BEGIN_NAMESPACE_VERSION
69 {
return { __mask }; }
71 template<
typename _CharT,
typename _Traits>
72 inline basic_istream<_CharT, _Traits>&
73 operator>>(basic_istream<_CharT, _Traits>& __is, _Resetiosflags __f)
79 template<
typename _CharT,
typename _Traits>
99 {
return { __mask }; }
101 template<
typename _CharT,
typename _Traits>
102 inline basic_istream<_CharT, _Traits>&
103 operator>>(basic_istream<_CharT, _Traits>& __is, _Setiosflags __f)
105 __is.setf(__f._M_mask);
109 template<
typename _CharT,
typename _Traits>
113 __os.
setf(__f._M_mask);
118 struct _Setbase {
int _M_base; };
130 {
return { __base }; }
132 template<
typename _CharT,
typename _Traits>
133 inline basic_istream<_CharT, _Traits>&
134 operator>>(basic_istream<_CharT, _Traits>& __is, _Setbase __f)
143 template<
typename _CharT,
typename _Traits>
155 template<
typename _CharT>
156 struct _Setfill { _CharT _M_c; };
165 template<
typename _CharT>
166 inline _Setfill<_CharT>
170 template<
typename _CharT,
typename _Traits>
171 inline basic_istream<_CharT, _Traits>&
172 operator>>(basic_istream<_CharT, _Traits>& __is, _Setfill<_CharT> __f)
178 template<
typename _CharT,
typename _Traits>
187 struct _Setprecision {
int _M_n; };
200 template<
typename _CharT,
typename _Traits>
201 inline basic_istream<_CharT, _Traits>&
202 operator>>(basic_istream<_CharT, _Traits>& __is, _Setprecision __f)
204 __is.precision(__f._M_n);
208 template<
typename _CharT,
typename _Traits>
217 struct _Setw {
int _M_n; };
230 template<
typename _CharT,
typename _Traits>
231 inline basic_istream<_CharT, _Traits>&
232 operator>>(basic_istream<_CharT, _Traits>& __is, _Setw __f)
234 __is.width(__f._M_n);
238 template<
typename _CharT,
typename _Traits>
242 __os.
width(__f._M_n);
246#if __cplusplus >= 201103L
248 template<
typename _MoneyT>
249 struct _Get_money { _MoneyT& _M_mon;
bool _M_intl; };
259 template<
typename _MoneyT>
260 inline _Get_money<_MoneyT>
262 {
return { __mon, __intl }; }
264 template<
typename _CharT,
typename _Traits,
typename _MoneyT>
265 basic_istream<_CharT, _Traits>&
266 operator>>(basic_istream<_CharT, _Traits>& __is, _Get_money<_MoneyT> __f)
268 typename basic_istream<_CharT, _Traits>::sentry __cerb(__is,
false);
274 typedef istreambuf_iterator<_CharT, _Traits> _Iter;
275 typedef money_get<_CharT, _Iter> _MoneyGet;
278 __mg.get(_Iter(__is.rdbuf()), _Iter(), __f._M_intl,
279 __is, __err, __f._M_mon);
281 __catch(__cxxabiv1::__forced_unwind&)
284 __throw_exception_again;
289 __is.setstate(__err);
295 template<
typename _MoneyT>
296 struct _Put_money {
const _MoneyT& _M_mon;
bool _M_intl; };
306 template<
typename _MoneyT>
307 inline _Put_money<_MoneyT>
309 {
return { __mon, __intl }; }
311 template<
typename _CharT,
typename _Traits,
typename _MoneyT>
312 basic_ostream<_CharT, _Traits>&
313 operator<<(basic_ostream<_CharT, _Traits>& __os, _Put_money<_MoneyT> __f)
315 typename basic_ostream<_CharT, _Traits>::sentry __cerb(__os);
321 typedef ostreambuf_iterator<_CharT, _Traits> _Iter;
322 typedef money_put<_CharT, _Iter> _MoneyPut;
325 if (__mp.put(_Iter(__os.rdbuf()), __f._M_intl, __os,
326 __os.fill(), __f._M_mon).failed())
329 __catch(__cxxabiv1::__forced_unwind&)
332 __throw_exception_again;
337 __os.setstate(__err);
342 template<
typename _CharT>
345 const std::tm* _M_tmb;
346 const _CharT* _M_fmt;
358 template<
typename _CharT>
359 inline _Put_time<_CharT>
360 put_time(
const std::tm* __tmb,
const _CharT* __fmt)
361 {
return { __tmb, __fmt }; }
363 template<
typename _CharT,
typename _Traits>
364 basic_ostream<_CharT, _Traits>&
365 operator<<(basic_ostream<_CharT, _Traits>& __os, _Put_time<_CharT> __f)
367 typename basic_ostream<_CharT, _Traits>::sentry __cerb(__os);
373 typedef ostreambuf_iterator<_CharT, _Traits> _Iter;
374 typedef time_put<_CharT, _Iter> _TimePut;
376 const _CharT*
const __fmt_end = __f._M_fmt +
377 _Traits::length(__f._M_fmt);
380 if (__mp.put(_Iter(__os.rdbuf()), __os, __os.fill(),
381 __f._M_tmb, __f._M_fmt, __fmt_end).failed())
384 __catch(__cxxabiv1::__forced_unwind&)
387 __throw_exception_again;
392 __os.setstate(__err);
397 template<
typename _CharT>
401 const _CharT* _M_fmt;
413 template<
typename _CharT>
414 inline _Get_time<_CharT>
416 {
return { __tmb, __fmt }; }
418 template<
typename _CharT,
typename _Traits>
419 basic_istream<_CharT, _Traits>&
420 operator>>(basic_istream<_CharT, _Traits>& __is, _Get_time<_CharT> __f)
422 typename basic_istream<_CharT, _Traits>::sentry __cerb(__is,
false);
428 typedef istreambuf_iterator<_CharT, _Traits> _Iter;
429 typedef time_get<_CharT, _Iter> _TimeGet;
431 const _CharT*
const __fmt_end = __f._M_fmt +
432 _Traits::length(__f._M_fmt);
435 __mg.get(_Iter(__is.rdbuf()), _Iter(), __is,
436 __err, __f._M_tmb, __f._M_fmt, __fmt_end);
438 __catch(__cxxabiv1::__forced_unwind&)
441 __throw_exception_again;
446 __is.setstate(__err);
451#if __cplusplus >= 201402L
453#define __cpp_lib_quoted_string_io 201304L
462 template<
typename _CharT>
465 _CharT __delim = _CharT(
'"'), _CharT __escape = _CharT(
'\\'))
471 template<
typename _CharT,
typename _Traits,
typename _Alloc>
473 quoted(
const basic_string<_CharT, _Traits, _Alloc>& __string,
474 _CharT __delim = _CharT(
'"'), _CharT __escape = _CharT(
'\\'))
476 return __detail::_Quoted_string<
477 const basic_string<_CharT, _Traits, _Alloc>&, _CharT>(
478 __string, __delim, __escape);
481 template<
typename _CharT,
typename _Traits,
typename _Alloc>
484 _CharT __delim = _CharT(
'"'), _CharT __escape = _CharT(
'\\'))
488 __string, __delim, __escape);
491#if __cplusplus >= 201703L
494 template<
typename _CharT,
typename _Traits>
497 _CharT __delim = _CharT(
'"'), _CharT __escape = _CharT(
'\\'))
510#if _GLIBCXX_EXTERN_TEMPLATE
524#ifdef _GLIBCXX_USE_WCHAR_T
540_GLIBCXX_END_NAMESPACE_VERSION
basic_ostream< char > ostream
Base class for char output streams.
basic_istream< char > istream
Base class for char input streams.
basic_ostream< wchar_t > wostream
Base class for wchar_t output streams.
basic_istream< wchar_t > wistream
Base class for wchar_t input streams.
class __attribute((__abi_tag__("cxx11"))) failure typedef _Ios_Fmtflags fmtflags
These are thrown to indicate problems with io.
const _Facet & use_facet(const locale &__loc)
Return a facet.
ISO C++ entities toplevel namespace is std.
_Put_time< _CharT > put_time(const std::tm *__tmb, const _CharT *__fmt)
Extended manipulator for formatting time.
_Resetiosflags resetiosflags(ios_base::fmtflags __mask)
Manipulator for setf.
_Get_money< _MoneyT > get_money(_MoneyT &__mon, bool __intl=false)
Extended manipulator for extracting money.
_Setw setw(int __n)
Manipulator for width.
_Setprecision setprecision(int __n)
Manipulator for precision.
_Setfill< _CharT > setfill(_CharT __c)
Manipulator for fill.
std::basic_istream< _CharT, _Traits > & operator>>(std::basic_istream< _CharT, _Traits > &__is, bitset< _Nb > &__x)
Global I/O operators for bitsets.
_Put_money< _MoneyT > put_money(const _MoneyT &__mon, bool __intl=false)
Extended manipulator for inserting money.
_Setiosflags setiosflags(ios_base::fmtflags __mask)
Manipulator for setf.
std::basic_ostream< _CharT, _Traits > & operator<<(std::basic_ostream< _CharT, _Traits > &__os, const bitset< _Nb > &__x)
Global I/O operators for bitsets.
auto quoted(const _CharT *__string, _CharT __delim=_CharT('"'), _CharT __escape = _CharT('\\'))
Manipulator for quoted strings.
_Get_time< _CharT > get_time(std::tm *__tmb, const _CharT *__fmt)
Extended manipulator for extracting time.
_Setbase setbase(int __base)
Manipulator for setf.
char_type fill() const
Retrieves the empty character.
Template class basic_ostream.
A non-owning reference to a string.
Managing sequences of characters and character-like objects.
fmtflags setf(fmtflags __fmtfl)
Setting new format flags.
_Ios_Iostate iostate
This is a bitmask type.
static const fmtflags hex
Converts integer input or generates integer output in hexadecimal base.
static const fmtflags basefield
A mask of dec|oct|hex. Useful for the 2-arg form of setf.
streamsize precision() const
Flags access.
static const fmtflags dec
Converts integer input or generates integer output in decimal base.
static const iostate goodbit
Indicates all is well.
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 const fmtflags oct
Converts integer input or generates integer output in octal base.
Struct for delimited strings.