epoc32/include/stdapis/stlport/exception
branchSymbian2
changeset 2 2fe1408b6811
parent 0 061f57f2323e
     1.1 --- a/epoc32/include/stdapis/stlport/exception	Tue Nov 24 13:55:44 2009 +0000
     1.2 +++ b/epoc32/include/stdapis/stlport/exception	Tue Mar 16 16:12:26 2010 +0000
     1.3 @@ -1,1 +1,229 @@
     1.4 -exception
     1.5 +/*
     1.6 + * © Portions copyright (c) 2006-2007 Nokia Corporation.  All rights reserved.
     1.7 + *
     1.8 + * Copyright (c) 1996,1997
     1.9 + * Silicon Graphics Computer Systems, Inc.
    1.10 + *
    1.11 + * Copyright (c) 1999 
    1.12 + * Boris Fomitchev
    1.13 + *
    1.14 + * This material is provided "as is", with absolutely no warranty expressed
    1.15 + * or implied. Any use is at your own risk.
    1.16 + *
    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 +// This header exists solely for portability.  Normally it just includes
    1.26 +// the native header <exception>.
    1.27 +
    1.28 +// The header <exception> contains low-level functions that interact
    1.29 +// with a compiler's exception-handling mechanism.  It is assumed to
    1.30 +// be supplied with the compiler, rather than with the library, because
    1.31 +// it is inherently tied very closely to the compiler itself.
    1.32 +
    1.33 +// On platforms where <exception> does not exist, this header defines
    1.34 +// an exception base class.  This is *not* a substitute for everything
    1.35 +// in <exception>, but it suffices to support a bare minimum of STL
    1.36 +// functionality.
    1.37 +
    1.38 +
    1.39 +# if !defined (_STLP_OUTERMOST_HEADER_ID)
    1.40 +#  define _STLP_OUTERMOST_HEADER_ID 0x423
    1.41 +#  include <stl/_prolog.h>
    1.42 +# elif (_STLP_OUTERMOST_HEADER_ID == 0x423) && ! defined (_STLP_DONT_POP_0x423)
    1.43 +#  define _STLP_DONT_POP_0x423
    1.44 +# endif
    1.45 +
    1.46 +#ifndef _STLP_EXCEPTION
    1.47 +#define _STLP_EXCEPTION
    1.48 +
    1.49 +# if   ! defined (_STLP_NO_EXCEPTION_HEADER)
    1.50 +
    1.51 +#  if defined ( _UNCAUGHT_EXCEPTION )
    1.52 +#   undef _STLP_INCOMPLETE_EXCEPTION_HEADER
    1.53 +#  endif
    1.54 +
    1.55 +# if defined(_STLP_BROKEN_EXCEPTION_CLASS)
    1.56 +#  define exception     _STLP_NULLIFIED_BROKEN_EXCEPTION_CLASS
    1.57 +#  define bad_exception _STLP_NULLIFIED_BROKEN_BAD_EXCEPTION_CLASS
    1.58 +#  if defined (_STLP_NO_NEW_NEW_HEADER)
    1.59 +#   include _STLP_NATIVE_CPP_RUNTIME_HEADER(Exception.h)
    1.60 +#  else
    1.61 +#   include _STLP_NATIVE_CPP_RUNTIME_HEADER(Exception)
    1.62 +#  endif
    1.63 +#  undef exception
    1.64 +#  undef bad_exception
    1.65 +# else
    1.66 +
    1.67 +#ifndef _STLP_NO_NEW_NEW_HEADER
    1.68 +#define _STLP_NO_NEW_NEW_HEADER
    1.69 +#endif
    1.70 +
    1.71 +# if defined (_STLP_NO_NEW_NEW_HEADER)
    1.72 +#  include _STLP_NATIVE_CPP_RUNTIME_HEADER(exception.h)
    1.73 +# else
    1.74 +#   include _STLP_NATIVE_CPP_RUNTIME_HEADER(exception)
    1.75 +# endif
    1.76 +
    1.77 +# endif
    1.78 +
    1.79 +#    if defined (_STLP_MSVC) || defined (__ICL)
    1.80 +// dwa 02/04/00 - here I'm assuming that __ICL uses the same library headers as vc6.
    1.81 +// the header <yvals.h> which ships with vc6 and is included by its native <exception>
    1.82 +// actually turns on warnings, so we have to turn them back off.
    1.83 +#      include <config/_msvc_warnings_off.h>
    1.84 +#    endif
    1.85 +
    1.86 +
    1.87 +#  ifdef _STLP_USE_OWN_NAMESPACE
    1.88 +
    1.89 +_STLP_BEGIN_NAMESPACE
    1.90 +
    1.91 +#if !defined(_STLP_BROKEN_EXCEPTION_CLASS)
    1.92 +using _STLP_VENDOR_EXCEPT_STD::exception;
    1.93 +using _STLP_VENDOR_EXCEPT_STD::bad_exception;
    1.94 +#endif
    1.95 +
    1.96 +# if ! defined (_STLP_NO_USING_FOR_GLOBAL_FUNCTIONS)
    1.97 +
    1.98 +// fbp : many platforms present strange mix of
    1.99 +// those in various namespaces
   1.100 +#  if !defined(_STLP_VENDOR_UNEXPECTED_STD)
   1.101 +#   define _STLP_VENDOR_UNEXPECTED_STD _STLP_VENDOR_EXCEPT_STD
   1.102 +#  endif
   1.103 +
   1.104 +// weird errors
   1.105 +# if (! defined (__BORLANDC__)) || (defined (__STD_EXCEPTION) && defined (__RWSTD_EXCEPTION_SEEN) && defined ( _STLP_DONT_POP_0x423))
   1.106 +using _STLP_VENDOR_UNEXPECTED_STD::unexpected;
   1.107 +using _STLP_VENDOR_UNEXPECTED_STD::unexpected_handler;
   1.108 +using _STLP_VENDOR_UNEXPECTED_STD::set_unexpected;
   1.109 +using _STLP_VENDOR_UNEXPECTED_STD::terminate;
   1.110 +using _STLP_VENDOR_UNEXPECTED_STD::terminate_handler;
   1.111 +using _STLP_VENDOR_UNEXPECTED_STD::set_terminate;
   1.112 +# endif
   1.113 +
   1.114 +# if !defined (_STLP_INCOMPLETE_EXCEPTION_HEADER) 
   1.115 +using _STLP_VENDOR_UNEXPECTED_STD::uncaught_exception;
   1.116 +# endif
   1.117 +
   1.118 +#  endif
   1.119 +
   1.120 +_STLP_END_NAMESPACE
   1.121 +
   1.122 +#  endif /* _STLP_OWN_NAMESPACE */
   1.123 +
   1.124 +#else /* _STLP_NO_EXCEPTION_HEADER */
   1.125 +
   1.126 +// fbp : absence of <exception> usually means that those
   1.127 +// functions are not going to be called by compiler.
   1.128 +// Still, define them for the user.
   1.129 +#ifdef __SYMBIAN32__
   1.130 +_STLP_BEGIN_NAMESPACE
   1.131 +#endif //__SYMBIAN32__
   1.132 +typedef void (*unexpected_handler)();
   1.133 +unexpected_handler set_unexpected(unexpected_handler f) _STLP_NOTHROW_INHERENTLY;
   1.134 +void unexpected();
   1.135 +
   1.136 +typedef void (*terminate_handler)();
   1.137 +terminate_handler set_terminate(terminate_handler f) _STLP_NOTHROW_INHERENTLY;
   1.138 +void terminate();
   1.139 +
   1.140 +bool uncaught_exception(); // not implemented under mpw as of Jan/1999
   1.141 +
   1.142 +#ifdef __SYMBIAN32__
   1.143 +_STLP_END_NAMESPACE
   1.144 +#endif //__SYMBIAN32__
   1.145 +
   1.146 +#endif  /* _STLP_NO_EXCEPTION_HEADER */	
   1.147 +
   1.148 +# if   defined (_STLP_NO_EXCEPTION_HEADER) || defined(_STLP_BROKEN_EXCEPTION_CLASS)
   1.149 +# ifndef _STLP_EXCEPTION_H
   1.150 +#  define _STLP_EXCEPTION_H
   1.151 +
   1.152 +_STLP_BEGIN_NAMESPACE
   1.153 +
   1.154 +// section 18.6.1
   1.155 +#ifdef __SYMBIAN32__
   1.156 +class exception
   1.157 +#else
   1.158 +class _STLP_CLASS_DECLSPEC exception 
   1.159 +#endif
   1.160 +	{
   1.161 +	public:
   1.162 +# ifdef _STLP_OWN_IOSTREAMS
   1.163 +        _STLP_DECLSPEC exception() _STLP_NOTHROW;
   1.164 +        _STLP_DECLSPEC virtual ~exception() _STLP_NOTHROW;
   1.165 +	_STLP_DECLSPEC virtual const char* what() const _STLP_NOTHROW;
   1.166 +# else
   1.167 +        exception() _STLP_NOTHROW {}
   1.168 +		virtual ~exception() _STLP_NOTHROW {}
   1.169 +		virtual const char* what() const _STLP_NOTHROW {return "class exception";}
   1.170 +# endif
   1.171 +	};
   1.172 +	
   1.173 +	
   1.174 +
   1.175 +// section 18.6.2.1
   1.176 +#ifdef __SYMBIAN32__
   1.177 +class bad_exception : public exception 
   1.178 +#else
   1.179 +class _STLP_CLASS_DECLSPEC bad_exception : public exception 
   1.180 +#endif
   1.181 +	{
   1.182 +	public:
   1.183 +# ifdef _STLP_OWN_IOSTREAMS
   1.184 +	  _STLP_DECLSPEC bad_exception() _STLP_NOTHROW;
   1.185 +	  _STLP_DECLSPEC ~bad_exception() _STLP_NOTHROW;
   1.186 +	  _STLP_DECLSPEC const char* what() const _STLP_NOTHROW;
   1.187 +# else
   1.188 +	  bad_exception() _STLP_NOTHROW {}
   1.189 +	  ~bad_exception() _STLP_NOTHROW {}
   1.190 +	  const char* what() const _STLP_NOTHROW {return "class bad_exception";}
   1.191 +# endif
   1.192 +	};
   1.193 +
   1.194 +#ifdef __SYMBIAN32__
   1.195 +// Give forward declaration, this should be supported by the stdard libraries from platform vendor.
   1.196 +typedef void (*unexpected_handler)();
   1.197 +_STLP_DECLSPEC unexpected_handler set_unexpected(unexpected_handler f) _STLP_NOTHROW_INHERENTLY;
   1.198 +_STLP_DECLSPEC void unexpected();
   1.199 +
   1.200 +typedef void (*terminate_handler)();
   1.201 +_STLP_DECLSPEC terminate_handler set_terminate(terminate_handler f) _STLP_NOTHROW_INHERENTLY;
   1.202 +_STLP_DECLSPEC void terminate();
   1.203 +
   1.204 +_STLP_DECLSPEC bool uncaught_exception(); // not implemented under mpw as of Jan/1999
   1.205 +
   1.206 +#endif
   1.207 +_STLP_END_NAMESPACE
   1.208 +
   1.209 +#endif /* _STLP_NO_EXCEPTION_HEADER */
   1.210 +
   1.211 +_STLP_BEGIN_NAMESPACE
   1.212 +// forward declaration
   1.213 +class __Named_exception;
   1.214 +_STLP_END_NAMESPACE
   1.215 +#endif /* _STLP_EXCEPTION_H */
   1.216 +
   1.217 +#endif //_STLP_EXCEPTION
   1.218 +
   1.219 +# if (_STLP_OUTERMOST_HEADER_ID == 0x423)
   1.220 +#  if ! defined (_STLP_DONT_POP_0x423)
   1.221 +#   include <stl/_epilog.h>
   1.222 +#   undef  _STLP_OUTERMOST_HEADER_ID
   1.223 +#   endif
   1.224 +#   undef  _STLP_DONT_POP_0x423
   1.225 +# endif
   1.226 +
   1.227 +
   1.228 +// Local Variables:
   1.229 +// mode:C++
   1.230 +// End:
   1.231 +
   1.232 +
   1.233 +