33#ifndef _GLIBCXX_IOMANIP
34#define _GLIBCXX_IOMANIP 1
36#pragma GCC system_header
44#define __glibcxx_want_quoted_string_io
47#if __cplusplus >= 201103L
49#if __cplusplus > 201103L
54namespace std _GLIBCXX_VISIBILITY(default)
56_GLIBCXX_BEGIN_NAMESPACE_VERSION
72 {
return { __mask }; }
74 template<
typename _CharT,
typename _Traits>
75 inline basic_istream<_CharT, _Traits>&
76 operator>>(basic_istream<_CharT, _Traits>& __is, _Resetiosflags __f)
82 template<
typename _CharT,
typename _Traits>
83 inline basic_ostream<_CharT, _Traits>&
84 operator<<(basic_ostream<_CharT, _Traits>& __os, _Resetiosflags __f)
102 {
return { __mask }; }
104 template<
typename _CharT,
typename _Traits>
105 inline basic_istream<_CharT, _Traits>&
106 operator>>(basic_istream<_CharT, _Traits>& __is, _Setiosflags __f)
108 __is.setf(__f._M_mask);
112 template<
typename _CharT,
typename _Traits>
113 inline basic_ostream<_CharT, _Traits>&
114 operator<<(basic_ostream<_CharT, _Traits>& __os, _Setiosflags __f)
116 __os.setf(__f._M_mask);
121 struct _Setbase {
int _M_base; };
133 {
return { __base }; }
135 template<
typename _CharT,
typename _Traits>
136 inline basic_istream<_CharT, _Traits>&
137 operator>>(basic_istream<_CharT, _Traits>& __is, _Setbase __f)
140 __f._M_base == 10 ? ios_base::
dec :
141 __f._M_base == 16 ? ios_base::hex :
142 ios_base::fmtflags(0), ios_base::basefield);
146 template<
typename _CharT,
typename _Traits>
147 inline basic_ostream<_CharT, _Traits>&
148 operator<<(basic_ostream<_CharT, _Traits>& __os, _Setbase __f)
151 __f._M_base == 10 ? ios_base::
dec :
152 __f._M_base == 16 ? ios_base::
hex :
153 ios_base::fmtflags(0), ios_base::basefield);
158 template<
typename _CharT>
159 struct _Setfill { _CharT _M_c; };
168 template<
typename _CharT>
169 inline _Setfill<_CharT>
173 template<
typename _CharT,
typename _Traits>
174 __attribute__((__deprecated__(
"'std::setfill' should only be used with "
176 inline basic_istream<_CharT, _Traits>&
177 operator>>(basic_istream<_CharT, _Traits>& __is, _Setfill<_CharT> __f)
183 template<
typename _CharT,
typename _Traits>
184 inline basic_ostream<_CharT, _Traits>&
185 operator<<(basic_ostream<_CharT, _Traits>& __os, _Setfill<_CharT> __f)
192 struct _Setprecision {
int _M_n; };
205 template<
typename _CharT,
typename _Traits>
206 inline basic_istream<_CharT, _Traits>&
207 operator>>(basic_istream<_CharT, _Traits>& __is, _Setprecision __f)
209 __is.precision(__f._M_n);
213 template<
typename _CharT,
typename _Traits>
214 inline basic_ostream<_CharT, _Traits>&
215 operator<<(basic_ostream<_CharT, _Traits>& __os, _Setprecision __f)
217 __os.precision(__f._M_n);
222 struct _Setw {
int _M_n; };
235 template<
typename _CharT,
typename _Traits>
236 inline basic_istream<_CharT, _Traits>&
237 operator>>(basic_istream<_CharT, _Traits>& __is, _Setw __f)
239 __is.width(__f._M_n);
243 template<
typename _CharT,
typename _Traits>
244 inline basic_ostream<_CharT, _Traits>&
245 operator<<(basic_ostream<_CharT, _Traits>& __os, _Setw __f)
247 __os.width(__f._M_n);
251#if __cplusplus >= 201103L
253 template<
typename _MoneyT>
254 struct _Get_money { _MoneyT& _M_mon;
bool _M_intl; };
264 template<
typename _MoneyT>
265 inline _Get_money<_MoneyT>
267 {
return { __mon, __intl }; }
269 template<
typename _CharT,
typename _Traits,
typename _MoneyT>
270 basic_istream<_CharT, _Traits>&
271 operator>>(basic_istream<_CharT, _Traits>& __is, _Get_money<_MoneyT> __f)
273 typename basic_istream<_CharT, _Traits>::sentry __cerb(__is,
false);
279 typedef istreambuf_iterator<_CharT, _Traits> _Iter;
280 typedef money_get<_CharT, _Iter> _MoneyGet;
282 const _MoneyGet& __mg = use_facet<_MoneyGet>(__is.getloc());
283 __mg.get(_Iter(__is.rdbuf()), _Iter(), __f._M_intl,
284 __is, __err, __f._M_mon);
289 __throw_exception_again;
294 __is.setstate(__err);
300 template<
typename _MoneyT>
301 struct _Put_money {
const _MoneyT& _M_mon;
bool _M_intl; };
311 template<
typename _MoneyT>
312 inline _Put_money<_MoneyT>
314 {
return { __mon, __intl }; }
316 template<
typename _CharT,
typename _Traits,
typename _MoneyT>
317 basic_ostream<_CharT, _Traits>&
318 operator<<(basic_ostream<_CharT, _Traits>& __os, _Put_money<_MoneyT> __f)
320 typename basic_ostream<_CharT, _Traits>::sentry __cerb(__os);
326 typedef ostreambuf_iterator<_CharT, _Traits> _Iter;
327 typedef money_put<_CharT, _Iter> _MoneyPut;
329 const _MoneyPut& __mp = use_facet<_MoneyPut>(__os.getloc());
330 if (__mp.put(_Iter(__os.rdbuf()), __f._M_intl, __os,
331 __os.fill(), __f._M_mon).failed())
337 __throw_exception_again;
342 __os.setstate(__err);
347 template<
typename _CharT>
350 const std::tm* _M_tmb;
351 const _CharT* _M_fmt;
363 template<
typename _CharT>
364 inline _Put_time<_CharT>
365 put_time(
const std::tm* __tmb,
const _CharT* __fmt)
366 {
return { __tmb, __fmt }; }
368 template<
typename _CharT,
typename _Traits>
369 basic_ostream<_CharT, _Traits>&
370 operator<<(basic_ostream<_CharT, _Traits>& __os, _Put_time<_CharT> __f)
372 typename basic_ostream<_CharT, _Traits>::sentry __cerb(__os);
378 typedef ostreambuf_iterator<_CharT, _Traits> _Iter;
379 typedef time_put<_CharT, _Iter> _TimePut;
381 const _CharT*
const __fmt_end = __f._M_fmt +
382 _Traits::length(__f._M_fmt);
384 const _TimePut& __mp = use_facet<_TimePut>(__os.getloc());
385 if (__mp.put(_Iter(__os.rdbuf()), __os, __os.fill(),
386 __f._M_tmb, __f._M_fmt, __fmt_end).failed())
392 __throw_exception_again;
397 __os.setstate(__err);
402 template<
typename _CharT>
406 const _CharT* _M_fmt;
418 template<
typename _CharT>
419 inline _Get_time<_CharT>
421 {
return { __tmb, __fmt }; }
423 template<
typename _CharT,
typename _Traits>
424 basic_istream<_CharT, _Traits>&
425 operator>>(basic_istream<_CharT, _Traits>& __is, _Get_time<_CharT> __f)
427 typename basic_istream<_CharT, _Traits>::sentry __cerb(__is,
false);
433 typedef istreambuf_iterator<_CharT, _Traits> _Iter;
434 typedef time_get<_CharT, _Iter> _TimeGet;
436 const _CharT*
const __fmt_end = __f._M_fmt +
437 _Traits::length(__f._M_fmt);
439 const _TimeGet& __mg = use_facet<_TimeGet>(__is.getloc());
440 __mg.get(_Iter(__is.rdbuf()), _Iter(), __is,
441 __err, __f._M_tmb, __f._M_fmt, __fmt_end);
446 __throw_exception_again;
451 __is.setstate(__err);
456#ifdef __cpp_lib_quoted_string_io
465 template<
typename _CharT>
467 quoted(
const _CharT* __string,
468 _CharT __delim = _CharT(
'"'), _CharT __escape = _CharT(
'\\'))
470 return __detail::_Quoted_string<const _CharT*, _CharT>(__string, __delim,
474 template<
typename _CharT,
typename _Traits,
typename _Alloc>
476 quoted(
const basic_string<_CharT, _Traits, _Alloc>& __string,
477 _CharT __delim = _CharT(
'"'), _CharT __escape = _CharT(
'\\'))
479 return __detail::_Quoted_string<
480 const basic_string<_CharT, _Traits, _Alloc>&, _CharT>(
481 __string, __delim, __escape);
484 template<
typename _CharT,
typename _Traits,
typename _Alloc>
486 quoted(basic_string<_CharT, _Traits, _Alloc>& __string,
487 _CharT __delim = _CharT(
'"'), _CharT __escape = _CharT(
'\\'))
489 return __detail::_Quoted_string<
490 basic_string<_CharT, _Traits, _Alloc>&, _CharT>(
491 __string, __delim, __escape);
494#if __cplusplus >= 201703L
497 template<
typename _CharT,
typename _Traits>
499 quoted(basic_string_view<_CharT, _Traits> __sv,
500 _CharT __delim = _CharT(
'"'), _CharT __escape = _CharT(
'\\'))
502 return __detail::_Quoted_string<
503 basic_string_view<_CharT, _Traits>, _CharT>(__sv, __delim, __escape);
513#if _GLIBCXX_EXTERN_TEMPLATE
527#ifdef _GLIBCXX_USE_WCHAR_T
543_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.
ISO C++ entities toplevel namespace is std.
_Put_time< _CharT > put_time(const std::tm *__tmb, const _CharT *__fmt)
Extended manipulator for formatting time.
ios_base & hex(ios_base &__base)
Calls base.setf(ios_base::hex, ios_base::basefield).
_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.
ios_base & dec(ios_base &__base)
Calls base.setf(ios_base::dec, ios_base::basefield).
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.
_Get_time< _CharT > get_time(std::tm *__tmb, const _CharT *__fmt)
Extended manipulator for extracting time.
_Setbase setbase(int __base)
Manipulator for setf.
Thrown as part of forced unwinding.
_Ios_Fmtflags fmtflags
This is a bitmask type.
_Ios_Iostate iostate
This is a bitmask type.
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...
static const fmtflags oct
Converts integer input or generates integer output in octal base.