35 #ifndef _GLIBCXX_IOMANIP
36 #define _GLIBCXX_IOMANIP 1
38 #pragma GCC system_header
44 #ifdef __GXX_EXPERIMENTAL_CXX0X__
48 namespace std _GLIBCXX_VISIBILITY(default)
50 _GLIBCXX_BEGIN_NAMESPACE_VERSION
66 {
return { __mask }; }
68 template<
typename _CharT,
typename _Traits>
69 inline basic_istream<_CharT, _Traits>&
70 operator>>(basic_istream<_CharT, _Traits>& __is, _Resetiosflags __f)
76 template<
typename _CharT,
typename _Traits>
77 inline basic_ostream<_CharT, _Traits>&
78 operator<<(basic_ostream<_CharT, _Traits>& __os, _Resetiosflags __f)
96 {
return { __mask }; }
98 template<
typename _CharT,
typename _Traits>
99 inline basic_istream<_CharT, _Traits>&
100 operator>>(basic_istream<_CharT, _Traits>& __is, _Setiosflags __f)
102 __is.setf(__f._M_mask);
106 template<
typename _CharT,
typename _Traits>
107 inline basic_ostream<_CharT, _Traits>&
108 operator<<(basic_ostream<_CharT, _Traits>& __os, _Setiosflags __f)
110 __os.setf(__f._M_mask);
115 struct _Setbase {
int _M_base; };
127 {
return { __base }; }
129 template<
typename _CharT,
typename _Traits>
130 inline basic_istream<_CharT, _Traits>&
131 operator>>(basic_istream<_CharT, _Traits>& __is, _Setbase __f)
140 template<
typename _CharT,
typename _Traits>
141 inline basic_ostream<_CharT, _Traits>&
142 operator<<(basic_ostream<_CharT, _Traits>& __os, _Setbase __f)
152 template<
typename _CharT>
153 struct _Setfill { _CharT _M_c; };
162 template<
typename _CharT>
163 inline _Setfill<_CharT>
167 template<
typename _CharT,
typename _Traits>
168 inline basic_istream<_CharT, _Traits>&
169 operator>>(basic_istream<_CharT, _Traits>& __is, _Setfill<_CharT> __f)
175 template<
typename _CharT,
typename _Traits>
176 inline basic_ostream<_CharT, _Traits>&
177 operator<<(basic_ostream<_CharT, _Traits>& __os, _Setfill<_CharT> __f)
184 struct _Setprecision {
int _M_n; };
197 template<
typename _CharT,
typename _Traits>
198 inline basic_istream<_CharT, _Traits>&
199 operator>>(basic_istream<_CharT, _Traits>& __is, _Setprecision __f)
201 __is.precision(__f._M_n);
205 template<
typename _CharT,
typename _Traits>
206 inline basic_ostream<_CharT, _Traits>&
207 operator<<(basic_ostream<_CharT, _Traits>& __os, _Setprecision __f)
209 __os.precision(__f._M_n);
214 struct _Setw {
int _M_n; };
227 template<
typename _CharT,
typename _Traits>
228 inline basic_istream<_CharT, _Traits>&
229 operator>>(basic_istream<_CharT, _Traits>& __is, _Setw __f)
231 __is.width(__f._M_n);
235 template<
typename _CharT,
typename _Traits>
236 inline basic_ostream<_CharT, _Traits>&
237 operator<<(basic_ostream<_CharT, _Traits>& __os, _Setw __f)
239 __os.width(__f._M_n);
243 #ifdef __GXX_EXPERIMENTAL_CXX0X__
245 template<
typename _MoneyT>
246 struct _Get_money { _MoneyT& _M_mon;
bool _M_intl; };
256 template<
typename _MoneyT>
257 inline _Get_money<_MoneyT>
259 {
return { __mon, __intl }; }
261 template<
typename _CharT,
typename _Traits,
typename _MoneyT>
262 basic_istream<_CharT, _Traits>&
263 operator>>(basic_istream<_CharT, _Traits>& __is, _Get_money<_MoneyT> __f)
265 typename basic_istream<_CharT, _Traits>::sentry __cerb(__is,
false);
271 typedef istreambuf_iterator<_CharT, _Traits> _Iter;
272 typedef money_get<_CharT, _Iter> _MoneyGet;
274 const _MoneyGet& __mg = use_facet<_MoneyGet>(__is.getloc());
275 __mg.get(_Iter(__is.rdbuf()), _Iter(), __f._M_intl,
276 __is, __err, __f._M_mon);
281 __throw_exception_again;
286 __is.setstate(__err);
292 template<
typename _MoneyT>
293 struct _Put_money {
const _MoneyT& _M_mon;
bool _M_intl; };
303 template<
typename _MoneyT>
304 inline _Put_money<_MoneyT>
306 {
return { __mon, __intl }; }
308 template<
typename _CharT,
typename _Traits,
typename _MoneyT>
309 basic_ostream<_CharT, _Traits>&
310 operator<<(basic_ostream<_CharT, _Traits>& __os, _Put_money<_MoneyT> __f)
312 typename basic_ostream<_CharT, _Traits>::sentry __cerb(__os);
318 typedef ostreambuf_iterator<_CharT, _Traits> _Iter;
319 typedef money_put<_CharT, _Iter> _MoneyPut;
321 const _MoneyPut& __mp = use_facet<_MoneyPut>(__os.getloc());
322 if (__mp.put(_Iter(__os.rdbuf()), __f._M_intl, __os,
323 __os.fill(), __f._M_mon).failed())
329 __throw_exception_again;
334 __os.setstate(__err);
344 #if _GLIBCXX_EXTERN_TEMPLATE
345 extern template ostream& operator<<(ostream&, _Setfill<char>);
358 #ifdef _GLIBCXX_USE_WCHAR_T
359 extern template wostream& operator<<(wostream&, _Setfill<wchar_t>);
374 _GLIBCXX_END_NAMESPACE_VERSION
_Siter_base< _Iterator >::iterator_type __base(_Iterator __it)
_Setprecision setprecision(int __n)
Manipulator for precision.
_Setfill< _CharT > setfill(_CharT __c)
Manipulator for fill.
_Setw setw(int __n)
Manipulator for width.
_Ios_Iostate iostate
This is a bitmask type.
basic_istream< char > istream
Base class for char input streams.
static const fmtflags hex
Converts integer input or generates integer output in hexadecimal base.
_Setiosflags setiosflags(ios_base::fmtflags __mask)
Manipulator for setf.
basic_istream< wchar_t > wistream
Base class for wchar_t input streams.
_Put_money< _MoneyT > put_money(const _MoneyT &__mon, bool __intl=false)
Extended manipulator for inserting money.
Thrown as part of forced unwinding.A magic placeholder class that can be caught by reference to recog...
static const iostate badbit
Indicates a loss of integrity in an input or output sequence (such as an irrecoverable read error fro...
_Get_money< _MoneyT > get_money(_MoneyT &__mon, bool __intl=false)
Extended manipulator for extracting money.
bitset< _Nb > operator<<(size_t __position) const _GLIBCXX_NOEXCEPT
Self-explanatory.
basic_ostream< char > ostream
Base class for char output streams.
static const fmtflags dec
Converts integer input or generates integer output in decimal base.
_Resetiosflags resetiosflags(ios_base::fmtflags __mask)
Manipulator for setf.
_Setbase setbase(int __base)
Manipulator for setf.
static const iostate goodbit
Indicates all is well.
bitset< _Nb > operator>>(size_t __position) const _GLIBCXX_NOEXCEPT
Self-explanatory.
basic_ostream< wchar_t > wostream
Base class for wchar_t output streams.
static const fmtflags basefield
A mask of dec|oct|hex. Useful for the 2-arg form of setf.
static const fmtflags oct
Converts integer input or generates integer output in octal base.
_Ios_Fmtflags fmtflags
This is a bitmask type.