diff options
author | Mike Buland <eichlan@xagasoft.com> | 2006-07-26 19:09:50 +0000 |
---|---|---|
committer | Mike Buland <eichlan@xagasoft.com> | 2006-07-26 19:09:50 +0000 |
commit | 9e27762c2b4c1baf5b2aff003fbc56236fd742e6 (patch) | |
tree | cd7256cea35b5a8dd7aefe3107c25a1681e83367 /src/exception.h | |
parent | 2d0ffd6df450eb7cbc1e4dea841dcbf1ef9f9417 (diff) | |
download | libbu++-9e27762c2b4c1baf5b2aff003fbc56236fd742e6.tar.gz libbu++-9e27762c2b4c1baf5b2aff003fbc56236fd742e6.tar.bz2 libbu++-9e27762c2b4c1baf5b2aff003fbc56236fd742e6.tar.xz libbu++-9e27762c2b4c1baf5b2aff003fbc56236fd742e6.zip |
Partial update, don't use this release...
Diffstat (limited to 'src/exception.h')
-rw-r--r-- | src/exception.h | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/src/exception.h b/src/exception.h index 2233736..1234bef 100644 --- a/src/exception.h +++ b/src/exception.h | |||
@@ -65,4 +65,35 @@ private: | |||
65 | int nErrorCode; /**< The code for the error that occured. */ | 65 | int nErrorCode; /**< The code for the error that occured. */ |
66 | }; | 66 | }; |
67 | 67 | ||
68 | #define subExceptionDecl( name ) \ | ||
69 | class name : public Exception \ | ||
70 | { \ | ||
71 | public: \ | ||
72 | name( const char *sFormat, ... ) throw (); \ | ||
73 | name( int nCode, const char *sFormat, ... ) throw(); \ | ||
74 | name( int nCode=0 ) throw (); \ | ||
75 | }; | ||
76 | |||
77 | #define subExceptionDef( name ) \ | ||
78 | name::name( const char *lpFormat, ... ) throw() : \ | ||
79 | Exception( 0 ) \ | ||
80 | { \ | ||
81 | va_list ap; \ | ||
82 | va_start( ap, lpFormat ); \ | ||
83 | setWhat( lpFormat, ap ); \ | ||
84 | va_end( ap ); \ | ||
85 | } \ | ||
86 | name::name( int nCode, const char *lpFormat, ... ) throw() : \ | ||
87 | Exception( nCode ) \ | ||
88 | { \ | ||
89 | va_list ap; \ | ||
90 | va_start( ap, lpFormat ); \ | ||
91 | setWhat( lpFormat, ap ); \ | ||
92 | va_end( ap ); \ | ||
93 | } \ | ||
94 | name::name( int nCode ) throw() : \ | ||
95 | Exception( nCode ) \ | ||
96 | { \ | ||
97 | } | ||
98 | |||
68 | #endif | 99 | #endif |