33 #ifndef _GLIBCXX_IOMANIP 34 #define _GLIBCXX_IOMANIP 1 36 #pragma GCC system_header 42 #if __cplusplus >= 201103L 44 #if __cplusplus > 201103L 49 namespace std _GLIBCXX_VISIBILITY(default)
51 _GLIBCXX_BEGIN_NAMESPACE_VERSION
67 {
return { __mask }; }
69 template<
typename _CharT,
typename _Traits>
73 __is.
setf(ios_base::fmtflags(0), __f._M_mask);
77 template<
typename _CharT,
typename _Traits>
79 operator<<(basic_ostream<_CharT, _Traits>& __os, _Resetiosflags __f)
81 __os.
setf(ios_base::fmtflags(0), __f._M_mask);
86 struct _Setiosflags { ios_base::fmtflags _M_mask; };
97 {
return { __mask }; }
99 template<
typename _CharT,
typename _Traits>
103 __is.
setf(__f._M_mask);
107 template<
typename _CharT,
typename _Traits>
109 operator<<(basic_ostream<_CharT, _Traits>& __os, _Setiosflags __f)
111 __os.
setf(__f._M_mask);
116 struct _Setbase {
int _M_base; };
128 {
return { __base }; }
130 template<
typename _CharT,
typename _Traits>
141 template<
typename _CharT,
typename _Traits>
143 operator<<(basic_ostream<_CharT, _Traits>& __os, _Setbase __f)
153 template<
typename _CharT>
154 struct _Setfill { _CharT _M_c; };
163 template<
typename _CharT>
164 inline _Setfill<_CharT>
168 template<
typename _CharT,
typename _Traits>
176 template<
typename _CharT,
typename _Traits>
178 operator<<(basic_ostream<_CharT, _Traits>& __os, _Setfill<_CharT> __f)
185 struct _Setprecision {
int _M_n; };
198 template<
typename _CharT,
typename _Traits>
206 template<
typename _CharT,
typename _Traits>
208 operator<<(basic_ostream<_CharT, _Traits>& __os, _Setprecision __f)
215 struct _Setw {
int _M_n; };
228 template<
typename _CharT,
typename _Traits>
232 __is.
width(__f._M_n);
236 template<
typename _CharT,
typename _Traits>
238 operator<<(basic_ostream<_CharT, _Traits>& __os, _Setw __f)
240 __os.
width(__f._M_n);
244 #if __cplusplus >= 201103L 246 template<
typename _MoneyT>
247 struct _Get_money { _MoneyT& _M_mon;
bool _M_intl; };
257 template<
typename _MoneyT>
258 inline _Get_money<_MoneyT>
260 {
return { __mon, __intl }; }
262 template<
typename _CharT,
typename _Traits,
typename _MoneyT>
275 const _MoneyGet& __mg = use_facet<_MoneyGet>(__is.
getloc());
276 __mg.
get(_Iter(__is.
rdbuf()), _Iter(), __f._M_intl,
277 __is, __err, __f._M_mon);
282 __throw_exception_again;
293 template<
typename _MoneyT>
294 struct _Put_money {
const _MoneyT& _M_mon;
bool _M_intl; };
304 template<
typename _MoneyT>
305 inline _Put_money<_MoneyT>
307 {
return { __mon, __intl }; }
309 template<
typename _CharT,
typename _Traits,
typename _MoneyT>
311 operator<<(basic_ostream<_CharT, _Traits>& __os, _Put_money<_MoneyT> __f)
322 const _MoneyPut& __mp = use_facet<_MoneyPut>(__os.
getloc());
323 if (__mp.put(_Iter(__os.
rdbuf()), __f._M_intl, __os,
324 __os.
fill(), __f._M_mon).failed())
330 __throw_exception_again;
340 template<
typename _CharT>
343 const std::tm* _M_tmb;
344 const _CharT* _M_fmt;
356 template<
typename _CharT>
357 inline _Put_time<_CharT>
358 put_time(
const std::tm* __tmb,
const _CharT* __fmt)
359 {
return { __tmb, __fmt }; }
361 template<
typename _CharT,
typename _Traits>
363 operator<<(basic_ostream<_CharT, _Traits>& __os, _Put_time<_CharT> __f)
374 const _CharT*
const __fmt_end = __f._M_fmt +
375 _Traits::length(__f._M_fmt);
377 const _TimePut& __mp = use_facet<_TimePut>(__os.
getloc());
378 if (__mp.put(_Iter(__os.
rdbuf()), __os, __os.
fill(),
379 __f._M_tmb, __f._M_fmt, __fmt_end).failed())
385 __throw_exception_again;
395 template<
typename _CharT>
399 const _CharT* _M_fmt;
411 template<
typename _CharT>
412 inline _Get_time<_CharT>
414 {
return { __tmb, __fmt }; }
416 template<
typename _CharT,
typename _Traits>
429 const _CharT*
const __fmt_end = __f._M_fmt +
430 _Traits::length(__f._M_fmt);
432 const _TimeGet& __mg = use_facet<_TimeGet>(__is.
getloc());
433 __mg.get(_Iter(__is.
rdbuf()), _Iter(), __is,
434 __err, __f._M_tmb, __f._M_fmt, __fmt_end);
439 __throw_exception_again;
449 #if __cplusplus >= 201402L 451 #define __cpp_lib_quoted_string_io 201304 459 template<
typename _CharT>
462 _CharT __delim = _CharT(
'"'), _CharT __escape = _CharT(
'\\'))
468 template<
typename _CharT,
typename _Traits,
typename _Alloc>
471 _CharT __delim = _CharT(
'"'), _CharT __escape = _CharT(
'\\'))
475 __string, __delim, __escape);
478 template<
typename _CharT,
typename _Traits,
typename _Alloc>
481 _CharT __delim = _CharT(
'"'), _CharT __escape = _CharT(
'\\'))
485 __string, __delim, __escape);
488 #if __cplusplus >= 201703L 491 template<
typename _CharT,
typename _Traits>
493 quoted(basic_string_view<_CharT, _Traits> __sv,
494 _CharT __delim = _CharT(
'"'), _CharT __escape = _CharT(
'\\'))
497 basic_string_view<_CharT, _Traits>, _CharT>(__sv, __delim, __escape);
502 #endif // __cplusplus >= 201103L 507 #if _GLIBCXX_EXTERN_TEMPLATE 508 extern template ostream& operator<<(ostream&, _Setfill<char>);
521 #ifdef _GLIBCXX_USE_WCHAR_T 522 extern template wostream& operator<<(wostream&, _Setfill<wchar_t>);
537 _GLIBCXX_END_NAMESPACE_VERSION
locale getloc() const
Locale access.
auto quoted(const _CharT *__string, _CharT __delim=_CharT('"'), _CharT __escape = _CharT('\))
Manipulator for quoted strings.
_Get_money< _MoneyT > get_money(_MoneyT &__mon, bool __intl=false)
Extended manipulator for extracting money.
Primary class template money_get.This facet encapsulates the code to parse and return a monetary amou...
ISO C++ entities toplevel namespace is std.
streamsize width() const
Flags access.
_Get_time< _CharT > get_time(std::tm *__tmb, const _CharT *__fmt)
Extended manipulator for extracting time.
Primary class template time_get.This facet encapsulates the code to parse and return a date or time f...
char_type fill() const
Retrieves the empty character.
Performs setup work for output streams.
Performs setup work for input streams.
Thrown as part of forced unwinding.A magic placeholder class that can be caught by reference to recog...
Template class basic_ostream.
Primary class template time_put.This facet encapsulates the code to format and output dates and times...
std::basic_ostream< _CharT, _Traits > & operator<<(std::basic_ostream< _CharT, _Traits > &__os, const bitset< _Nb > &__x)
Global I/O operators for bitsets.
static const iostate badbit
Indicates a loss of integrity in an input or output sequence (such as an irrecoverable read error fro...
streamsize precision() const
Flags access.
basic_streambuf< _CharT, _Traits > * rdbuf() const
Accessing the underlying buffer.
Template class basic_istream.
_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.
Provides output iterator semantics for streambufs.
static const iostate goodbit
Indicates all is well.
_Setw setw(int __n)
Manipulator for width.
_Setprecision setprecision(int __n)
Manipulator for precision.
static const fmtflags hex
Converts integer input or generates integer output in hexadecimal base.
Provides input iterator semantics for streambufs.
_Setbase setbase(int __base)
Manipulator for setf.
static const fmtflags dec
Converts integer input or generates integer output in decimal base.
_Ios_Fmtflags fmtflags
This is a bitmask type.
_Put_time< _CharT > put_time(const std::tm *__tmb, const _CharT *__fmt)
Extended manipulator for formatting time.
iter_type get(iter_type __s, iter_type __end, bool __intl, ios_base &__io, ios_base::iostate &__err, long double &__units) const
Read and parse a monetary value.
void setstate(iostate __state)
Sets additional flags in the error state.
_Put_money< _MoneyT > put_money(const _MoneyT &__mon, bool __intl=false)
Extended manipulator for inserting money.
static const fmtflags basefield
A mask of dec|oct|hex. Useful for the 2-arg form of setf.
Managing sequences of characters and character-like objects.
static const fmtflags oct
Converts integer input or generates integer output in octal base.
Primary class template money_put.This facet encapsulates the code to format and output a monetary amo...
_Iterator __base(_Iterator __it)
Struct for delimited strings.
_Setiosflags setiosflags(ios_base::fmtflags __mask)
Manipulator for setf.
_Resetiosflags resetiosflags(ios_base::fmtflags __mask)
Manipulator for setf.
fmtflags setf(fmtflags __fmtfl)
Setting new format flags.