diff -r e1b950c65cb4 -r 837f303aceeb epoc32/include/stdapis/stlportv5/stl/_string_io.h --- a/epoc32/include/stdapis/stlportv5/stl/_string_io.h Wed Mar 31 12:27:01 2010 +0100 +++ b/epoc32/include/stdapis/stlportv5/stl/_string_io.h Wed Mar 31 12:33:34 2010 +0100 @@ -2,13 +2,13 @@ * Copyright (c) 1997-1999 * Silicon Graphics Computer Systems, Inc. * - * Copyright (c) 1999 + * Copyright (c) 1999 * Boris Fomitchev * * This material is provided "as is", with absolutely no warranty expressed * or implied. Any use is at your own risk. * - * Permission to use or copy this software for any purpose is hereby granted + * Permission to use or copy this software for any purpose is hereby granted * without fee, provided the above notices are retained on all copies. * Permission to modify the code and to distribute modified code is granted, * provided the above notices are retained, and a notice that the code was @@ -19,104 +19,59 @@ #ifndef _STLP_STRING_IO_H #define _STLP_STRING_IO_H -// this is for link-time instantiation -#if !defined ( _STLP_STRING ) -# include -# endif +#ifndef _STLP_INTERNAL_OSTREAM_H +# include +#endif -//#ifndef _STLP_LOCALE -//# include -//#endif +#ifndef _STLP_INTERNAL_ISTREAM +# include +#endif -# ifdef _STLP_DEBUG -# define basic_string _Nondebug_string -# endif - -// I/O. +// I/O. _STLP_BEGIN_NAMESPACE -#if defined (_STLP_USE_NEW_IOSTREAMS) - template basic_ostream<_CharT, _Traits>& _STLP_CALL -operator<<(basic_ostream<_CharT, _Traits>& __os, +operator<<(basic_ostream<_CharT, _Traits>& __os, const basic_string<_CharT,_Traits,_Alloc>& __s); +#if defined (_STLP_USE_TEMPLATE_EXPRESSION) + +template +basic_ostream<_CharT, _Traits>& _STLP_CALL +operator<<(basic_ostream<_CharT, _Traits>& __os, + const _STLP_PRIV __bstr_sum<_CharT, _Traits, _Alloc, _Left, _Right, _StorageDir>& __sum) { + basic_string<_CharT, _Traits, _Alloc> __tmp(__sum); + return __os << __tmp; +} + +#endif /* _STLP_USE_TEMPLATE_EXPRESSION */ + template basic_istream<_CharT, _Traits>& _STLP_CALL operator>>(basic_istream<_CharT, _Traits>& __is, basic_string<_CharT,_Traits,_Alloc>& __s); -template -basic_istream<_CharT, _Traits>& _STLP_CALL +template +basic_istream<_CharT, _Traits>& _STLP_CALL getline(basic_istream<_CharT, _Traits>& __is, basic_string<_CharT,_Traits,_Alloc>& __s, _CharT __delim); -# if !(defined (__BORLANDC__) && ! defined (_STLP_USE_OWN_NAMESPACE)) +#if !(defined (__BORLANDC__) && !defined (_STLP_USE_OWN_NAMESPACE)) -template -inline basic_istream<_CharT, _Traits>& _STLP_CALL +template +inline basic_istream<_CharT, _Traits>& _STLP_CALL getline(basic_istream<_CharT, _Traits>& __is, - basic_string<_CharT,_Traits,_Alloc>& __s) -{ + basic_string<_CharT,_Traits,_Alloc>& __s) { return getline(__is, __s, __is.widen('\n')); } -# endif - -template -bool _STLP_CALL -__stlp_string_fill(basic_ostream<_CharT, _Traits>& __os, - basic_streambuf<_CharT, _Traits>* __buf, - size_t __n); -#elif ! defined ( _STLP_USE_NO_IOSTREAMS ) - -// (reg) For Watcom IO, this tells if ostream class is in .exe or in .dll -# ifdef _WPRTLINK -typedef _WPRTLINK ostream _OSTREAM_DLL; -typedef _WPRTLINK istream _ISTREAM_DLL; -#else -typedef ostream _OSTREAM_DLL; -typedef istream _ISTREAM_DLL; #endif -template -_OSTREAM_DLL& _STLP_CALL operator<<(_OSTREAM_DLL& __os, - const basic_string<_CharT,_Traits,_Alloc>& __s); - -template -_ISTREAM_DLL& _STLP_CALL operator>>(_ISTREAM_DLL& __is, basic_string<_CharT,_Traits,_Alloc>& __s); - -template -_ISTREAM_DLL& _STLP_CALL getline(_ISTREAM_DLL& __is, - basic_string<_CharT,_Traits,_Alloc>& __s, - _CharT __delim); - - -template -inline _ISTREAM_DLL& _STLP_CALL -getline(_ISTREAM_DLL& __is, basic_string<_CharT,_Traits,_Alloc>& __s) -{ - return getline(__is, __s, '\n'); -} - -inline void _STLP_CALL -__stlp_string_fill(_OSTREAM_DLL& __os, streambuf* __buf, size_t __n) -{ - char __f = __os.fill(); - size_t __i; - - for (__i = 0; __i < __n; ++__i) __buf->sputc(__f); -} - -#endif /* _STLP_USE_NEW_IOSTREAMS */ - _STLP_END_NAMESPACE -# undef basic_string - -# if !defined (_STLP_LINK_TIME_INSTANTIATION) +#if !defined (_STLP_LINK_TIME_INSTANTIATION) # include -# endif +#endif #endif /* _STLP_STRING_IO_H */