1 /*
2  * Copyright (c) 1996,1997
3  * Silicon Graphics Computer Systems, Inc.
4  *
5  * Copyright (c) 1999
6  * Boris Fomitchev
7  *
8  * This material is provided "as is", with absolutely no warranty expressed
9  * or implied. Any use is at your own risk.
10  *
11  * Permission to use or copy this software for any purpose is hereby granted
12  * without fee, provided the above notices are retained on all copies.
13  * Permission to modify the code and to distribute modified code is granted,
14  * provided the above notices are retained, and a notice that the code was
15  * modified is included with the above copyright notice.
16  *
17  */
18 
19 #ifndef _STLP_INTERNAL_STDEXCEPT
20 #define _STLP_INTERNAL_STDEXCEPT
21 
22 #ifndef _STLP_INTERNAL_STDEXCEPT_BASE
23 #  include <stl/_stdexcept_base.h>
24 #endif
25 
26 #if !defined (_STLP_USE_NATIVE_STDEXCEPT) || defined (_STLP_USE_OWN_NAMESPACE)
27 
28 #  if defined(_STLP_USE_EXCEPTIONS)
29 
30 _STLP_BEGIN_NAMESPACE
31 
32 class _STLP_CLASS_DECLSPEC logic_error : public __Named_exception {
33 public:
logic_error(const string & __s)34   logic_error(const string& __s) : __Named_exception(__s) {}
35 #    ifndef _STLP_USE_NO_IOSTREAMS
36   ~logic_error() _STLP_NOTHROW_INHERENTLY;
37 #    endif
38 };
39 
40 class _STLP_CLASS_DECLSPEC runtime_error : public __Named_exception {
41 public:
runtime_error(const string & __s)42   runtime_error(const string& __s) : __Named_exception(__s) {}
43 #    ifndef _STLP_USE_NO_IOSTREAMS
44   ~runtime_error() _STLP_NOTHROW_INHERENTLY;
45 #    endif
46 };
47 
48 class _STLP_CLASS_DECLSPEC domain_error : public logic_error {
49 public:
domain_error(const string & __arg)50   domain_error(const string& __arg) : logic_error(__arg) {}
51 #    ifndef _STLP_USE_NO_IOSTREAMS
52   ~domain_error() _STLP_NOTHROW_INHERENTLY;
53 #    endif
54 };
55 
56 class _STLP_CLASS_DECLSPEC invalid_argument : public logic_error {
57 public:
invalid_argument(const string & __arg)58   invalid_argument(const string& __arg) : logic_error(__arg) {}
59 #    ifndef _STLP_USE_NO_IOSTREAMS
60   ~invalid_argument() _STLP_NOTHROW_INHERENTLY;
61 #    endif
62 };
63 
64 class _STLP_CLASS_DECLSPEC length_error : public logic_error {
65 public:
length_error(const string & __arg)66   length_error(const string& __arg) : logic_error(__arg) {}
67 #    ifndef _STLP_USE_NO_IOSTREAMS
68   ~length_error() _STLP_NOTHROW_INHERENTLY;
69 #    endif
70 };
71 
72 class _STLP_CLASS_DECLSPEC out_of_range : public logic_error {
73 public:
out_of_range(const string & __arg)74   out_of_range(const string& __arg) : logic_error(__arg) {}
75 #    ifndef _STLP_USE_NO_IOSTREAMS
76   ~out_of_range() _STLP_NOTHROW_INHERENTLY;
77 #    endif
78 };
79 
80 class _STLP_CLASS_DECLSPEC range_error : public runtime_error {
81 public:
range_error(const string & __arg)82   range_error(const string& __arg) : runtime_error(__arg) {}
83 #    ifndef _STLP_USE_NO_IOSTREAMS
84   ~range_error() _STLP_NOTHROW_INHERENTLY;
85 #    endif
86 };
87 
88 class _STLP_CLASS_DECLSPEC overflow_error : public runtime_error {
89 public:
overflow_error(const string & __arg)90   overflow_error(const string& __arg) : runtime_error(__arg) {}
91 #    ifndef _STLP_USE_NO_IOSTREAMS
92   ~overflow_error() _STLP_NOTHROW_INHERENTLY;
93 #    endif
94 };
95 
96 class _STLP_CLASS_DECLSPEC underflow_error : public runtime_error {
97 public:
underflow_error(const string & __arg)98   underflow_error(const string& __arg) : runtime_error(__arg) {}
99 #    ifndef _STLP_USE_NO_IOSTREAMS
100   ~underflow_error() _STLP_NOTHROW_INHERENTLY;
101 #    endif
102 };
103 
104 _STLP_END_NAMESPACE
105 
106 #  endif /* _STLP_USE_EXCEPTIONS */
107 #endif
108 
109 #endif /* _STLP_INTERNAL_STDEXCEPT */
110