|
1 /*************************************************************************** |
|
2 * |
|
3 * _exception.h - Declarations for the Standard Library exception class |
|
4 * |
|
5 * This is an internal header file used to implement the C++ Standard |
|
6 * Library. It should never be #included directly by a program. |
|
7 * |
|
8 * $Id: _exception.h 225375 2005-07-26 19:04:10Z sebor $ |
|
9 * |
|
10 *************************************************************************** |
|
11 * |
|
12 * Copyright (c) 1994-2005 Quovadx, Inc., acting through its Rogue Wave |
|
13 * Software division. Licensed under the Apache License, Version 2.0 (the |
|
14 * "License"); you may not use this file except in compliance with the |
|
15 * License. You may obtain a copy of the License at |
|
16 * http://www.apache.org/licenses/LICENSE-2.0. Unless required by |
|
17 * applicable law or agreed to in writing, software distributed under |
|
18 * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR |
|
19 * CONDITIONS OF ANY KIND, either express or implied. See the License |
|
20 * for the specific language governing permissions and limitations under |
|
21 * the License. |
|
22 * |
|
23 **************************************************************************/ |
|
24 |
|
25 #ifndef _RWSTD_EXCEPTION_H_INCLUDED |
|
26 #define _RWSTD_EXCEPTION_H_INCLUDED |
|
27 |
|
28 |
|
29 #include <exception> |
|
30 #include <rw/_defs.h> |
|
31 |
|
32 |
|
33 _RWSTD_NAMESPACE (std) { |
|
34 |
|
35 |
|
36 // forward declarations avoid circular dependencies |
|
37 template <class _CharT, class _Traits, class _Allocator> |
|
38 class basic_string; |
|
39 |
|
40 template <class _CharT> |
|
41 struct char_traits; |
|
42 |
|
43 template <class _TypeT> |
|
44 class allocator; |
|
45 |
|
46 |
|
47 typedef basic_string<char, char_traits<char>, allocator<char> > string; |
|
48 |
|
49 } // namespace std |
|
50 _RWSTD_NAMESPACE (__rw) { |
|
51 |
|
52 // base exception class inherited by all other exceptions |
|
53 #ifndef __SYMBIAN32__ |
|
54 class _RWSTD_EXPORT __rw_exception: public _STD::exception |
|
55 { |
|
56 public: |
|
57 |
|
58 __rw_exception () _THROWS (()); |
|
59 |
|
60 __rw_exception (const __rw_exception&); |
|
61 |
|
62 _EXPLICIT __rw_exception (const _STD::string&); |
|
63 |
|
64 _EXPLICIT __rw_exception (const char*); |
|
65 |
|
66 virtual ~__rw_exception () _THROWS (()); |
|
67 |
|
68 // empty exception specification necessary in order to preserve |
|
69 // the no-exception guarantee provided by std::exception to |
|
70 // derived classes (e.g., logic_error) |
|
71 __rw_exception& operator= (const __rw_exception&) _THROWS (()); |
|
72 |
|
73 virtual const char* what () const _THROWS (()); |
|
74 |
|
75 __rw_exception& |
|
76 _C_assign (const char*, _RWSTD_SIZE_T = _RWSTD_SIZE_MAX); |
|
77 |
|
78 private: |
|
79 char *_C_what; // description string |
|
80 }; |
|
81 #else |
|
82 class __rw_exception: public _STD::exception |
|
83 { |
|
84 public: |
|
85 |
|
86 _RWSTD_EXPORT __rw_exception () _THROWS (()); |
|
87 |
|
88 _RWSTD_EXPORT __rw_exception (const __rw_exception&); |
|
89 |
|
90 _RWSTD_EXPORT _EXPLICIT __rw_exception (const _STD::string&); |
|
91 |
|
92 _RWSTD_EXPORT _EXPLICIT __rw_exception (const char*); |
|
93 |
|
94 _RWSTD_EXPORT virtual ~__rw_exception () _THROWS (()); |
|
95 |
|
96 // empty exception specification necessary in order to preserve |
|
97 // the no-exception guarantee provided by std::exception to |
|
98 // derived classes (e.g., logic_error) |
|
99 _RWSTD_EXPORT __rw_exception& operator= (const __rw_exception&) _THROWS (()); |
|
100 |
|
101 _RWSTD_EXPORT virtual const char* what () const _THROWS (()); |
|
102 |
|
103 _RWSTD_EXPORT __rw_exception& _C_assign (const char*, _RWSTD_SIZE_T /*= _RWSTD_SIZE_MAX*/); |
|
104 |
|
105 private: |
|
106 char *_C_what; // description string |
|
107 }; |
|
108 #endif //__SYMBIAN32__ |
|
109 |
|
110 } // namespace __rw |
|
111 |
|
112 |
|
113 #endif // _RWSTD_EXCEPTION_H_INCLUDED |