.\" ident @(#)smanip.3 .\" Standard Template Library .\" $$RW_INSERT_HEADER "slyrs.man" .TH smanip 3C++ "02 Apr 1998" "Rogue Wave Software" "-" .ce2 Standard C++ Library Copyright 1998, Rogue Wave Software, Inc. .SH NAME \f2smanip\fP, \f2smanip_fill\fP \ - Helper classes used to implement parameterized manipulators. .SH SYNOPSIS .br #include .br template class smanip; .br template class smanip_fill; .SH DESCRIPTION The template classes smanip and smanip_fill_are helper classes used to implement parameterized manipulators. The class smanip_is used as the return type for manipulators that do not need to carry information about the character type of the stream they are applied to. This is the case for \f2resetiosflags\fP, \f2setiosflags\fP, \f2setbase\fP, \f2setprecision\fP, and \f2setw.\fP The class smanip_fill_is used as the return type for manipulators that do need to carry information about the character type of the streamto which they are applied. This is the case for \f2setfill.\fP smanip_fill is not described in the C++ standard, and is included as an extension. .SH INTERFACE .br template .br class smanip { .RE .RS 1 .RE .RS 0 public: .RE .RS 1 smanip(ios_base& (*pf) (ios_base&, T), T manarg); .RE .RS 0 }; .br .br template .br class smanip_fill { .br .br public: .RE .RS 1 smanip_fill(basic_ios& (*pf) .RE .RS 13 (basic_ios&, T), T manarg); .RE .RS 0 }; .br .br // parameterized manipulators .br .br smanip .RE .RS 2 resetiosflag(ios_base::fmtflags mask); .RE .RS 0 smanip .RE .RS 2 setiosflag(ios_base::fmtflags mask); .RE .RS 0 smanip setbase(int base); .br smanip setprecision(int n); .br smanip setw(int n); .br .br template .br smanip_fill > setfill(charT c); .br .br // overloaded extractors .br .br template .br basic_istream& .br operator>>(basic_istream& is, .RE .RS 2 const smanip& a); .RE .RS 0 .br template .br basic_istream& .br operator>>(basic_istream& is, .RE .RS 2 const smanip_fill >& a); .RE .RS 0 .br // overloaded inserters .br .br template .br basic_ostream& .br operator<<(basic_ostream& is, .RE .RS 2 const smanip& a); .RE .RS 0 .br template .br basic_ostream& .br operator>>(basic_ostream& is, .br const smanip_fill >& a); .SH CLASS SMANIP CONSTRUCTOR .br smanip(ios_base& (*pf) (ios_base&, T), T manarg); .RE .RS 3 Constructs an object of class \f2smanip\fP that stores a function pointer \f2pf\fP that is called with argument \f2manarg,\fP in order to perform the manipulator task. The call to \f2pf\fP is performed in the inserter or extractor overloaded on type \f2smanip\fP. .RE .SH CLASS SMANIP_FILL CONSTRUCTOR .br smanip_fill(basic_ios& (*pf) (basic_ios&, T), T manarg); .RE .RS 3 Constructs an object of class \f2smanip_fill\fP that stores a function pointer \f2pf,\fP that is called with argument \f2manarg,\fP in order to perform the manipulator task. The call to \f2pf\fP is performed in the inserter or extractor overloaded on type \f2smanip_fill\fP. .RE .SH MANIPULATORS .br smanip .br resetiosflag(ios_base::fmtflags mask); .RE .RS 3 Resets the \f2ios_base::fmtflags\fP designated by \f2mask\fP in the stream to which it is applied. .RE .br smanip .br setbase(int base); .RE .RS 3 Sets the base for the output or input of integer values in the stream to which it is applied. The valid values for \f2mask\fP are 8, 10, 16. .RE .br template .br smanip_fill > .br setfill(charT c); .RE .RS 3 Sets the fill character in the stream to which it is applied. .RE .br smanip .br setiosflag(ios_base::fmtflags mask); .RE .RS 3 Sets the \f2ios_base::fmtflags\fP designated by \f2mask\fP in the stream to which it is applied. .RE .br smanip .br setprecision(int n); .RE .RS 3 Sets the precision for the output of floating point values in the stream to which it is applied. .RE .br smanip .br setw(int n); .RE .RS 3 Set the field width in the stream to which it is applied. .RE .SH EXTRACTORS .br template .br basic_istream& .br operator>>(basic_istream& is, const smanip& a); .RE .RS 3 Applies the function stored in the parameter of type \f2smanip,\fP on the stream \f2is\fP. .RE .br template .br basic_istream& .br operator>>(basic_istream& is, .RE .RS 8 const smanip_fill >& a); .RE .RS 3 Applies the function stored in the parameter of type \f2smanip_fill >\fP on the stream \f2is\fP. .RE .SH INSERTERS .RE .RS 0 template .br basic_ostream& .br operator<<(basic_ostream& os, .RE .RS 10 const smanip& a); .RE .RS 3 Applies the function stored in the parameter of type \f2smanip\fP on the stream \f2os\fP. .RE .RE .RS 0 template .br basic_ostream& .br operator<<(basic_ostream& os, .RE .RS 10 const smanip_fill >& a); .RE .RS 3 Applies the function stored in the parameter of type \f2smanip_fill >\fP on the stream \f2os\fP. .RE .SH SEE ALSO ios_base(3C++), basic_ios(3C++), basic_istream(3C++), basic_ostream(3C++) Working Paper for Draft Proposed International Standard for Information Systems--Programming Language C++, Section 27.6.3 .SH STANDARDS CONFORMANCE ANSI X3J16/ISO WG21 Joint C++ Committee