/* SCE CONFIDENTIAL
PLAYSTATION(R)3 Programmer Tool Runtime Library 084.006
* Copyright (C) 2004 Sony Computer Entertainment Inc. 
* All Rights Reserved.
*/
// iomanip standard header
#ifndef _IOMANIP_
#define _IOMANIP_
#include <istream>
_STD_BEGIN

		// TEMPLATE STRUCT _Fillobj
template<class _Elem>
	struct _Fillobj
	{	// store fill character
	_Fillobj(_Elem _Ch)
		: _Fill(_Ch)
		{	// construct from fill character
		}

	_Elem _Fill;	// the fill character
	};

		// TEMPLATE FUNCTION setfill
template<class _Elem> inline
	_Fillobj<_Elem> setfill(_Elem _Ch)
	{	// return a _Fillobj manipulator
	return (_Fillobj<_Elem>(_Ch));
	}

template<class _Elem,
	class _Traits> inline
	basic_istream<_Elem, _Traits>&
		operator>>(basic_istream<_Elem, _Traits>& _Istr,
			const _Fillobj<_Elem>& _Manip)
	{	// set fill character in input stream
	_Istr.fill(_Manip._Fill);
	return (_Istr);
	}

template<class _Elem,
	class _Traits> inline
	basic_ostream<_Elem, _Traits>&
		operator<<(basic_ostream<_Elem, _Traits>& _Ostr,
			const _Fillobj<_Elem>& _Manip)
	{	// set fill character in output stream
	_Ostr.fill(_Manip._Fill);
	return (_Ostr);
	}

		// TEMPLATE STRUCT _Smanip
template<class _Arg>
	struct _Smanip
	{	// store function pointer and argument value
	_Smanip(void (*_Left)(ios_base&, _Arg), _Arg _Val)
		: _Pfun(_Left), _Manarg(_Val)
		{	// construct from function pointer and argument value
		}

	void (*_Pfun)(ios_base&, _Arg);	// the function pointer
	_Arg _Manarg;	// the argument value
	};

template<class _Elem,
	class _Traits,
	class _Arg> inline
	basic_istream<_Elem, _Traits>& operator>>(
		basic_istream<_Elem, _Traits>& _Istr, const _Smanip<_Arg>& _Manip)
	{	// extract by calling function with input stream and argument
	(*_Manip._Pfun)(_Istr, _Manip._Manarg);
	return (_Istr);
	}

template<class _Elem,
	class _Traits,
	class _Arg> inline
	basic_ostream<_Elem, _Traits>& operator<<(
		basic_ostream<_Elem, _Traits>& _Ostr, const _Smanip<_Arg>& _Manip)
	{	// insert by calling function with output stream and argument
	(*_Manip._Pfun)(_Ostr, _Manip._Manarg);
	return (_Ostr);
	}

		// INSTANTIATIONS
_Smanip<ios_base::fmtflags> resetiosflags(ios_base::fmtflags);
_Smanip<ios_base::fmtflags> setiosflags(ios_base::fmtflags);
_Smanip<int> setbase(int);
_Smanip<streamsize> setprecision(streamsize);
_Smanip<streamsize> setw(streamsize);
_STD_END
#endif /* _IOMANIP_ */

/*
 * Copyright (c) 1992-2003 by P.J. Plauger.  ALL RIGHTS RESERVED.
 * Consult your license regarding permissions and restrictions.
V4.02:0216 */
