diff -r e1b950c65cb4 -r 837f303aceeb epoc32/include/stdapis/stlportv5/stl/_ios_base.h --- a/epoc32/include/stdapis/stlportv5/stl/_ios_base.h Wed Mar 31 12:27:01 2010 +0100 +++ b/epoc32/include/stdapis/stlportv5/stl/_ios_base.h Wed Mar 31 12:33:34 2010 +0100 @@ -1,35 +1,39 @@ /* - * © Portions copyright (c) 2006-2007 Nokia Corporation. All rights reserved. + * Portions Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 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. * - */ + */ #ifndef _STLP_IOS_BASE_H #define _STLP_IOS_BASE_H -#ifndef _STLP_STDEXCEPT -#include +#ifndef _STLP_INTERNAL_STDEXCEPT_BASE +# include #endif + #ifndef _STLP_UTILITY -#include +# include #endif + #ifndef _STLP_INTERNAL_LOCALE_H -#include +# include #endif -#ifndef _STLP_STRING_H -# include + +#ifndef _STLP_INTERNAL_STRING_H +# include #endif _STLP_BEGIN_NAMESPACE @@ -43,13 +47,9 @@ // manipulation to the streambuf classes, and they delegate most // formatting tasks to a locale. -#ifdef __SYMBIAN32__ -class ios_base { -#else class _STLP_CLASS_DECLSPEC ios_base { -#endif public: - + class _STLP_CLASS_DECLSPEC failure : public __Named_exception { public: _STLP_DECLSPEC explicit failure(const string&); @@ -66,12 +66,12 @@ # endif // Formatting flags. -# ifdef _STLP_STATIC_CONST_INIT_BUG +#if defined (_STLP_STATIC_CONST_INIT_BUG) enum { -# else - // boris : type for all those constants is int +#else + // boris : type for all those constants is int static const int -# endif +#endif left = 0x0001, right = 0x0002, internal = 0x0004, @@ -90,13 +90,13 @@ adjustfield = left | right | internal, basefield = dec | hex | oct, floatfield = scientific | fixed, - + // State flags. goodbit = 0x00, badbit = 0x01, eofbit = 0x02, failbit = 0x04, - + // Openmode flags. __default_mode = 0x0, /* implementation detail */ app = 0x01, @@ -105,9 +105,9 @@ in = 0x08, out = 0x10, trunc = 0x20, - + // Seekdir flags - + beg = 0x01, cur = 0x02, end = 0x04 @@ -153,7 +153,7 @@ public: // Locales _STLP_DECLSPEC locale imbue(const locale&); - _STLP_DECLSPEC locale getloc() const;// { return _M_locale; } + locale getloc() const { return _M_locale; } public: // Auxiliary storage. _STLP_DECLSPEC static int _STLP_CALL xalloc(); @@ -199,23 +199,32 @@ void _M_clear_nothrow(iostate __state) { _M_iostate = __state; } iostate _M_get_exception_mask() const { return _M_exception_mask; } void _M_set_exception_mask(iostate __mask) { _M_exception_mask = __mask; } - void _M_check_exception_mask() { + void _M_check_exception_mask() { if (_M_iostate & _M_exception_mask) - _M_throw_failure(); + _M_throw_failure(); } _STLP_DECLSPEC void _M_invoke_callbacks(event); - _STLP_DECLSPEC void _M_throw_failure(); + _STLP_DECLSPEC void _STLP_FUNCTION_THROWS _M_throw_failure(); _STLP_DECLSPEC ios_base(); // Default constructor. protected: // Initialization of the I/O system static void _STLP_CALL _S_initialize(); static void _STLP_CALL _S_uninitialize(); -# if !defined(__LIBSTD_CPP_SYMBIAN32_WSD__) && !defined(_STLP_LIBSTD_CPP_NO_STATIC_VAR_) - static bool _S_was_synced; -# endif //__LIBSTD_CPP_SYMBIAN32_WSD__ - friend void CallIosInit(); +# if defined(__SYMBIAN32__WSD__) +public: + static void ios_base_S_was_synced_init() + { + get_ios_base_S_was_synced() = true; + } +protected: + static inline bool& get_ios_base_S_was_synced(); +#else + static bool _S_was_synced; +# endif //__SYMBIAN32__WSD__ + + private: // Invalidate the copy constructor and // assignment operator. ios_base(const ios_base&); @@ -245,11 +254,6 @@ void** _M_pwords; size_t _M_num_pwords; -# if !defined(__LIBSTD_CPP_SYMBIAN32_WSD__) && !defined(_STLP_LIBSTD_CPP_NO_STATIC_VAR_) - static int _S_index; -# endif //__LIBSTD_CPP_SYMBIAN32_WSD__ - - protected: // Cached copies of the curent locale's facets. Set by init() and imbue(). locale::facet* _M_cached_ctype; @@ -264,32 +268,27 @@ // ---------------------------------------------------------------------- // Nested initializer class. This is an implementation detail, but it's - // prescribed by the standard. The static initializer object (on + // prescribed by the standard. The static initializer object (on // implementations where such a thing is required) is declared in // - - class _STLP_CLASS_DECLSPEC Init { - public: - _STLP_DECLSPEC Init(); - _STLP_DECLSPEC ~Init(); - private: -# if !defined(__LIBSTD_CPP_SYMBIAN32_WSD__) && !defined(_STLP_LIBSTD_CPP_NO_STATIC_VAR_) - static long _S_count; -# endif //__LIBSTD_CPP_SYMBIAN32_WSD__ - friend class ios_base; - }; - // this class is needed to ensure locale initialization w/o inclusion - class _STLP_CLASS_DECLSPEC _Loc_init { - public: - _STLP_DECLSPEC _Loc_init(); - _STLP_DECLSPEC ~_Loc_init(); - private: -# if !defined(__LIBSTD_CPP_SYMBIAN32_WSD__) && !defined(_STLP_LIBSTD_CPP_NO_STATIC_VAR_) - static long _S_count; -# endif //__LIBSTD_CPP_SYMBIAN32_WSD__ - friend class locale; - friend class ios_base; + class _STLP_CLASS_DECLSPEC Init + { + public: + _STLP_DECLSPEC Init(); + _STLP_DECLSPEC ~Init(); +# if defined(__SYMBIAN32__WSD__) + static inline void ios_base_Init_S_count_init() + { + get_ios_base_Init_S_count() = 0; + } + private: + static inline long& get_ios_base_Init_S_count(); +#else + private: + static long _S_count; +# endif //__SYMBIAN32__WSD__ + friend class ios_base; }; friend class Init; @@ -302,14 +301,9 @@ typedef seekdir seek_dir; typedef _STLP_STD::streamoff streamoff; typedef _STLP_STD::streampos streampos; -# endif +# endif }; -inline _STLP_EXP_DECLSPEC locale ios_base::getloc() const - { - return _M_locale; - } - // ---------------------------------------------------------------------- // ios_base manipulator functions, from section 27.4.5 of the C++ standard. // All of them are trivial one-line wrapper functions. @@ -336,7 +330,7 @@ inline ios_base& _STLP_CALL showpos(ios_base& __s) { __s.setf(ios_base::showpos); return __s;} -inline ios_base& _STLP_CALL noshowpos(ios_base& __s) +inline ios_base& _STLP_CALL noshowpos(ios_base& __s) { __s.unsetf(ios_base::showpos); return __s;} inline ios_base& _STLP_CALL skipws(ios_base& __s) @@ -372,7 +366,7 @@ inline ios_base& _STLP_CALL dec(ios_base& __s) { __s.setf(ios_base::dec, ios_base::basefield); return __s; } -inline ios_base& _STLP_CALL hex(ios_base& __s) +inline ios_base& _STLP_CALL hex(ios_base& __s) { __s.setf(ios_base::hex, ios_base::basefield); return __s; } inline ios_base& _STLP_CALL oct(ios_base& __s) @@ -386,49 +380,6 @@ inline ios_base& _STLP_CALL scientific(ios_base& __s) { __s.setf(ios_base::scientific, ios_base::floatfield); return __s; } -#if defined(__BORLANDC__) && defined(_RTLDLL) - -long ios_base::_Loc_init::_S_count = 0; - -void _STLP_CALL _Stl_loc_init_num_put(); -void _STLP_CALL _Stl_loc_init_num_get(); -void _STLP_CALL _Stl_loc_init_monetary(); -void _STLP_CALL _Stl_loc_init_time_facets(); - -inline ios_base::_Loc_init::_Loc_init() { - if (_S_count++ == 0) { - _Stl_loc_init_num_put(); - _Stl_loc_init_num_get(); - _Stl_loc_init_monetary(); - _Stl_loc_init_time_facets(); - locale::_S_initialize(); - } -} - -inline ios_base::_Loc_init::~_Loc_init() { - if (--_S_count == 0) - locale::_S_uninitialize(); -} - -#endif /* __BORLANDC__ */ - -#if 0 -#ifdef __SYMBIAN32__ -#pragma message("Symbian I/O stream support on progress.") -inline ios_base::_Loc_init::_Loc_init() { -} - -inline ios_base::_Loc_init::~_Loc_init() { -} -#endif - -inline ios_base::Init::Init() { -} - -inline ios_base::Init::~Init() { -} -#endif - _STLP_END_NAMESPACE #endif /* _STLP_IOS_BASE */