Attempt to represent the S^2->S^3 header reorganisation as a series of "hg rename" operations
2 * © Portions copyright (c) 2006-2007 Nokia Corporation. All rights reserved.
4 * Silicon Graphics Computer Systems, Inc.
9 * This material is provided "as is", with absolutely no warranty expressed
10 * or implied. Any use is at your own risk.
12 * Permission to use or copy this software for any purpose is hereby granted
13 * without fee, provided the above notices are retained on all copies.
14 * Permission to modify the code and to distribute modified code is granted,
15 * provided the above notices are retained, and a notice that the code was
16 * modified is included with the above copyright notice.
23 # ifndef _STLP_OUTERMOST_HEADER_ID
24 # define _STLP_OUTERMOST_HEADER_ID 0x1030
25 # include <stl/_prolog.h>
28 # ifdef _STLP_PRAGMA_ONCE
32 # if defined ( _STLP_OWN_IOSTREAMS )
34 # include <stl/_istream.h> // Includes <ostream> and <ios>
38 //----------------------------------------------------------------------
39 // Machinery for defining manipulators.
41 // Class that calls one of ios_base's single-argument member functions.
45 typedef void (_STLP_CALL *__f_ptr_type)(ios_base&, _Arg);
47 typedef _Arg (ios_base::*__f_ptr_type)(_Arg);
49 _Ios_Manip_1(__f_ptr_type __f, const _Arg& __arg)
50 : _M_f(__f), _M_arg(__arg)
53 void operator()(ios_base& __ios) const {
55 (*_M_f)(__ios, _M_arg);
57 (__ios.*_M_f)(_M_arg);
65 // Class that calls one of ios_base's two-argument member functions.
66 struct _Ios_Setf_Manip {
67 ios_base::fmtflags _M_flag;
68 ios_base::fmtflags _M_mask;
71 _Ios_Setf_Manip(ios_base::fmtflags __f)
72 : _M_flag(__f), _M_mask(0), _M_two_args(false)
75 _Ios_Setf_Manip(ios_base::fmtflags __f, ios_base::fmtflags __m)
76 : _M_flag(__f), _M_mask(__m), _M_two_args(true)
79 void operator()(ios_base& __ios) const {
81 __ios.setf(_M_flag, _M_mask);
88 template <class _CharT, class _Traits, class _Arg>
89 inline basic_istream<_CharT, _Traits>& _STLP_CALL
90 operator>>(basic_istream<_CharT, _Traits>& _SP_in,
91 const _Ios_Manip_1<_Arg>& __f)
97 template <class _CharT, class _Traits, class _Arg>
98 inline basic_ostream<_CharT, _Traits>& _STLP_CALL
99 operator<<(basic_ostream<_CharT, _Traits>& __os,
100 const _Ios_Manip_1<_Arg>& __f)
106 template <class _CharT, class _Traits>
107 inline basic_istream<_CharT, _Traits>& _STLP_CALL
108 operator>>(basic_istream<_CharT, _Traits>& _SP_in, const _Ios_Setf_Manip& __f)
114 template <class _CharT, class _Traits>
115 inline basic_ostream<_CharT, _Traits>& _STLP_CALL
116 operator<<(basic_ostream<_CharT, _Traits>& __os, const _Ios_Setf_Manip& __f)
123 //----------------------------------------------------------------------
124 // The ios_base manipulators.
128 static void _STLP_CALL spfun(ios_base& iostr, streamsize prec)
130 iostr.precision(prec);
134 static void _STLP_CALL swfun(ios_base& iostr, streamsize wide)
140 inline _Ios_Setf_Manip _STLP_CALL resetiosflags(ios_base::fmtflags __mask) {
141 return _Ios_Setf_Manip(0, __mask);
144 inline _Ios_Setf_Manip _STLP_CALL setiosflags(ios_base::fmtflags __flag) {
145 return _Ios_Setf_Manip(__flag);
148 inline _Ios_Setf_Manip _STLP_CALL setbase(int __n) {
149 ios_base::fmtflags __base = __n == 8 ? ios_base::oct :
150 __n == 10 ? ios_base::dec :
151 __n == 16 ? ios_base::hex :
152 ios_base::fmtflags(0);
153 return _Ios_Setf_Manip(__base, ios_base::basefield);
156 inline _Ios_Manip_1<streamsize> _STLP_CALL
157 setprecision(int __n) {
159 _Ios_Manip_1<streamsize>::__f_ptr_type __f = &spfun;
161 _Ios_Manip_1<streamsize>::__f_ptr_type __f = &ios_base::precision;
163 return _Ios_Manip_1<streamsize>(__f, __n);
166 inline _Ios_Manip_1<streamsize> _STLP_CALL
169 _Ios_Manip_1<streamsize>::__f_ptr_type __f = &swfun;
171 _Ios_Manip_1<streamsize>::__f_ptr_type __f = &ios_base::width;
174 return _Ios_Manip_1<streamsize>(__f, __n);
177 //----------------------------------------------------------------------
178 // setfill, a manipulator that operates on basic_ios<> instead of ios_base.
180 template <class _CharT>
181 struct _Setfill_Manip {
182 _Setfill_Manip(_CharT __c) : _M_c(__c) {}
186 template <class _CharT, class _CharT2, class _Traits>
187 inline basic_ostream<_CharT, _Traits>& _STLP_CALL
188 operator<<(basic_ostream<_CharT, _Traits>& __os,
189 const _Setfill_Manip<_CharT2>& __m)
195 template <class _CharT, class _CharT2, class _Traits>
196 inline basic_istream<_CharT, _Traits>& _STLP_CALL
197 operator>>(basic_istream<_CharT, _Traits>& __is,
198 const _Setfill_Manip<_CharT2>& __m)
204 template <class _CharT>
205 inline _Setfill_Manip<_CharT> _STLP_CALL
206 setfill(_CharT __c) {
207 return _Setfill_Manip<_CharT>(__c);
212 # elif !defined (_STLP_USE_NO_IOSTREAMS)
213 # include <wrap_std/iomanip>
216 # if (_STLP_OUTERMOST_HEADER_ID == 0x1030)
217 # include <stl/_epilog.h>
218 # undef _STLP_OUTERMOST_HEADER_ID
221 #endif /* _STLP_IOMANIP */