33 #ifndef _GLIBCXX_IOMANIP 34 #define _GLIBCXX_IOMANIP 1 36 #ifdef _GLIBCXX_SYSHDR 37 #pragma GCC system_header 40 #pragma GCC diagnostic push 41 #pragma GCC diagnostic ignored "-Wc++11-extensions" 49 #define __glibcxx_want_quoted_string_io 52 #if __cplusplus >= 201103L 54 #if __cplusplus > 201103L 59 namespace std _GLIBCXX_VISIBILITY(default)
61 _GLIBCXX_BEGIN_NAMESPACE_VERSION
77 {
return { __mask }; }
79 template<
typename _CharT,
typename _Traits>
83 __is.
setf(ios_base::fmtflags(0), __f._M_mask);
87 template<
typename _CharT,
typename _Traits>
89 operator<<(basic_ostream<_CharT, _Traits>& __os, _Resetiosflags __f)
91 __os.
setf(ios_base::fmtflags(0), __f._M_mask);
96 struct _Setiosflags { ios_base::fmtflags _M_mask; };
107 {
return { __mask }; }
109 template<
typename _CharT,
typename _Traits>
113 __is.
setf(__f._M_mask);
117 template<
typename _CharT,
typename _Traits>
119 operator<<(basic_ostream<_CharT, _Traits>& __os, _Setiosflags __f)
121 __os.
setf(__f._M_mask);
126 struct _Setbase {
int _M_base; };
138 {
return { __base }; }
140 template<
typename _CharT,
typename _Traits>
151 template<
typename _CharT,
typename _Traits>
153 operator<<(basic_ostream<_CharT, _Traits>& __os, _Setbase __f)
163 template<
typename _CharT>
164 struct _Setfill { _CharT _M_c; };
173 template<
typename _CharT>
174 inline _Setfill<_CharT>
178 template<
typename _CharT,
typename _Traits>
179 __attribute__((__deprecated__(
"'std::setfill' should only be used with " 188 template<
typename _CharT,
typename _Traits>
190 operator<<(basic_ostream<_CharT, _Traits>& __os, _Setfill<_CharT> __f)
197 struct _Setprecision {
int _M_n; };
210 template<
typename _CharT,
typename _Traits>
218 template<
typename _CharT,
typename _Traits>
220 operator<<(basic_ostream<_CharT, _Traits>& __os, _Setprecision __f)
227 struct _Setw {
int _M_n; };
240 template<
typename _CharT,
typename _Traits>
244 __is.
width(__f._M_n);
248 template<
typename _CharT,
typename _Traits>
250 operator<<(basic_ostream<_CharT, _Traits>& __os, _Setw __f)
252 __os.
width(__f._M_n);
256 #if __cplusplus >= 201103L 258 template<
typename _MoneyT>
259 struct _Get_money { _MoneyT& _M_mon;
bool _M_intl; };
269 template<
typename _MoneyT>
270 inline _Get_money<_MoneyT>
272 {
return { __mon, __intl }; }
274 template<
typename _CharT,
typename _Traits,
typename _MoneyT>
287 const _MoneyGet& __mg = use_facet<_MoneyGet>(__is.
getloc());
288 __mg.
get(_Iter(__is.
rdbuf()), _Iter(), __f._M_intl,
289 __is, __err, __f._M_mon);
294 __throw_exception_again;
305 template<
typename _MoneyT>
306 struct _Put_money {
const _MoneyT& _M_mon;
bool _M_intl; };
316 template<
typename _MoneyT>
317 inline _Put_money<_MoneyT>
319 {
return { __mon, __intl }; }
321 template<
typename _CharT,
typename _Traits,
typename _MoneyT>
323 operator<<(basic_ostream<_CharT, _Traits>& __os, _Put_money<_MoneyT> __f)
334 const _MoneyPut& __mp = use_facet<_MoneyPut>(__os.
getloc());
335 if (__mp.put(_Iter(__os.
rdbuf()), __f._M_intl, __os,
336 __os.
fill(), __f._M_mon).failed())
342 __throw_exception_again;
352 template<
typename _CharT>
355 const std::tm* _M_tmb;
356 const _CharT* _M_fmt;
368 template<
typename _CharT>
369 inline _Put_time<_CharT>
370 put_time(
const std::tm* __tmb,
const _CharT* __fmt)
371 {
return { __tmb, __fmt }; }
373 template<
typename _CharT,
typename _Traits>
375 operator<<(basic_ostream<_CharT, _Traits>& __os, _Put_time<_CharT> __f)
386 const _CharT*
const __fmt_end = __f._M_fmt +
387 _Traits::length(__f._M_fmt);
389 const _TimePut& __mp = use_facet<_TimePut>(__os.
getloc());
390 if (__mp.put(_Iter(__os.
rdbuf()), __os, __os.
fill(),
391 __f._M_tmb, __f._M_fmt, __fmt_end).failed())
397 __throw_exception_again;
407 template<
typename _CharT>
411 const _CharT* _M_fmt;
423 template<
typename _CharT>
424 inline _Get_time<_CharT>
426 {
return { __tmb, __fmt }; }
428 template<
typename _CharT,
typename _Traits>
441 const _CharT*
const __fmt_end = __f._M_fmt +
442 _Traits::length(__f._M_fmt);
444 const _TimeGet& __mg = use_facet<_TimeGet>(__is.
getloc());
445 __mg.get(_Iter(__is.
rdbuf()), _Iter(), __is,
446 __err, __f._M_tmb, __f._M_fmt, __fmt_end);
451 __throw_exception_again;
461 #ifdef __cpp_lib_quoted_string_io // C++ >= 14 && HOSTED 470 template<
typename _CharT>
472 quoted(
const _CharT* __string,
473 _CharT __delim = _CharT(
'"'), _CharT __escape = _CharT(
'\\'))
479 template<
typename _CharT,
typename _Traits,
typename _Alloc>
482 _CharT __delim = _CharT(
'"'), _CharT __escape = _CharT(
'\\'))
486 __string, __delim, __escape);
489 template<
typename _CharT,
typename _Traits,
typename _Alloc>
492 _CharT __delim = _CharT(
'"'), _CharT __escape = _CharT(
'\\'))
496 __string, __delim, __escape);
499 #if __cplusplus >= 201703L 502 template<
typename _CharT,
typename _Traits>
505 _CharT __delim = _CharT(
'"'), _CharT __escape = _CharT(
'\\'))
511 #endif // __cpp_lib_quoted_string_io 513 #endif // __cplusplus >= 201103L 518 #if _GLIBCXX_EXTERN_TEMPLATE 519 extern template ostream& operator<<(ostream&, _Setfill<char>);
532 #ifdef _GLIBCXX_USE_WCHAR_T 533 extern template wostream& operator<<(wostream&, _Setfill<wchar_t>);
548 _GLIBCXX_END_NAMESPACE_VERSION
551 #pragma GCC diagnostic pop 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.
_Get_time< _CharT > get_time(std::tm *__tmb, const _CharT *__fmt)
Extended manipulator for extracting time.
Performs setup work for input streams.
static const fmtflags oct
Converts integer input or generates integer output in octal base.
basic_streambuf< _CharT, _Traits > * rdbuf() const
Accessing the underlying buffer.
static const fmtflags dec
Converts integer input or generates integer output in decimal base.
_Setw setw(int __n)
Manipulator for width.
_Setprecision setprecision(int __n)
Manipulator for precision.
std::basic_ostream< _CharT, _Traits > & operator<<(std::basic_ostream< _CharT, _Traits > &__os, const bitset< _Nb > &__x)
Global I/O operators for bitsets.
static const fmtflags basefield
A mask of dec|oct|hex. Useful for the 2-arg form of setf.
Primary class template time_get.This facet encapsulates the code to parse and return a date or time f...
fmtflags setf(fmtflags __fmtfl)
Setting new format flags.
_Resetiosflags resetiosflags(ios_base::fmtflags __mask)
Manipulator for setf.
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 hex
Converts integer input or generates integer output in hexadecimal base.
static const iostate goodbit
Indicates all is well.
Primary class template money_put.This facet encapsulates the code to format and output a monetary amo...
Template class basic_ostream.
streamsize width() const
Flags access.
_Setiosflags setiosflags(ios_base::fmtflags __mask)
Manipulator for setf.
Primary class template time_put.This facet encapsulates the code to format and output dates and times...
ISO C++ entities toplevel namespace is std.
_Setfill< _CharT > setfill(_CharT __c)
Manipulator for fill.
A non-owning reference to a string.
Struct for delimited strings.
_Put_money< _MoneyT > put_money(const _MoneyT &__mon, bool __intl=false)
Extended manipulator for inserting money.
std::basic_istream< _CharT, _Traits > & operator>>(std::basic_istream< _CharT, _Traits > &__is, bitset< _Nb > &__x)
Global I/O operators for bitsets.
Thrown as part of forced unwinding.A magic placeholder class that can be caught by reference to recog...
Primary class template money_get.This facet encapsulates the code to parse and return a monetary amou...
_Setbase setbase(int __base)
Manipulator for setf.
Template class basic_istream.
Performs setup work for output streams.
locale getloc() const
Locale access.
Provides output iterator semantics for streambufs.
void setstate(iostate __state)
Sets additional flags in the error state.
constexpr _Iterator __base(_Iterator __it)
char_type fill() const
Retrieves the empty character.
_Put_time< _CharT > put_time(const std::tm *__tmb, const _CharT *__fmt)
Extended manipulator for formatting time.
_Get_money< _MoneyT > get_money(_MoneyT &__mon, bool __intl=false)
Extended manipulator for extracting money.
_Ios_Fmtflags fmtflags
This is a bitmask type.
Provides input iterator semantics for streambufs.
Managing sequences of characters and character-like objects.
streamsize precision() const
Flags access.