00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035 #ifndef _GLIBCXX_IOMANIP
00036 #define _GLIBCXX_IOMANIP 1
00037
00038 #pragma GCC system_header
00039
00040 #include <bits/c++config.h>
00041 #include <iosfwd>
00042 #include <bits/ios_base.h>
00043
00044 _GLIBCXX_BEGIN_NAMESPACE(std)
00045
00046
00047
00048
00049 struct _Resetiosflags { ios_base::fmtflags _M_mask; };
00050
00051
00052
00053
00054
00055
00056
00057
00058 inline _Resetiosflags
00059 resetiosflags(ios_base::fmtflags __mask)
00060 {
00061 _Resetiosflags __x;
00062 __x._M_mask = __mask;
00063 return __x;
00064 }
00065
00066 template<typename _CharT, typename _Traits>
00067 inline basic_istream<_CharT, _Traits>&
00068 operator>>(basic_istream<_CharT, _Traits>& __is, _Resetiosflags __f)
00069 {
00070 __is.setf(ios_base::fmtflags(0), __f._M_mask);
00071 return __is;
00072 }
00073
00074 template<typename _CharT, typename _Traits>
00075 inline basic_ostream<_CharT, _Traits>&
00076 operator<<(basic_ostream<_CharT, _Traits>& __os, _Resetiosflags __f)
00077 {
00078 __os.setf(ios_base::fmtflags(0), __f._M_mask);
00079 return __os;
00080 }
00081
00082
00083 struct _Setiosflags { ios_base::fmtflags _M_mask; };
00084
00085
00086
00087
00088
00089
00090
00091
00092 inline _Setiosflags
00093 setiosflags(ios_base::fmtflags __mask)
00094 {
00095 _Setiosflags __x;
00096 __x._M_mask = __mask;
00097 return __x;
00098 }
00099
00100 template<typename _CharT, typename _Traits>
00101 inline basic_istream<_CharT, _Traits>&
00102 operator>>(basic_istream<_CharT, _Traits>& __is, _Setiosflags __f)
00103 {
00104 __is.setf(__f._M_mask);
00105 return __is;
00106 }
00107
00108 template<typename _CharT, typename _Traits>
00109 inline basic_ostream<_CharT, _Traits>&
00110 operator<<(basic_ostream<_CharT, _Traits>& __os, _Setiosflags __f)
00111 {
00112 __os.setf(__f._M_mask);
00113 return __os;
00114 }
00115
00116
00117 struct _Setbase { int _M_base; };
00118
00119
00120
00121
00122
00123
00124
00125
00126
00127 inline _Setbase
00128 setbase(int __base)
00129 {
00130 _Setbase __x;
00131 __x._M_base = __base;
00132 return __x;
00133 }
00134
00135 template<typename _CharT, typename _Traits>
00136 inline basic_istream<_CharT, _Traits>&
00137 operator>>(basic_istream<_CharT, _Traits>& __is, _Setbase __f)
00138 {
00139 __is.setf(__f._M_base == 8 ? ios_base::oct :
00140 __f._M_base == 10 ? ios_base::dec :
00141 __f._M_base == 16 ? ios_base::hex :
00142 ios_base::fmtflags(0), ios_base::basefield);
00143 return __is;
00144 }
00145
00146 template<typename _CharT, typename _Traits>
00147 inline basic_ostream<_CharT, _Traits>&
00148 operator<<(basic_ostream<_CharT, _Traits>& __os, _Setbase __f)
00149 {
00150 __os.setf(__f._M_base == 8 ? ios_base::oct :
00151 __f._M_base == 10 ? ios_base::dec :
00152 __f._M_base == 16 ? ios_base::hex :
00153 ios_base::fmtflags(0), ios_base::basefield);
00154 return __os;
00155 }
00156
00157
00158 template<typename _CharT>
00159 struct _Setfill { _CharT _M_c; };
00160
00161
00162
00163
00164
00165
00166
00167
00168 template<typename _CharT>
00169 inline _Setfill<_CharT>
00170 setfill(_CharT __c)
00171 {
00172 _Setfill<_CharT> __x;
00173 __x._M_c = __c;
00174 return __x;
00175 }
00176
00177 template<typename _CharT, typename _Traits>
00178 inline basic_istream<_CharT, _Traits>&
00179 operator>>(basic_istream<_CharT, _Traits>& __is, _Setfill<_CharT> __f)
00180 {
00181 __is.fill(__f._M_c);
00182 return __is;
00183 }
00184
00185 template<typename _CharT, typename _Traits>
00186 inline basic_ostream<_CharT, _Traits>&
00187 operator<<(basic_ostream<_CharT, _Traits>& __os, _Setfill<_CharT> __f)
00188 {
00189 __os.fill(__f._M_c);
00190 return __os;
00191 }
00192
00193
00194 struct _Setprecision { int _M_n; };
00195
00196
00197
00198
00199
00200
00201
00202
00203 inline _Setprecision
00204 setprecision(int __n)
00205 {
00206 _Setprecision __x;
00207 __x._M_n = __n;
00208 return __x;
00209 }
00210
00211 template<typename _CharT, typename _Traits>
00212 inline basic_istream<_CharT, _Traits>&
00213 operator>>(basic_istream<_CharT, _Traits>& __is, _Setprecision __f)
00214 {
00215 __is.precision(__f._M_n);
00216 return __is;
00217 }
00218
00219 template<typename _CharT, typename _Traits>
00220 inline basic_ostream<_CharT, _Traits>&
00221 operator<<(basic_ostream<_CharT, _Traits>& __os, _Setprecision __f)
00222 {
00223 __os.precision(__f._M_n);
00224 return __os;
00225 }
00226
00227
00228 struct _Setw { int _M_n; };
00229
00230
00231
00232
00233
00234
00235
00236
00237 inline _Setw
00238 setw(int __n)
00239 {
00240 _Setw __x;
00241 __x._M_n = __n;
00242 return __x;
00243 }
00244
00245 template<typename _CharT, typename _Traits>
00246 inline basic_istream<_CharT, _Traits>&
00247 operator>>(basic_istream<_CharT, _Traits>& __is, _Setw __f)
00248 {
00249 __is.width(__f._M_n);
00250 return __is;
00251 }
00252
00253 template<typename _CharT, typename _Traits>
00254 inline basic_ostream<_CharT, _Traits>&
00255 operator<<(basic_ostream<_CharT, _Traits>& __os, _Setw __f)
00256 {
00257 __os.width(__f._M_n);
00258 return __os;
00259 }
00260
00261
00262
00263
00264 #if _GLIBCXX_EXTERN_TEMPLATE
00265 extern template ostream& operator<<(ostream&, _Setfill<char>);
00266 extern template ostream& operator<<(ostream&, _Setiosflags);
00267 extern template ostream& operator<<(ostream&, _Resetiosflags);
00268 extern template ostream& operator<<(ostream&, _Setbase);
00269 extern template ostream& operator<<(ostream&, _Setprecision);
00270 extern template ostream& operator<<(ostream&, _Setw);
00271 extern template istream& operator>>(istream&, _Setfill<char>);
00272 extern template istream& operator>>(istream&, _Setiosflags);
00273 extern template istream& operator>>(istream&, _Resetiosflags);
00274 extern template istream& operator>>(istream&, _Setbase);
00275 extern template istream& operator>>(istream&, _Setprecision);
00276 extern template istream& operator>>(istream&, _Setw);
00277
00278 #ifdef _GLIBCXX_USE_WCHAR_T
00279 extern template wostream& operator<<(wostream&, _Setfill<wchar_t>);
00280 extern template wostream& operator<<(wostream&, _Setiosflags);
00281 extern template wostream& operator<<(wostream&, _Resetiosflags);
00282 extern template wostream& operator<<(wostream&, _Setbase);
00283 extern template wostream& operator<<(wostream&, _Setprecision);
00284 extern template wostream& operator<<(wostream&, _Setw);
00285 extern template wistream& operator>>(wistream&, _Setfill<wchar_t>);
00286 extern template wistream& operator>>(wistream&, _Setiosflags);
00287 extern template wistream& operator>>(wistream&, _Resetiosflags);
00288 extern template wistream& operator>>(wistream&, _Setbase);
00289 extern template wistream& operator>>(wistream&, _Setprecision);
00290 extern template wistream& operator>>(wistream&, _Setw);
00291 #endif
00292 #endif
00293
00294 _GLIBCXX_END_NAMESPACE
00295
00296 #endif