From 2741e16c129e8c70bad2cb47e5a97083dd4d3c85 Mon Sep 17 00:00:00 2001 From: Mike Buland Date: Fri, 13 Jul 2007 02:07:33 +0000 Subject: More updates to the Exception macros. --- src/exceptionbase.h | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/src/exceptionbase.h b/src/exceptionbase.h index 4cdbf36..f2543e4 100644 --- a/src/exceptionbase.h +++ b/src/exceptionbase.h @@ -89,6 +89,15 @@ class name : public Bu::ExceptionBase \ name( int nCode=0 ) throw (); \ }; +#define subExceptionDeclChild( name, parent ) \ +class name : public parent \ +{ \ + public: \ + name( const char *sFormat, ... ) throw (); \ + name( int nCode, const char *sFormat, ... ) throw(); \ + name( int nCode=0 ) throw (); \ +}; + #define subExceptionDeclBegin( name ) \ class name : public Bu::ExceptionBase \ { \ @@ -122,4 +131,26 @@ name::name( int nCode ) throw() : \ { \ } +#define subExceptionDefChild( name, parent ) \ +name::name( const char *lpFormat, ... ) throw() : \ + parent( 0 ) \ +{ \ + va_list ap; \ + va_start( ap, lpFormat ); \ + setWhat( lpFormat, ap ); \ + va_end( ap ); \ +} \ +name::name( int nCode, const char *lpFormat, ... ) throw() : \ + parent( nCode ) \ +{ \ + va_list ap; \ + va_start( ap, lpFormat ); \ + setWhat( lpFormat, ap ); \ + va_end( ap ); \ +} \ +name::name( int nCode ) throw() : \ + parent( nCode ) \ +{ \ +} + #endif -- cgit v1.2.3