// // iomanip.h I/O streams manipulators // // Copyright by WATCOM International Corp. 1988-1996. All rights reserved. // #ifndef _IOMANIP_H_INCLUDED #define _IOMANIP_H_INCLUDED #if !defined(_ENABLE_AUTODEPEND) #pragma read_only_file; #endif #ifndef __cplusplus #error iomanip.h is for use with C++ #endif #ifndef _COMDEF_H_INCLUDED #include <_comdef.h> #endif #ifndef _IOSTREAM_H_INCLUDED #include #endif #if defined(_M_IX86) #pragma pack(__push,1); #else #pragma pack(__push,8); #endif template class _WPRTLINK smanip; template class _WPRTLINK sapp { public: sapp( ios &(*__f)( ios &, T ) ) : __fn( __f ) {}; smanip operator()( T __p ) { return smanip( __fn, __p ); }; private: ios &(*__fn)( ios &, T ); }; template class _WPRTLINK smanip { public: smanip( ios &(*__f)( ios &, T ), T __p ) : __fn( __f ), __parm( __p ) {}; friend _WPRTLINK istream &operator>>( istream &, const smanip & ); friend _WPRTLINK ostream &operator<<( ostream &, const smanip & ); private: ios &(*__fn)( ios &, T ); T __parm; }; template _WPRTLINK istream &operator>>( istream &__is, const smanip &__sm ) { __sm.__fn( __is, __sm.__parm ); return( __is ); } template _WPRTLINK ostream &operator<<( ostream &__os, const smanip &__sm ) { __sm.__fn( __os, __sm.__parm ); return( __os ); } template class _WPRTLINK imanip; template class _WPRTLINK iapp { public: iapp( istream &(*__f)( istream &, T ) ) : __fn( __f ) {}; imanip operator()( T __p ) { return imanip( __fn, __p ) }; private: istream &(*__fn)( istream &, T ); }; template class _WPRTLINK imanip { public: imanip( istream &(*__f)( istream &, T ), T __p ) : __fn( __f ), __parm( __p ) {}; friend _WPRTLINK istream &operator>>( istream &, const imanip & ); private: istream &(*__fn)( istream &, T ); T __parm; }; template _WPRTLINK istream &operator>>( istream &__is, const imanip &__im ) { __im.__fn( __is, __im.__parm ); return( __is ); } template class _WPRTLINK omanip; template class _WPRTLINK oapp { public: oapp( ostream &(*__f)( ostream &, T ) ) : __fn( __f ) {} ; omanip operator()( T __p ) { return omanip( __fn, __p ); }; private: ostream &(*__fn)( ostream &, T ); }; template class _WPRTLINK omanip { public: omanip( ostream &(*__f)( ostream &, T ), T __p ) : __fn( __f ), __parm( __p ) {}; friend _WPRTLINK ostream &operator<<( ostream &, const omanip & ); private: ostream &(*__fn)( ostream &, T ); T __parm; }; template _WPRTLINK ostream &operator<<( ostream &__os, const omanip &__om ) { __om.__fn( __os, __om.__parm ); return( __os ); } template class _WPRTLINK iomanip; template class _WPRTLINK ioapp { public: ioapp( iostream &(*__f)( iostream &, T ) ) : __fn( __f ) {}; iomanip operator()( T __p ) { return iomanip( __fn, __p ) }; private: iostream &(*__fn)( iostream &, T ); }; template class _WPRTLINK iomanip { public: iomanip( iostream &(*__f)( iostream &, T ), T __p ) : __fn( __f ), __parm( __p ) {}; friend _WPRTLINK iostream &operator>>( iostream &, const iomanip & ); private: iostream &(*__fn)( iostream &, T ); T __parm; }; template _WPRTLINK iostream &operator>>( iostream &__is, const iomanip &__im ) { __im.__fn( __is, __im.__parm ); return( __is ); } #pragma pack(__pop); // applicator objects _WPRTLINK extern sapp _WCDATA resetiosflags; _WPRTLINK extern sapp _WCDATA setbase; _WPRTLINK extern sapp _WCDATA setfill; _WPRTLINK extern sapp _WCDATA setiosflags; _WPRTLINK extern sapp _WCDATA setprecision; _WPRTLINK extern sapp _WCDATA setw; // define some compatibility macros for legacy code #define SMANIP(__Typ) smanip<__Typ> #define SAPP(__Typ) sapp<__Typ> #define IMANIP(__Typ) imanip<__Typ> #define IAPP(__Typ) iapp<__Typ> #define OMANIP(__Typ) omanip<__Typ> #define OAPP(__Typ) oapp<__Typ> #define IOMANIP(__Typ) iomanip<__Typ> #define IOAPP(__Typ) ioapp<__Typ> #define SMANIP_define(__Typ) #define IOMANIPdeclare(__Typ) #endif