188 lines
5.6 KiB
Plaintext
188 lines
5.6 KiB
Plaintext
|
///////////////////////////////////////////////////////////////////////////
|
||
|
// FILE: iomanip/iomanip.h (manipulators with parameters)
|
||
|
//
|
||
|
// =========================================================================
|
||
|
//
|
||
|
// Open Watcom Project
|
||
|
//
|
||
|
// Copyright (c) 2002-2010 Open Watcom Contributors. All Rights Reserved.
|
||
|
// Portions Copyright (c) 1983-2002 Sybase, Inc. All Rights Reserved.
|
||
|
//
|
||
|
// This file is automatically generated. Do not edit directly.
|
||
|
//
|
||
|
// =========================================================================
|
||
|
//
|
||
|
// Description: This header is part of the C++ standard library. It
|
||
|
// defines the standard manipulators with parameters.
|
||
|
///////////////////////////////////////////////////////////////////////////
|
||
|
#ifndef _IOMANIP_INCLUDED
|
||
|
#define _IOMANIP_INCLUDED
|
||
|
|
||
|
#ifndef _ENABLE_AUTODEPEND
|
||
|
#pragma read_only_file;
|
||
|
#endif
|
||
|
|
||
|
#ifndef __cplusplus
|
||
|
#error This header file requires C++
|
||
|
#endif
|
||
|
|
||
|
#ifndef _COMDEF_H_INCLUDED
|
||
|
#include <_comdef.h>
|
||
|
#endif
|
||
|
|
||
|
#ifndef _IOSTREAM_INCLUDED
|
||
|
#include <iostream>
|
||
|
#endif
|
||
|
|
||
|
#ifdef _M_IX86
|
||
|
#pragma pack( __push, 1 )
|
||
|
#else
|
||
|
#pragma pack( __push, 8 )
|
||
|
#endif
|
||
|
|
||
|
template<class T>
|
||
|
class _WPRTLINK smanip;
|
||
|
template<class T>
|
||
|
class _WPRTLINK sapp {
|
||
|
public:
|
||
|
sapp( std::ios &(*__f)( std::ios &, T ) ) :
|
||
|
__fn( __f ) {};
|
||
|
smanip<T> operator()( T __p ) { return smanip<T>( __fn, __p ); };
|
||
|
private:
|
||
|
std::ios &(*__fn)( std::ios &, T );
|
||
|
};
|
||
|
template<class T>
|
||
|
class _WPRTLINK smanip {
|
||
|
public:
|
||
|
smanip( std::ios &(*__f)( std::ios &, T ), T __p ) :
|
||
|
__fn( __f ), __parm( __p ) {};
|
||
|
template< class T >
|
||
|
friend _WPRTLINK std::istream &operator>>( std::istream &, const smanip<T> & );
|
||
|
template< class T >
|
||
|
friend _WPRTLINK std::ostream &operator<<( std::ostream &, const smanip<T> & );
|
||
|
private:
|
||
|
std::ios &(*__fn)( std::ios &, T );
|
||
|
T __parm;
|
||
|
};
|
||
|
template<class T>
|
||
|
_WPRTLINK std::istream &operator>>( std::istream &__is, const smanip<T> &__sm ) {
|
||
|
__sm.__fn( __is, __sm.__parm );
|
||
|
return( __is );
|
||
|
}
|
||
|
template<class T>
|
||
|
_WPRTLINK std::ostream &operator<<( std::ostream &__os, const smanip<T> &__sm ) {
|
||
|
__sm.__fn( __os, __sm.__parm );
|
||
|
return( __os );
|
||
|
}
|
||
|
|
||
|
template<class T>
|
||
|
class _WPRTLINK imanip;
|
||
|
template<class T>
|
||
|
class _WPRTLINK iapp {
|
||
|
public:
|
||
|
iapp( std::istream &(*__f)( std::istream &, T ) ) :
|
||
|
__fn( __f ) {};
|
||
|
imanip<T> operator()( T __p ) { return imanip<T>( __fn, __p ) };
|
||
|
private:
|
||
|
std::istream &(*__fn)( std::istream &, T );
|
||
|
};
|
||
|
template<class T>
|
||
|
class _WPRTLINK imanip {
|
||
|
public:
|
||
|
imanip( std::istream &(*__f)( std::istream &, T ), T __p ) :
|
||
|
__fn( __f ), __parm( __p ) {};
|
||
|
template< class T >
|
||
|
friend _WPRTLINK std::istream &operator>>( std::istream &, const imanip<T> & );
|
||
|
private:
|
||
|
std::istream &(*__fn)( std::istream &, T );
|
||
|
T __parm;
|
||
|
};
|
||
|
template<class T>
|
||
|
_WPRTLINK std::istream &operator>>( std::istream &__is, const imanip<T> &__im ) {
|
||
|
__im.__fn( __is, __im.__parm );
|
||
|
return( __is );
|
||
|
}
|
||
|
|
||
|
template<class T>
|
||
|
class _WPRTLINK omanip;
|
||
|
template<class T>
|
||
|
class _WPRTLINK oapp {
|
||
|
public:
|
||
|
oapp( std::ostream &(*__f)( std::ostream &, T ) ) :
|
||
|
__fn( __f ) {} ;
|
||
|
omanip<T> operator()( T __p ) { return omanip<T>( __fn, __p ); };
|
||
|
private:
|
||
|
std::ostream &(*__fn)( std::ostream &, T );
|
||
|
};
|
||
|
template<class T>
|
||
|
class _WPRTLINK omanip {
|
||
|
public:
|
||
|
omanip( std::ostream &(*__f)( std::ostream &, T ), T __p ) :
|
||
|
__fn( __f ), __parm( __p ) {};
|
||
|
template< class T >
|
||
|
friend _WPRTLINK std::ostream &operator<<( std::ostream &, const omanip<T> & );
|
||
|
private:
|
||
|
std::ostream &(*__fn)( std::ostream &, T );
|
||
|
T __parm;
|
||
|
};
|
||
|
template<class T>
|
||
|
_WPRTLINK std::ostream &operator<<( std::ostream &__os, const omanip<T> &__om ) {
|
||
|
__om.__fn( __os, __om.__parm );
|
||
|
return( __os );
|
||
|
}
|
||
|
|
||
|
template<class T>
|
||
|
class _WPRTLINK iomanip;
|
||
|
template<class T>
|
||
|
class _WPRTLINK ioapp {
|
||
|
public:
|
||
|
ioapp( std::iostream &(*__f)( std::iostream &, T ) ) :
|
||
|
__fn( __f ) {};
|
||
|
iomanip<T> operator()( T __p ) { return iomanip<T>( __fn, __p ) };
|
||
|
private:
|
||
|
std::iostream &(*__fn)( std::iostream &, T );
|
||
|
};
|
||
|
template<class T>
|
||
|
class _WPRTLINK iomanip {
|
||
|
public:
|
||
|
iomanip( std::iostream &(*__f)( std::iostream &, T ), T __p ) :
|
||
|
__fn( __f ), __parm( __p ) {};
|
||
|
template< class T >
|
||
|
friend _WPRTLINK std::iostream &operator>>( std::iostream &, const iomanip<T> & );
|
||
|
private:
|
||
|
std::iostream &(*__fn)( std::iostream &, T );
|
||
|
T __parm;
|
||
|
};
|
||
|
template<class T>
|
||
|
_WPRTLINK std::iostream &operator>>( std::iostream &__is, const iomanip<T> &__im ) {
|
||
|
__im.__fn( __is, __im.__parm );
|
||
|
return( __is );
|
||
|
}
|
||
|
|
||
|
#pragma pack( __pop )
|
||
|
|
||
|
// applicator objects
|
||
|
namespace std {
|
||
|
_WPRTLINK extern sapp<long> _WCDATA resetiosflags;
|
||
|
_WPRTLINK extern sapp<int> _WCDATA setbase;
|
||
|
_WPRTLINK extern sapp<int> _WCDATA setfill;
|
||
|
_WPRTLINK extern sapp<long> _WCDATA setiosflags;
|
||
|
_WPRTLINK extern sapp<int> _WCDATA setprecision;
|
||
|
_WPRTLINK extern sapp<int> _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
|