1.1 --- a/epoc32/include/stdapis/stlportv5/stl/_sstream.h Wed Mar 31 12:27:01 2010 +0100
1.2 +++ b/epoc32/include/stdapis/stlportv5/stl/_sstream.h Wed Mar 31 12:33:34 2010 +0100
1.3 @@ -1,41 +1,40 @@
1.4 /*
1.5 - * © Portions copyright (c) 2006-2007 Nokia Corporation. All rights reserved.
1.6 * Copyright (c) 1999
1.7 * Silicon Graphics Computer Systems, Inc.
1.8 *
1.9 - * Copyright (c) 1999
1.10 + * Copyright (c) 1999
1.11 * Boris Fomitchev
1.12 *
1.13 * This material is provided "as is", with absolutely no warranty expressed
1.14 * or implied. Any use is at your own risk.
1.15 *
1.16 - * Permission to use or copy this software for any purpose is hereby granted
1.17 + * Permission to use or copy this software for any purpose is hereby granted
1.18 * without fee, provided the above notices are retained on all copies.
1.19 * Permission to modify the code and to distribute modified code is granted,
1.20 * provided the above notices are retained, and a notice that the code was
1.21 * modified is included with the above copyright notice.
1.22 *
1.23 - */
1.24 + */
1.25
1.26
1.27 // This header defines classes basic_stringbuf, basic_istringstream,
1.28 -// basic_ostringstream, and basic_stringstream. These classes
1.29 +// basic_ostringstream, and basic_stringstream. These classes
1.30 // represent streamsbufs and streams whose sources or destinations are
1.31 // C++ strings.
1.32
1.33 -#ifndef _STLP_SSTREAM_H
1.34 -#define _STLP_SSTREAM_H
1.35 +#ifndef _STLP_INTERNAL_SSTREAM
1.36 +#define _STLP_INTERNAL_SSTREAM
1.37
1.38 #ifndef _STLP_INTERNAL_STREAMBUF
1.39 -# include <stl/_streambuf.h>
1.40 +# include <stl/_streambuf.h>
1.41 #endif
1.42
1.43 -#ifndef _STLP_INTERNAL_ISTREAM_H
1.44 -# include <stl/_istream.h> // Includes <ostream>, <ios>, <iosfwd>
1.45 +#ifndef _STLP_INTERNAL_ISTREAM
1.46 +# include <stl/_istream.h> // Includes <ostream>, <ios>, <iosfwd>
1.47 #endif
1.48
1.49 -#ifndef _STLP_STRING_H
1.50 -# include <stl/_string.h>
1.51 +#ifndef _STLP_INTERNAL_STRING_H
1.52 +# include <stl/_string.h>
1.53 #endif
1.54
1.55 _STLP_BEGIN_NAMESPACE
1.56 @@ -53,12 +52,7 @@
1.57 // for read-write streambufs.
1.58
1.59 template <class _CharT, class _Traits, class _Alloc>
1.60 -#ifdef __SYMBIAN32__
1.61 -NONSHARABLE_CLASS ( basic_stringbuf ) : public basic_streambuf<_CharT, _Traits>
1.62 -#else
1.63 -class basic_stringbuf : public basic_streambuf<_CharT, _Traits>
1.64 -#endif
1.65 -{
1.66 +class basic_stringbuf : public basic_streambuf<_CharT, _Traits> {
1.67 public: // Typedefs.
1.68 typedef _CharT char_type;
1.69 typedef typename _Traits::int_type int_type;
1.70 @@ -71,19 +65,15 @@
1.71 typedef basic_string<_CharT, _Traits, _Alloc> _String;
1.72
1.73 public: // Constructors, destructor.
1.74 - _STLP_DECLSPEC explicit basic_stringbuf(ios_base::openmode __mode
1.75 + explicit basic_stringbuf(ios_base::openmode __mode
1.76 = ios_base::in | ios_base::out);
1.77 - _STLP_DECLSPEC explicit basic_stringbuf(const _String& __s, ios_base::openmode __mode
1.78 + explicit basic_stringbuf(const _String& __s, ios_base::openmode __mode
1.79 = ios_base::in | ios_base::out);
1.80 - _STLP_DECLSPEC virtual ~basic_stringbuf();
1.81 + virtual ~basic_stringbuf();
1.82
1.83 public: // Get or set the string.
1.84 - _String str() const {
1.85 - if ( _M_mode & ios_base::out )
1.86 - _M_append_buffer();
1.87 - return _M_str;
1.88 - }
1.89 - _STLP_DECLSPEC void str(const _String& __s);
1.90 + _String str() const { _M_append_buffer(); return _M_str; }
1.91 + void str(const _String& __s);
1.92
1.93 protected: // Overridden virtual member functions.
1.94 virtual int_type underflow();
1.95 @@ -98,11 +88,10 @@
1.96
1.97 virtual _Base* setbuf(_CharT* __buf, streamsize __n);
1.98 virtual pos_type seekoff(off_type __off, ios_base::seekdir __dir,
1.99 - ios_base::openmode __mode
1.100 + ios_base::openmode __mode
1.101 = ios_base::in | ios_base::out);
1.102 - virtual pos_type seekpos(pos_type __pos, ios_base::openmode __mode
1.103 + virtual pos_type seekpos(pos_type __pos, ios_base::openmode __mode
1.104 = ios_base::in | ios_base::out);
1.105 - ios_base::openmode _M_mode;
1.106
1.107 private: // Helper functions.
1.108 // Append the internal buffer to the string if necessary.
1.109 @@ -110,29 +99,25 @@
1.110 void _M_set_ptrs();
1.111
1.112 private:
1.113 + ios_base::openmode _M_mode;
1.114 mutable basic_string<_CharT, _Traits, _Alloc> _M_str;
1.115
1.116 enum _JustName { _S_BufSiz = 8 };
1.117 _CharT _M_Buf[ 8 /* _S_BufSiz */];
1.118 };
1.119
1.120 -# if defined (_STLP_USE_TEMPLATE_EXPORT)
1.121 +#if defined (_STLP_USE_TEMPLATE_EXPORT)
1.122 _STLP_EXPORT_TEMPLATE_CLASS basic_stringbuf<char, char_traits<char>, allocator<char> >;
1.123 # if !defined (_STLP_NO_WCHAR_T)
1.124 _STLP_EXPORT_TEMPLATE_CLASS basic_stringbuf<wchar_t, char_traits<wchar_t>, allocator<wchar_t> >;
1.125 # endif
1.126 -# endif /* _STLP_USE_TEMPLATE_EXPORT */
1.127 +#endif /* _STLP_USE_TEMPLATE_EXPORT */
1.128
1.129 //----------------------------------------------------------------------
1.130 // Class basic_istringstream, an input stream that uses a stringbuf.
1.131
1.132 template <class _CharT, class _Traits, class _Alloc>
1.133 -#ifdef __SYMBIAN32__
1.134 -NONSHARABLE_CLASS ( basic_istringstream ) : public basic_istream<_CharT, _Traits>
1.135 -#else
1.136 -class basic_istringstream : public basic_istream<_CharT, _Traits>
1.137 -#endif
1.138 -{
1.139 +class basic_istringstream : public basic_istream<_CharT, _Traits> {
1.140 public: // Typedefs
1.141 typedef typename _Traits::char_type char_type;
1.142 typedef typename _Traits::int_type int_type;
1.143 @@ -158,9 +143,16 @@
1.144
1.145 _String str() const { return _M_buf.str(); }
1.146 void str(const _String& __s) { _M_buf.str(__s); }
1.147 -
1.148 +
1.149 private:
1.150 basic_stringbuf<_CharT, _Traits, _Alloc> _M_buf;
1.151 +
1.152 +#if defined (_STLP_MSVC) && (_STLP_MSVC >= 1300 && _STLP_MSVC <= 1310)
1.153 + typedef basic_istringstream<_CharT, _Traits> _Self;
1.154 + //explicitely defined as private to avoid warnings:
1.155 + basic_istringstream(_Self const&);
1.156 + _Self& operator = (_Self const&);
1.157 +#endif
1.158 };
1.159
1.160
1.161 @@ -168,12 +160,7 @@
1.162 // Class basic_ostringstream, an output stream that uses a stringbuf.
1.163
1.164 template <class _CharT, class _Traits, class _Alloc>
1.165 -#ifdef __SYMBIAN32__
1.166 -NONSHARABLE_CLASS ( basic_ostringstream ) : public basic_ostream<_CharT, _Traits>
1.167 -#else
1.168 -class basic_ostringstream : public basic_ostream<_CharT, _Traits>
1.169 -#endif
1.170 -{
1.171 +class basic_ostringstream : public basic_ostream<_CharT, _Traits> {
1.172 public: // Typedefs
1.173 typedef typename _Traits::char_type char_type;
1.174 typedef typename _Traits::int_type int_type;
1.175 @@ -203,6 +190,13 @@
1.176
1.177 private:
1.178 basic_stringbuf<_CharT, _Traits, _Alloc> _M_buf;
1.179 +
1.180 +#if defined (_STLP_MSVC) && (_STLP_MSVC >= 1300 && _STLP_MSVC <= 1310)
1.181 + typedef basic_ostringstream<_CharT, _Traits> _Self;
1.182 + //explicitely defined as private to avoid warnings:
1.183 + basic_ostringstream(_Self const&);
1.184 + _Self& operator = (_Self const&);
1.185 +#endif
1.186 };
1.187
1.188
1.189 @@ -210,12 +204,7 @@
1.190 // Class basic_stringstream, a bidirectional stream that uses a stringbuf.
1.191
1.192 template <class _CharT, class _Traits, class _Alloc>
1.193 -#ifdef __SYMBIAN32__
1.194 -NONSHARABLE_CLASS ( basic_stringstream ) : public basic_iostream<_CharT, _Traits>
1.195 -#else
1.196 -class basic_stringstream : public basic_iostream<_CharT, _Traits>
1.197 -#endif
1.198 -{
1.199 +class basic_stringstream : public basic_iostream<_CharT, _Traits> {
1.200 public: // Typedefs
1.201 typedef typename _Traits::char_type char_type;
1.202 typedef typename _Traits::int_type int_type;
1.203 @@ -227,12 +216,12 @@
1.204 typedef basic_iostream<_CharT, _Traits> _Base;
1.205 typedef basic_string<_CharT, _Traits, _Alloc> _String;
1.206 typedef basic_stringbuf<_CharT, _Traits, _Alloc> _Buf;
1.207 -
1.208 +
1.209 typedef ios_base::openmode openmode;
1.210
1.211 public: // Constructors, destructor.
1.212 - _STLP_DECLSPEC basic_stringstream(openmode __mod = ios_base::in | ios_base::out);
1.213 - _STLP_DECLSPEC basic_stringstream(const _String& __str,
1.214 + basic_stringstream(openmode __mod = ios_base::in | ios_base::out);
1.215 + basic_stringstream(const _String& __str,
1.216 openmode __mod = ios_base::in | ios_base::out);
1.217 ~basic_stringstream();
1.218
1.219 @@ -246,10 +235,17 @@
1.220
1.221 private:
1.222 basic_stringbuf<_CharT, _Traits, _Alloc> _M_buf;
1.223 +
1.224 +#if defined (_STLP_MSVC) && (_STLP_MSVC >= 1300 && _STLP_MSVC <= 1310)
1.225 + typedef basic_stringstream<_CharT, _Traits> _Self;
1.226 + //explicitely defined as private to avoid warnings:
1.227 + basic_stringstream(_Self const&);
1.228 + _Self& operator = (_Self const&);
1.229 +#endif
1.230 };
1.231
1.232
1.233 -# if defined (_STLP_USE_TEMPLATE_EXPORT)
1.234 +#if defined (_STLP_USE_TEMPLATE_EXPORT)
1.235 _STLP_EXPORT_TEMPLATE_CLASS basic_istringstream<char, char_traits<char>, allocator<char> >;
1.236 _STLP_EXPORT_TEMPLATE_CLASS basic_ostringstream<char, char_traits<char>, allocator<char> >;
1.237 _STLP_EXPORT_TEMPLATE_CLASS basic_stringstream<char, char_traits<char>, allocator<char> >;
1.238 @@ -258,15 +254,15 @@
1.239 _STLP_EXPORT_TEMPLATE_CLASS basic_ostringstream<wchar_t, char_traits<wchar_t>, allocator<wchar_t> >;
1.240 _STLP_EXPORT_TEMPLATE_CLASS basic_stringstream<wchar_t, char_traits<wchar_t>, allocator<wchar_t> >;
1.241 # endif
1.242 -# endif /* _STLP_USE_TEMPLATE_EXPORT */
1.243 +#endif /* _STLP_USE_TEMPLATE_EXPORT */
1.244
1.245 _STLP_END_NAMESPACE
1.246
1.247 -# if defined (_STLP_EXPOSE_STREAM_IMPLEMENTATION) && !defined (_STLP_LINK_TIME_INSTANTIATION)
1.248 +#if defined (_STLP_EXPOSE_STREAM_IMPLEMENTATION) && !defined (_STLP_LINK_TIME_INSTANTIATION)
1.249 # include <stl/_sstream.c>
1.250 -# endif
1.251 +#endif
1.252
1.253 -#endif /* _STLP_SSTREAM_H */
1.254 +#endif /* _STLP_INTERNAL_SSTREAM */
1.255
1.256 // Local Variables:
1.257 // mode:C++