diff -r e1b950c65cb4 -r 837f303aceeb epoc32/include/stdapis/stlportv5/stl/_sstream.h --- a/epoc32/include/stdapis/stlportv5/stl/_sstream.h Wed Mar 31 12:27:01 2010 +0100 +++ b/epoc32/include/stdapis/stlportv5/stl/_sstream.h Wed Mar 31 12:33:34 2010 +0100 @@ -1,41 +1,40 @@ /* - * © Portions copyright (c) 2006-2007 Nokia Corporation. All rights reserved. * Copyright (c) 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 * modified is included with the above copyright notice. * - */ + */ // This header defines classes basic_stringbuf, basic_istringstream, -// basic_ostringstream, and basic_stringstream. These classes +// basic_ostringstream, and basic_stringstream. These classes // represent streamsbufs and streams whose sources or destinations are // C++ strings. -#ifndef _STLP_SSTREAM_H -#define _STLP_SSTREAM_H +#ifndef _STLP_INTERNAL_SSTREAM +#define _STLP_INTERNAL_SSTREAM #ifndef _STLP_INTERNAL_STREAMBUF -# include +# include #endif -#ifndef _STLP_INTERNAL_ISTREAM_H -# include // Includes , , +#ifndef _STLP_INTERNAL_ISTREAM +# include // Includes , , #endif -#ifndef _STLP_STRING_H -# include +#ifndef _STLP_INTERNAL_STRING_H +# include #endif _STLP_BEGIN_NAMESPACE @@ -53,12 +52,7 @@ // for read-write streambufs. template -#ifdef __SYMBIAN32__ -NONSHARABLE_CLASS ( basic_stringbuf ) : public basic_streambuf<_CharT, _Traits> -#else -class basic_stringbuf : public basic_streambuf<_CharT, _Traits> -#endif -{ +class basic_stringbuf : public basic_streambuf<_CharT, _Traits> { public: // Typedefs. typedef _CharT char_type; typedef typename _Traits::int_type int_type; @@ -71,19 +65,15 @@ typedef basic_string<_CharT, _Traits, _Alloc> _String; public: // Constructors, destructor. - _STLP_DECLSPEC explicit basic_stringbuf(ios_base::openmode __mode + explicit basic_stringbuf(ios_base::openmode __mode = ios_base::in | ios_base::out); - _STLP_DECLSPEC explicit basic_stringbuf(const _String& __s, ios_base::openmode __mode + explicit basic_stringbuf(const _String& __s, ios_base::openmode __mode = ios_base::in | ios_base::out); - _STLP_DECLSPEC virtual ~basic_stringbuf(); + virtual ~basic_stringbuf(); public: // Get or set the string. - _String str() const { - if ( _M_mode & ios_base::out ) - _M_append_buffer(); - return _M_str; - } - _STLP_DECLSPEC void str(const _String& __s); + _String str() const { _M_append_buffer(); return _M_str; } + void str(const _String& __s); protected: // Overridden virtual member functions. virtual int_type underflow(); @@ -98,11 +88,10 @@ virtual _Base* setbuf(_CharT* __buf, streamsize __n); virtual pos_type seekoff(off_type __off, ios_base::seekdir __dir, - ios_base::openmode __mode + ios_base::openmode __mode = ios_base::in | ios_base::out); - virtual pos_type seekpos(pos_type __pos, ios_base::openmode __mode + virtual pos_type seekpos(pos_type __pos, ios_base::openmode __mode = ios_base::in | ios_base::out); - ios_base::openmode _M_mode; private: // Helper functions. // Append the internal buffer to the string if necessary. @@ -110,29 +99,25 @@ void _M_set_ptrs(); private: + ios_base::openmode _M_mode; mutable basic_string<_CharT, _Traits, _Alloc> _M_str; enum _JustName { _S_BufSiz = 8 }; _CharT _M_Buf[ 8 /* _S_BufSiz */]; }; -# if defined (_STLP_USE_TEMPLATE_EXPORT) +#if defined (_STLP_USE_TEMPLATE_EXPORT) _STLP_EXPORT_TEMPLATE_CLASS basic_stringbuf, allocator >; # if !defined (_STLP_NO_WCHAR_T) _STLP_EXPORT_TEMPLATE_CLASS basic_stringbuf, allocator >; # endif -# endif /* _STLP_USE_TEMPLATE_EXPORT */ +#endif /* _STLP_USE_TEMPLATE_EXPORT */ //---------------------------------------------------------------------- // Class basic_istringstream, an input stream that uses a stringbuf. template -#ifdef __SYMBIAN32__ -NONSHARABLE_CLASS ( basic_istringstream ) : public basic_istream<_CharT, _Traits> -#else -class basic_istringstream : public basic_istream<_CharT, _Traits> -#endif -{ +class basic_istringstream : public basic_istream<_CharT, _Traits> { public: // Typedefs typedef typename _Traits::char_type char_type; typedef typename _Traits::int_type int_type; @@ -158,9 +143,16 @@ _String str() const { return _M_buf.str(); } void str(const _String& __s) { _M_buf.str(__s); } - + private: basic_stringbuf<_CharT, _Traits, _Alloc> _M_buf; + +#if defined (_STLP_MSVC) && (_STLP_MSVC >= 1300 && _STLP_MSVC <= 1310) + typedef basic_istringstream<_CharT, _Traits> _Self; + //explicitely defined as private to avoid warnings: + basic_istringstream(_Self const&); + _Self& operator = (_Self const&); +#endif }; @@ -168,12 +160,7 @@ // Class basic_ostringstream, an output stream that uses a stringbuf. template -#ifdef __SYMBIAN32__ -NONSHARABLE_CLASS ( basic_ostringstream ) : public basic_ostream<_CharT, _Traits> -#else -class basic_ostringstream : public basic_ostream<_CharT, _Traits> -#endif -{ +class basic_ostringstream : public basic_ostream<_CharT, _Traits> { public: // Typedefs typedef typename _Traits::char_type char_type; typedef typename _Traits::int_type int_type; @@ -203,6 +190,13 @@ private: basic_stringbuf<_CharT, _Traits, _Alloc> _M_buf; + +#if defined (_STLP_MSVC) && (_STLP_MSVC >= 1300 && _STLP_MSVC <= 1310) + typedef basic_ostringstream<_CharT, _Traits> _Self; + //explicitely defined as private to avoid warnings: + basic_ostringstream(_Self const&); + _Self& operator = (_Self const&); +#endif }; @@ -210,12 +204,7 @@ // Class basic_stringstream, a bidirectional stream that uses a stringbuf. template -#ifdef __SYMBIAN32__ -NONSHARABLE_CLASS ( basic_stringstream ) : public basic_iostream<_CharT, _Traits> -#else -class basic_stringstream : public basic_iostream<_CharT, _Traits> -#endif -{ +class basic_stringstream : public basic_iostream<_CharT, _Traits> { public: // Typedefs typedef typename _Traits::char_type char_type; typedef typename _Traits::int_type int_type; @@ -227,12 +216,12 @@ typedef basic_iostream<_CharT, _Traits> _Base; typedef basic_string<_CharT, _Traits, _Alloc> _String; typedef basic_stringbuf<_CharT, _Traits, _Alloc> _Buf; - + typedef ios_base::openmode openmode; public: // Constructors, destructor. - _STLP_DECLSPEC basic_stringstream(openmode __mod = ios_base::in | ios_base::out); - _STLP_DECLSPEC basic_stringstream(const _String& __str, + basic_stringstream(openmode __mod = ios_base::in | ios_base::out); + basic_stringstream(const _String& __str, openmode __mod = ios_base::in | ios_base::out); ~basic_stringstream(); @@ -246,10 +235,17 @@ private: basic_stringbuf<_CharT, _Traits, _Alloc> _M_buf; + +#if defined (_STLP_MSVC) && (_STLP_MSVC >= 1300 && _STLP_MSVC <= 1310) + typedef basic_stringstream<_CharT, _Traits> _Self; + //explicitely defined as private to avoid warnings: + basic_stringstream(_Self const&); + _Self& operator = (_Self const&); +#endif }; -# if defined (_STLP_USE_TEMPLATE_EXPORT) +#if defined (_STLP_USE_TEMPLATE_EXPORT) _STLP_EXPORT_TEMPLATE_CLASS basic_istringstream, allocator >; _STLP_EXPORT_TEMPLATE_CLASS basic_ostringstream, allocator >; _STLP_EXPORT_TEMPLATE_CLASS basic_stringstream, allocator >; @@ -258,15 +254,15 @@ _STLP_EXPORT_TEMPLATE_CLASS basic_ostringstream, allocator >; _STLP_EXPORT_TEMPLATE_CLASS basic_stringstream, allocator >; # endif -# endif /* _STLP_USE_TEMPLATE_EXPORT */ +#endif /* _STLP_USE_TEMPLATE_EXPORT */ _STLP_END_NAMESPACE -# if defined (_STLP_EXPOSE_STREAM_IMPLEMENTATION) && !defined (_STLP_LINK_TIME_INSTANTIATION) +#if defined (_STLP_EXPOSE_STREAM_IMPLEMENTATION) && !defined (_STLP_LINK_TIME_INSTANTIATION) # include -# endif +#endif -#endif /* _STLP_SSTREAM_H */ +#endif /* _STLP_INTERNAL_SSTREAM */ // Local Variables: // mode:C++