From ae5ea621f06a645dbfcf454e9b8f39a99dc8e822 Mon Sep 17 00:00:00 2001 From: Mike Buland Date: Mon, 22 Oct 2007 23:24:07 +0000 Subject: Made Exceptions copy well...I thought I'd already done this once... --- src/exceptionbase.cpp | 7 +++++++ src/exceptionbase.h | 15 ++++++++++++++- 2 files changed, 21 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/exceptionbase.cpp b/src/exceptionbase.cpp index f6ec625..73a7b0e 100644 --- a/src/exceptionbase.cpp +++ b/src/exceptionbase.cpp @@ -29,6 +29,13 @@ Bu::ExceptionBase::ExceptionBase( int nCode ) throw() : { } +Bu::ExceptionBase::ExceptionBase( const ExceptionBase &e ) throw () : + nErrorCode( e.nErrorCode ), + sWhat( NULL ) +{ + setWhat( e.sWhat ); +} + Bu::ExceptionBase::~ExceptionBase() throw() { if( sWhat ) diff --git a/src/exceptionbase.h b/src/exceptionbase.h index f2543e4..63deb6b 100644 --- a/src/exceptionbase.h +++ b/src/exceptionbase.h @@ -42,6 +42,8 @@ namespace Bu * @return */ ExceptionBase( int nCode=0 ) throw(); + + ExceptionBase( const ExceptionBase &e ) throw (); /** * @@ -87,6 +89,7 @@ class name : public Bu::ExceptionBase \ name( const char *sFormat, ... ) throw (); \ name( int nCode, const char *sFormat, ... ) throw(); \ name( int nCode=0 ) throw (); \ + name( const name &e ) throw (); \ }; #define subExceptionDeclChild( name, parent ) \ @@ -96,6 +99,7 @@ class name : public parent \ name( const char *sFormat, ... ) throw (); \ name( int nCode, const char *sFormat, ... ) throw(); \ name( int nCode=0 ) throw (); \ + name( const name &e ) throw (); \ }; #define subExceptionDeclBegin( name ) \ @@ -104,7 +108,8 @@ class name : public Bu::ExceptionBase \ public: \ name( const char *sFormat, ... ) throw (); \ name( int nCode, const char *sFormat, ... ) throw(); \ - name( int nCode=0 ) throw (); + name( int nCode=0 ) throw (); \ + name( const name &e ) throw (); #define subExceptionDeclEnd() \ }; @@ -129,6 +134,10 @@ name::name( int nCode, const char *lpFormat, ... ) throw() : \ name::name( int nCode ) throw() : \ ExceptionBase( nCode ) \ { \ +} \ +name::name( const name &e ) throw() : \ + ExceptionBase( e ) \ +{ \ } #define subExceptionDefChild( name, parent ) \ @@ -151,6 +160,10 @@ name::name( int nCode, const char *lpFormat, ... ) throw() : \ name::name( int nCode ) throw() : \ parent( nCode ) \ { \ +} \ +name::name( const name &e ) throw() : \ + ExceptionBase( e ) \ +{ \ } #endif -- cgit v1.2.3