1.1 --- a/epoc32/include/stdapis/stlportv5/stl/_ios_base.h Wed Mar 31 12:27:01 2010 +0100
1.2 +++ b/epoc32/include/stdapis/stlportv5/stl/_ios_base.h Wed Mar 31 12:33:34 2010 +0100
1.3 @@ -1,35 +1,39 @@
1.4 /*
1.5 - * © Portions copyright (c) 2006-2007 Nokia Corporation. All rights reserved.
1.6 + * Portions Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). All rights reserved.
1.7 + *
1.8 * Copyright (c) 1999
1.9 * Silicon Graphics Computer Systems, Inc.
1.10 *
1.11 - * Copyright (c) 1999
1.12 + * Copyright (c) 1999
1.13 * Boris Fomitchev
1.14 *
1.15 * This material is provided "as is", with absolutely no warranty expressed
1.16 * or implied. Any use is at your own risk.
1.17 *
1.18 - * Permission to use or copy this software for any purpose is hereby granted
1.19 + * Permission to use or copy this software for any purpose is hereby granted
1.20 * without fee, provided the above notices are retained on all copies.
1.21 * Permission to modify the code and to distribute modified code is granted,
1.22 * provided the above notices are retained, and a notice that the code was
1.23 * modified is included with the above copyright notice.
1.24 *
1.25 - */
1.26 + */
1.27 #ifndef _STLP_IOS_BASE_H
1.28 #define _STLP_IOS_BASE_H
1.29
1.30 -#ifndef _STLP_STDEXCEPT
1.31 -#include <stdexcept>
1.32 +#ifndef _STLP_INTERNAL_STDEXCEPT_BASE
1.33 +# include <stl/_stdexcept_base.h>
1.34 #endif
1.35 +
1.36 #ifndef _STLP_UTILITY
1.37 -#include <utility>
1.38 +# include <utility>
1.39 #endif
1.40 +
1.41 #ifndef _STLP_INTERNAL_LOCALE_H
1.42 -#include <stl/_locale.h>
1.43 +# include <stl/_locale.h>
1.44 #endif
1.45 -#ifndef _STLP_STRING_H
1.46 -# include <stl/_string.h>
1.47 +
1.48 +#ifndef _STLP_INTERNAL_STRING_H
1.49 +# include <stl/_string.h>
1.50 #endif
1.51
1.52 _STLP_BEGIN_NAMESPACE
1.53 @@ -43,13 +47,9 @@
1.54 // manipulation to the streambuf classes, and they delegate most
1.55 // formatting tasks to a locale.
1.56
1.57 -#ifdef __SYMBIAN32__
1.58 -class ios_base {
1.59 -#else
1.60 class _STLP_CLASS_DECLSPEC ios_base {
1.61 -#endif
1.62 public:
1.63 -
1.64 +
1.65 class _STLP_CLASS_DECLSPEC failure : public __Named_exception {
1.66 public:
1.67 _STLP_DECLSPEC explicit failure(const string&);
1.68 @@ -66,12 +66,12 @@
1.69 # endif
1.70
1.71 // Formatting flags.
1.72 -# ifdef _STLP_STATIC_CONST_INIT_BUG
1.73 +#if defined (_STLP_STATIC_CONST_INIT_BUG)
1.74 enum {
1.75 -# else
1.76 - // boris : type for all those constants is int
1.77 +#else
1.78 + // boris : type for all those constants is int
1.79 static const int
1.80 -# endif
1.81 +#endif
1.82 left = 0x0001,
1.83 right = 0x0002,
1.84 internal = 0x0004,
1.85 @@ -90,13 +90,13 @@
1.86 adjustfield = left | right | internal,
1.87 basefield = dec | hex | oct,
1.88 floatfield = scientific | fixed,
1.89 -
1.90 +
1.91 // State flags.
1.92 goodbit = 0x00,
1.93 badbit = 0x01,
1.94 eofbit = 0x02,
1.95 failbit = 0x04,
1.96 -
1.97 +
1.98 // Openmode flags.
1.99 __default_mode = 0x0, /* implementation detail */
1.100 app = 0x01,
1.101 @@ -105,9 +105,9 @@
1.102 in = 0x08,
1.103 out = 0x10,
1.104 trunc = 0x20,
1.105 -
1.106 +
1.107 // Seekdir flags
1.108 -
1.109 +
1.110 beg = 0x01,
1.111 cur = 0x02,
1.112 end = 0x04
1.113 @@ -153,7 +153,7 @@
1.114
1.115 public: // Locales
1.116 _STLP_DECLSPEC locale imbue(const locale&);
1.117 - _STLP_DECLSPEC locale getloc() const;// { return _M_locale; }
1.118 + locale getloc() const { return _M_locale; }
1.119
1.120 public: // Auxiliary storage.
1.121 _STLP_DECLSPEC static int _STLP_CALL xalloc();
1.122 @@ -199,23 +199,32 @@
1.123 void _M_clear_nothrow(iostate __state) { _M_iostate = __state; }
1.124 iostate _M_get_exception_mask() const { return _M_exception_mask; }
1.125 void _M_set_exception_mask(iostate __mask) { _M_exception_mask = __mask; }
1.126 - void _M_check_exception_mask() {
1.127 + void _M_check_exception_mask() {
1.128 if (_M_iostate & _M_exception_mask)
1.129 - _M_throw_failure();
1.130 + _M_throw_failure();
1.131 }
1.132
1.133 _STLP_DECLSPEC void _M_invoke_callbacks(event);
1.134 - _STLP_DECLSPEC void _M_throw_failure();
1.135 + _STLP_DECLSPEC void _STLP_FUNCTION_THROWS _M_throw_failure();
1.136
1.137 _STLP_DECLSPEC ios_base(); // Default constructor.
1.138
1.139 protected: // Initialization of the I/O system
1.140 static void _STLP_CALL _S_initialize();
1.141 static void _STLP_CALL _S_uninitialize();
1.142 -# if !defined(__LIBSTD_CPP_SYMBIAN32_WSD__) && !defined(_STLP_LIBSTD_CPP_NO_STATIC_VAR_)
1.143 - static bool _S_was_synced;
1.144 -# endif //__LIBSTD_CPP_SYMBIAN32_WSD__
1.145 - friend void CallIosInit();
1.146 +# if defined(__SYMBIAN32__WSD__)
1.147 +public:
1.148 + static void ios_base_S_was_synced_init()
1.149 + {
1.150 + get_ios_base_S_was_synced() = true;
1.151 + }
1.152 +protected:
1.153 + static inline bool& get_ios_base_S_was_synced();
1.154 +#else
1.155 + static bool _S_was_synced;
1.156 +# endif //__SYMBIAN32__WSD__
1.157 +
1.158 +
1.159 private: // Invalidate the copy constructor and
1.160 // assignment operator.
1.161 ios_base(const ios_base&);
1.162 @@ -245,11 +254,6 @@
1.163 void** _M_pwords;
1.164 size_t _M_num_pwords;
1.165
1.166 -# if !defined(__LIBSTD_CPP_SYMBIAN32_WSD__) && !defined(_STLP_LIBSTD_CPP_NO_STATIC_VAR_)
1.167 - static int _S_index;
1.168 -# endif //__LIBSTD_CPP_SYMBIAN32_WSD__
1.169 -
1.170 -
1.171 protected:
1.172 // Cached copies of the curent locale's facets. Set by init() and imbue().
1.173 locale::facet* _M_cached_ctype;
1.174 @@ -264,32 +268,27 @@
1.175
1.176 // ----------------------------------------------------------------------
1.177 // Nested initializer class. This is an implementation detail, but it's
1.178 - // prescribed by the standard. The static initializer object (on
1.179 + // prescribed by the standard. The static initializer object (on
1.180 // implementations where such a thing is required) is declared in
1.181 // <iostream>
1.182 -
1.183 - class _STLP_CLASS_DECLSPEC Init {
1.184 - public:
1.185 - _STLP_DECLSPEC Init();
1.186 - _STLP_DECLSPEC ~Init();
1.187 - private:
1.188 -# if !defined(__LIBSTD_CPP_SYMBIAN32_WSD__) && !defined(_STLP_LIBSTD_CPP_NO_STATIC_VAR_)
1.189 - static long _S_count;
1.190 -# endif //__LIBSTD_CPP_SYMBIAN32_WSD__
1.191 - friend class ios_base;
1.192 - };
1.193
1.194 - // this class is needed to ensure locale initialization w/o <iostream> inclusion
1.195 - class _STLP_CLASS_DECLSPEC _Loc_init {
1.196 - public:
1.197 - _STLP_DECLSPEC _Loc_init();
1.198 - _STLP_DECLSPEC ~_Loc_init();
1.199 - private:
1.200 -# if !defined(__LIBSTD_CPP_SYMBIAN32_WSD__) && !defined(_STLP_LIBSTD_CPP_NO_STATIC_VAR_)
1.201 - static long _S_count;
1.202 -# endif //__LIBSTD_CPP_SYMBIAN32_WSD__
1.203 - friend class locale;
1.204 - friend class ios_base;
1.205 + class _STLP_CLASS_DECLSPEC Init
1.206 + {
1.207 + public:
1.208 + _STLP_DECLSPEC Init();
1.209 + _STLP_DECLSPEC ~Init();
1.210 +# if defined(__SYMBIAN32__WSD__)
1.211 + static inline void ios_base_Init_S_count_init()
1.212 + {
1.213 + get_ios_base_Init_S_count() = 0;
1.214 + }
1.215 + private:
1.216 + static inline long& get_ios_base_Init_S_count();
1.217 +#else
1.218 + private:
1.219 + static long _S_count;
1.220 +# endif //__SYMBIAN32__WSD__
1.221 + friend class ios_base;
1.222 };
1.223
1.224 friend class Init;
1.225 @@ -302,14 +301,9 @@
1.226 typedef seekdir seek_dir;
1.227 typedef _STLP_STD::streamoff streamoff;
1.228 typedef _STLP_STD::streampos streampos;
1.229 -# endif
1.230 +# endif
1.231 };
1.232
1.233 -inline _STLP_EXP_DECLSPEC locale ios_base::getloc() const
1.234 - {
1.235 - return _M_locale;
1.236 - }
1.237 -
1.238 // ----------------------------------------------------------------------
1.239 // ios_base manipulator functions, from section 27.4.5 of the C++ standard.
1.240 // All of them are trivial one-line wrapper functions.
1.241 @@ -336,7 +330,7 @@
1.242 inline ios_base& _STLP_CALL showpos(ios_base& __s)
1.243 { __s.setf(ios_base::showpos); return __s;}
1.244
1.245 -inline ios_base& _STLP_CALL noshowpos(ios_base& __s)
1.246 +inline ios_base& _STLP_CALL noshowpos(ios_base& __s)
1.247 { __s.unsetf(ios_base::showpos); return __s;}
1.248
1.249 inline ios_base& _STLP_CALL skipws(ios_base& __s)
1.250 @@ -372,7 +366,7 @@
1.251 inline ios_base& _STLP_CALL dec(ios_base& __s)
1.252 { __s.setf(ios_base::dec, ios_base::basefield); return __s; }
1.253
1.254 -inline ios_base& _STLP_CALL hex(ios_base& __s)
1.255 +inline ios_base& _STLP_CALL hex(ios_base& __s)
1.256 { __s.setf(ios_base::hex, ios_base::basefield); return __s; }
1.257
1.258 inline ios_base& _STLP_CALL oct(ios_base& __s)
1.259 @@ -386,49 +380,6 @@
1.260 inline ios_base& _STLP_CALL scientific(ios_base& __s)
1.261 { __s.setf(ios_base::scientific, ios_base::floatfield); return __s; }
1.262
1.263 -#if defined(__BORLANDC__) && defined(_RTLDLL)
1.264 -
1.265 -long ios_base::_Loc_init::_S_count = 0;
1.266 -
1.267 -void _STLP_CALL _Stl_loc_init_num_put();
1.268 -void _STLP_CALL _Stl_loc_init_num_get();
1.269 -void _STLP_CALL _Stl_loc_init_monetary();
1.270 -void _STLP_CALL _Stl_loc_init_time_facets();
1.271 -
1.272 -inline ios_base::_Loc_init::_Loc_init() {
1.273 - if (_S_count++ == 0) {
1.274 - _Stl_loc_init_num_put();
1.275 - _Stl_loc_init_num_get();
1.276 - _Stl_loc_init_monetary();
1.277 - _Stl_loc_init_time_facets();
1.278 - locale::_S_initialize();
1.279 - }
1.280 -}
1.281 -
1.282 -inline ios_base::_Loc_init::~_Loc_init() {
1.283 - if (--_S_count == 0)
1.284 - locale::_S_uninitialize();
1.285 -}
1.286 -
1.287 -#endif /* __BORLANDC__ */
1.288 -
1.289 -#if 0
1.290 -#ifdef __SYMBIAN32__
1.291 -#pragma message("Symbian I/O stream support on progress.")
1.292 -inline ios_base::_Loc_init::_Loc_init() {
1.293 -}
1.294 -
1.295 -inline ios_base::_Loc_init::~_Loc_init() {
1.296 -}
1.297 -#endif
1.298 -
1.299 -inline ios_base::Init::Init() {
1.300 -}
1.301 -
1.302 -inline ios_base::Init::~Init() {
1.303 -}
1.304 -#endif
1.305 -
1.306 _STLP_END_NAMESPACE
1.307
1.308 #endif /* _STLP_IOS_BASE */