1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184
|
/*
* Copyright (c) 1996,1997
* Silicon Graphics Computer Systems, Inc.
*
* 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
* 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_STDEXCEPT
# if !defined (_STLP_OUTERMOST_HEADER_ID)
# define _STLP_OUTERMOST_HEADER_ID 0x63
# include <stl/_prolog.h>
# elif (_STLP_OUTERMOST_HEADER_ID == 0x63) && ! defined (_STLP_DONT_POP_0x63)
# define _STLP_DONT_POP_0x63
# endif
# ifdef _STLP_PRAGMA_ONCE
# pragma once
# endif
# if !defined(_STLP_STDEXCEPT_SEEN) && \
(!defined (_STLP_USE_NATIVE_STDEXCEPT) || defined (_STLP_USE_OWN_NAMESPACE))
# define _STLP_STDEXCEPT_SEEN 1
# include <exception>
#if defined(_STLP_USE_EXCEPTIONS) || \
!(defined(_MIPS_SIM) && defined(_ABIO32) && _MIPS_SIM == _ABIO32)
# include <cstring>
#ifndef _STLP_INTERNAL_ALLOC_H
# include <stl/_alloc.h>
#endif
#ifndef _STLP_STRING_FWD_H
# include <stl/_string_fwd.h>
#endif
# define _STLP_OWN_STDEXCEPT 1
_STLP_BEGIN_NAMESPACE
#if (__GNUC__ >= 3)
#define _STLP_NOTHROW_INHERENTLY throw()
#endif
# if ! defined (_STLP_NO_EXCEPTION_HEADER)
# if !defined(_STLP_EXCEPTION_BASE) && !defined(_STLP_BROKEN_EXCEPTION_CLASS) && defined (_STLP_USE_NAMESPACES) && defined (_STLP_USE_OWN_NAMESPACE)
using _STLP_VENDOR_EXCEPT_STD::exception;
# endif
# endif
# define _STLP_EXCEPTION_BASE exception
class _STLP_CLASS_DECLSPEC __Named_exception : public _STLP_EXCEPTION_BASE {
public:
__Named_exception(const string& __str)
# ifdef _STLP_OWN_IOSTREAMS
;
const char* what() const _STLP_NOTHROW_INHERENTLY;
~__Named_exception() _STLP_NOTHROW_INHERENTLY;
# else
{
strncpy(_M_name, __get_c_string(__str), _S_bufsize);
_M_name[_S_bufsize - 1] = '\0';
}
const char* what() const _STLP_NOTHROW_INHERENTLY { return _M_name; }
# endif
private:
enum { _S_bufsize = 256 };
char _M_name[_S_bufsize];
};
class _STLP_CLASS_DECLSPEC logic_error : public __Named_exception {
public:
logic_error(const string& __s) : __Named_exception(__s) {}
# ifdef _STLP_OWN_IOSTREAMS
~logic_error() _STLP_NOTHROW_INHERENTLY;
# endif
};
class _STLP_CLASS_DECLSPEC runtime_error : public __Named_exception {
public:
runtime_error(const string& __s) : __Named_exception(__s) {}
# ifdef _STLP_OWN_IOSTREAMS
~runtime_error() _STLP_NOTHROW_INHERENTLY;
# endif
};
class _STLP_CLASS_DECLSPEC domain_error : public logic_error {
public:
domain_error(const string& __arg) : logic_error(__arg) {}
# ifdef _STLP_OWN_IOSTREAMS
~domain_error() _STLP_NOTHROW_INHERENTLY;
# endif
};
class _STLP_CLASS_DECLSPEC invalid_argument : public logic_error {
public:
invalid_argument(const string& __arg) : logic_error(__arg) {}
# ifdef _STLP_OWN_IOSTREAMS
~invalid_argument() _STLP_NOTHROW_INHERENTLY;
# endif
};
class _STLP_CLASS_DECLSPEC length_error : public logic_error {
public:
length_error(const string& __arg) : logic_error(__arg) {}
# ifdef _STLP_OWN_IOSTREAMS
~length_error() _STLP_NOTHROW_INHERENTLY;
# endif
};
class _STLP_CLASS_DECLSPEC out_of_range : public logic_error {
public:
out_of_range(const string& __arg) : logic_error(__arg) {}
# ifdef _STLP_OWN_IOSTREAMS
~out_of_range() _STLP_NOTHROW_INHERENTLY;
# endif
};
class _STLP_CLASS_DECLSPEC range_error : public runtime_error {
public:
range_error(const string& __arg) : runtime_error(__arg) {}
# ifdef _STLP_OWN_IOSTREAMS
~range_error() _STLP_NOTHROW_INHERENTLY;
# endif
};
class _STLP_CLASS_DECLSPEC overflow_error : public runtime_error {
public:
overflow_error(const string& __arg) : runtime_error(__arg) {}
# ifdef _STLP_OWN_IOSTREAMS
~overflow_error() _STLP_NOTHROW_INHERENTLY;
# endif
};
class _STLP_CLASS_DECLSPEC underflow_error : public runtime_error {
public:
underflow_error(const string& __arg) : runtime_error(__arg) {}
# ifdef _STLP_OWN_IOSTREAMS
~underflow_error() _STLP_NOTHROW_INHERENTLY;
# endif
};
_STLP_END_NAMESPACE
#endif /* Not o32, and no exceptions */
# endif /* _STLP_STDEXCEPT_SEEN */
#if defined (_STLP_USE_NATIVE_STDEXCEPT)
# include _STLP_NATIVE_HEADER(stdexcept)
# endif
# define _STLP_STDEXCEPT 1
# if (_STLP_OUTERMOST_HEADER_ID == 0x63)
# if ! defined (_STLP_DONT_POP_0x63)
# include <stl/_epilog.h>
# undef _STLP_OUTERMOST_HEADER_ID
# endif
# undef _STLP_DONT_POP_0x63
# endif
#endif /* _STLP_STDEXCEPT */
// Local Variables:
// mode:C++
// End:
|