aboutsummaryrefslogtreecommitdiff
path: root/src/exception.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/exception.h')
-rw-r--r--src/exception.h31
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 ) \
69class 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 ) \
78name::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} \
86name::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} \
94name::name( int nCode ) throw() : \
95 Exception( nCode ) \
96{ \
97}
98
68#endif 99#endif