epoc32/include/stdapis/stlport/stdexcept
branchSymbian2
changeset 2 2fe1408b6811
parent 0 061f57f2323e
     1.1 --- a/epoc32/include/stdapis/stlport/stdexcept	Tue Nov 24 13:55:44 2009 +0000
     1.2 +++ b/epoc32/include/stdapis/stlport/stdexcept	Tue Mar 16 16:12:26 2010 +0000
     1.3 @@ -1,1 +1,290 @@
     1.4 -stdexcept
     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 +
    1.26 +# if !defined (_STLP_OUTERMOST_HEADER_ID)
    1.27 +#  define _STLP_OUTERMOST_HEADER_ID 0x63
    1.28 +#  include <stl/_prolog.h>
    1.29 +# elif (_STLP_OUTERMOST_HEADER_ID == 0x63) && ! defined (_STLP_DONT_POP_0x63)
    1.30 +#  define _STLP_DONT_POP_0x63
    1.31 +# endif
    1.32 +
    1.33 +#ifndef _STLP_STDEXCEPT
    1.34 +#define _STLP_STDEXCEPT 1
    1.35 +
    1.36 +# ifdef _STLP_PRAGMA_ONCE
    1.37 +#  pragma once
    1.38 +# endif
    1.39 +
    1.40 +#if defined (_STLP_USE_TRAP_LEAVE)
    1.41 +
    1.42 +enum {
    1.43 +  STDEX_bad_alloc			= -10000,
    1.44 +  STDEX_logic_error			= -10001,
    1.45 +  STDEX_runtime_error		= -10002,
    1.46 +  STDEX_domain_error		= -10003,
    1.47 +  STDEX_invalid_argument	= -10004,
    1.48 +  STDEX_length_error		= -10005,
    1.49 +  STDEX_out_of_range		= -10006,
    1.50 +  STDEX_range_error			= -10007,
    1.51 +  STDEX_overflow_error		= -10008,
    1.52 +  STDEX_underflow_error		= -10009
    1.53 +};
    1.54 +
    1.55 +// User may override this
    1.56 +#ifndef STDEX_REPORT_EXCEPTION
    1.57 +# define STDEX_REPORT_EXCEPTION(x) 
    1.58 +#endif
    1.59 +
    1.60 +#endif
    1.61 +
    1.62 +# if !defined(_STLP_STDEXCEPT_SEEN) && \
    1.63 +   (!defined (_STLP_USE_NATIVE_STDEXCEPT) || defined (_STLP_USE_OWN_NAMESPACE))
    1.64 +
    1.65 +#  define _STLP_STDEXCEPT_SEEN 1
    1.66 +
    1.67 +#  include <exception>
    1.68 +
    1.69 +#if defined(_STLP_USE_EXCEPTIONS) || \
    1.70 +    !(defined(_MIPS_SIM) && defined(_ABIO32) && _MIPS_SIM == _ABIO32)
    1.71 +
    1.72 +# include <cstring>
    1.73 +
    1.74 +#ifndef _STLP_INTERNAL_ALLOC_H
    1.75 +# include <stl/_alloc.h>
    1.76 +#endif
    1.77 +
    1.78 +#ifndef _STLP_STRING_FWD_H
    1.79 +# include <stl/_string_fwd.h>
    1.80 +#endif
    1.81 +
    1.82 +# define _STLP_OWN_STDEXCEPT 1
    1.83 +
    1.84 +_STLP_BEGIN_NAMESPACE
    1.85 +
    1.86 +# if   ! defined (_STLP_NO_EXCEPTION_HEADER)
    1.87 +# if !defined(_STLP_EXCEPTION_BASE) && !defined(_STLP_BROKEN_EXCEPTION_CLASS) && defined (_STLP_USE_NAMESPACES) && defined (_STLP_USE_OWN_NAMESPACE)
    1.88 +using _STLP_VENDOR_EXCEPT_STD::exception;
    1.89 +# endif
    1.90 +# endif
    1.91 +#  define _STLP_EXCEPTION_BASE exception
    1.92 +
    1.93 +#ifdef __SYMBIAN32__
    1.94 +class __Named_exception : public _STLP_EXCEPTION_BASE {
    1.95 +#else
    1.96 +class _STLP_CLASS_DECLSPEC __Named_exception : public _STLP_EXCEPTION_BASE {
    1.97 +#endif //__SYMBIAN32__
    1.98 +public:
    1.99 +  _STLP_DECLSPEC __Named_exception(const string& __str) 
   1.100 +# ifdef _STLP_OWN_IOSTREAMS
   1.101 +    ;
   1.102 +  _STLP_DECLSPEC const char* what() const _STLP_NOTHROW_INHERENTLY;
   1.103 +  _STLP_DECLSPEC ~__Named_exception() _STLP_NOTHROW_INHERENTLY;
   1.104 +# else
   1.105 +  {
   1.106 +    strncpy(_M_name, __get_c_string(__str), _S_bufsize);
   1.107 +    _M_name[_S_bufsize - 1] = '\0';
   1.108 +  }
   1.109 +  const char* what() const _STLP_NOTHROW_INHERENTLY { return _M_name; }
   1.110 +# endif
   1.111 +
   1.112 +private:
   1.113 +  enum { _S_bufsize = 256 };
   1.114 +  char _M_name[_S_bufsize];
   1.115 +};
   1.116 +
   1.117 +#ifdef __SYMBIAN32__
   1.118 +class logic_error : public __Named_exception {
   1.119 +#else
   1.120 +class _STLP_CLASS_DECLSPEC logic_error : public __Named_exception {
   1.121 +#endif
   1.122 +public:
   1.123 +  _STLP_DECLSPEC logic_error(const string& __s)
   1.124 +#ifdef __SYMBIAN32__
   1.125 +    ;
   1.126 +#else
   1.127 +   : __Named_exception(__s) {}
   1.128 +#endif
   1.129 +# ifdef _STLP_OWN_IOSTREAMS
   1.130 +  _STLP_DECLSPEC ~logic_error() _STLP_NOTHROW_INHERENTLY;
   1.131 +# endif
   1.132 +};
   1.133 +
   1.134 +#ifdef __SYMBIAN32__
   1.135 +class runtime_error : public __Named_exception {
   1.136 +#else
   1.137 +class _STLP_CLASS_DECLSPEC runtime_error : public __Named_exception {
   1.138 +#endif
   1.139 +public:
   1.140 +  _STLP_DECLSPEC runtime_error(const string& __s)
   1.141 +#ifdef __SYMBIAN32__
   1.142 +    ;
   1.143 +#else
   1.144 +   : __Named_exception(__s) {}
   1.145 +#endif
   1.146 +# ifdef _STLP_OWN_IOSTREAMS
   1.147 +  _STLP_DECLSPEC ~runtime_error() _STLP_NOTHROW_INHERENTLY;
   1.148 +# endif
   1.149 +};
   1.150 +
   1.151 +#ifdef __SYMBIAN32__
   1.152 +class domain_error : public logic_error {
   1.153 +#else
   1.154 +class _STLP_CLASS_DECLSPEC domain_error : public logic_error {
   1.155 +#endif
   1.156 +public:
   1.157 +  _STLP_DECLSPEC domain_error(const string& __arg)
   1.158 +#ifdef __SYMBIAN32__
   1.159 +    ;
   1.160 +#else
   1.161 +   : logic_error(__arg) {}
   1.162 +#endif
   1.163 +# ifdef _STLP_OWN_IOSTREAMS
   1.164 +  _STLP_DECLSPEC ~domain_error() _STLP_NOTHROW_INHERENTLY;
   1.165 +# endif
   1.166 +};
   1.167 +
   1.168 +#ifdef __SYMBIAN32__
   1.169 +class invalid_argument : public logic_error {
   1.170 +#else
   1.171 +class _STLP_CLASS_DECLSPEC invalid_argument : public logic_error {
   1.172 +#endif
   1.173 +public:
   1.174 +  _STLP_DECLSPEC invalid_argument(const string& __arg)
   1.175 +#ifdef __SYMBIAN32__
   1.176 +    ;
   1.177 +#else
   1.178 +   : logic_error(__arg) {}
   1.179 +#endif
   1.180 +# ifdef _STLP_OWN_IOSTREAMS
   1.181 +  _STLP_DECLSPEC ~invalid_argument() _STLP_NOTHROW_INHERENTLY;
   1.182 +# endif
   1.183 +};
   1.184 +
   1.185 +#ifdef __SYMBIAN32__
   1.186 +class length_error : public logic_error {
   1.187 +#else
   1.188 +class _STLP_CLASS_DECLSPEC length_error : public logic_error {
   1.189 +#endif
   1.190 +public:
   1.191 +  _STLP_DECLSPEC length_error(const string& __arg)
   1.192 +#ifdef __SYMBIAN32__
   1.193 +    ;
   1.194 +#else
   1.195 +   : logic_error(__arg) {}
   1.196 +#endif
   1.197 +# ifdef _STLP_OWN_IOSTREAMS
   1.198 +  _STLP_DECLSPEC ~length_error() _STLP_NOTHROW_INHERENTLY;
   1.199 +# endif
   1.200 +};
   1.201 +
   1.202 +#ifdef __SYMBIAN32__
   1.203 +class out_of_range : public logic_error {
   1.204 +#else
   1.205 +class _STLP_CLASS_DECLSPEC out_of_range : public logic_error {
   1.206 +#endif
   1.207 +public:
   1.208 +  _STLP_DECLSPEC out_of_range(const string& __arg)
   1.209 +#ifdef __SYMBIAN32__
   1.210 +    ;
   1.211 +#else
   1.212 +   : logic_error(__arg) {}
   1.213 +#endif
   1.214 +# ifdef _STLP_OWN_IOSTREAMS
   1.215 +  _STLP_DECLSPEC ~out_of_range() _STLP_NOTHROW_INHERENTLY;
   1.216 +# endif
   1.217 +};
   1.218 +
   1.219 +#ifdef __SYMBIAN32__
   1.220 +class range_error : public runtime_error {
   1.221 +#else
   1.222 +class _STLP_CLASS_DECLSPEC range_error : public runtime_error {
   1.223 +#endif
   1.224 +public:
   1.225 +  _STLP_DECLSPEC range_error(const string& __arg)
   1.226 +#ifdef __SYMBIAN32__
   1.227 +    ;
   1.228 +#else
   1.229 +   : runtime_error(__arg) {}
   1.230 +#endif
   1.231 +# ifdef _STLP_OWN_IOSTREAMS
   1.232 +  _STLP_DECLSPEC ~range_error() _STLP_NOTHROW_INHERENTLY;
   1.233 +# endif
   1.234 +};
   1.235 +
   1.236 +#ifdef __SYMBIAN32__
   1.237 +class overflow_error : public runtime_error {
   1.238 +#else
   1.239 +class _STLP_CLASS_DECLSPEC overflow_error : public runtime_error {
   1.240 +#endif
   1.241 +public:
   1.242 +  _STLP_DECLSPEC overflow_error(const string& __arg)
   1.243 +#ifdef __SYMBIAN32__
   1.244 +    ;
   1.245 +#else
   1.246 +   : runtime_error(__arg) {}
   1.247 +#endif
   1.248 +# ifdef _STLP_OWN_IOSTREAMS
   1.249 +  _STLP_DECLSPEC ~overflow_error() _STLP_NOTHROW_INHERENTLY;
   1.250 +# endif
   1.251 +};
   1.252 +
   1.253 +#ifdef __SYMBIAN32__
   1.254 +class underflow_error : public runtime_error {
   1.255 +#else
   1.256 +class _STLP_CLASS_DECLSPEC underflow_error : public runtime_error {
   1.257 +#endif
   1.258 +public:
   1.259 +  _STLP_DECLSPEC underflow_error(const string& __arg)
   1.260 +#ifdef __SYMBIAN32__
   1.261 +    ;
   1.262 +#else
   1.263 +   : runtime_error(__arg) {}
   1.264 +#endif
   1.265 +# ifdef _STLP_OWN_IOSTREAMS
   1.266 +  _STLP_DECLSPEC ~underflow_error() _STLP_NOTHROW_INHERENTLY;
   1.267 +# endif
   1.268 +};
   1.269 +
   1.270 +_STLP_END_NAMESPACE
   1.271 +
   1.272 +#endif /* Not o32, and no exceptions */
   1.273 +# endif /* _STLP_STDEXCEPT_SEEN */
   1.274 +
   1.275 +
   1.276 +#if defined (_STLP_USE_NATIVE_STDEXCEPT)
   1.277 +#  include _STLP_NATIVE_HEADER(stdexcept)
   1.278 +# endif
   1.279 +
   1.280 +#endif /* _STLP_STDEXCEPT */
   1.281 +
   1.282 +# if (_STLP_OUTERMOST_HEADER_ID == 0x63)
   1.283 +#  if ! defined (_STLP_DONT_POP_0x63)
   1.284 +#   include <stl/_epilog.h>
   1.285 +#   undef  _STLP_OUTERMOST_HEADER_ID
   1.286 +#   endif
   1.287 +#   undef  _STLP_DONT_POP_0x63
   1.288 +# endif
   1.289 +
   1.290 +
   1.291 +// Local Variables:
   1.292 +// mode:C++
   1.293 +// End:
   1.294 +