aboutsummaryrefslogtreecommitdiff
path: root/src/exceptionbase.cpp
diff options
context:
space:
mode:
authorMike Buland <eichlan@xagasoft.com>2006-07-26 19:16:58 +0000
committerMike Buland <eichlan@xagasoft.com>2006-07-26 19:16:58 +0000
commit579c3ac445043122b0a702bdb2542d9ea404b62e (patch)
treea96017529296f52a357e25de37b8c4cd052bebf5 /src/exceptionbase.cpp
parent9e27762c2b4c1baf5b2aff003fbc56236fd742e6 (diff)
downloadlibbu++-579c3ac445043122b0a702bdb2542d9ea404b62e.tar.gz
libbu++-579c3ac445043122b0a702bdb2542d9ea404b62e.tar.bz2
libbu++-579c3ac445043122b0a702bdb2542d9ea404b62e.tar.xz
libbu++-579c3ac445043122b0a702bdb2542d9ea404b62e.zip
Exceptions have been re-worked, and are easier to use, and don't collide with
system includues anymore.
Diffstat (limited to '')
-rw-r--r--src/exceptionbase.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/exceptionbase.cpp b/src/exceptionbase.cpp
index 3cde134..a9b9820 100644
--- a/src/exceptionbase.cpp
+++ b/src/exceptionbase.cpp
@@ -1,7 +1,7 @@
1#include "exception.h" 1#include "exceptionbase.h"
2#include <stdarg.h> 2#include <stdarg.h>
3 3
4Exception::Exception( const char *lpFormat, ... ) throw() : 4ExceptionBase::ExceptionBase( const char *lpFormat, ... ) throw() :
5 nErrorCode( 0 ), 5 nErrorCode( 0 ),
6 sWhat( NULL ) 6 sWhat( NULL )
7{ 7{
@@ -12,7 +12,7 @@ Exception::Exception( const char *lpFormat, ... ) throw() :
12 va_end(ap); 12 va_end(ap);
13} 13}
14 14
15Exception::Exception( int nCode, const char *lpFormat, ... ) throw() : 15ExceptionBase::ExceptionBase( int nCode, const char *lpFormat, ... ) throw() :
16 nErrorCode( nCode ), 16 nErrorCode( nCode ),
17 sWhat( NULL ) 17 sWhat( NULL )
18{ 18{
@@ -23,13 +23,13 @@ Exception::Exception( int nCode, const char *lpFormat, ... ) throw() :
23 va_end(ap); 23 va_end(ap);
24} 24}
25 25
26Exception::Exception( int nCode ) throw() : 26ExceptionBase::ExceptionBase( int nCode ) throw() :
27 nErrorCode( nCode ), 27 nErrorCode( nCode ),
28 sWhat( NULL ) 28 sWhat( NULL )
29{ 29{
30} 30}
31 31
32Exception::~Exception() throw() 32ExceptionBase::~ExceptionBase() throw()
33{ 33{
34 if( sWhat ) 34 if( sWhat )
35 { 35 {
@@ -38,7 +38,7 @@ Exception::~Exception() throw()
38 } 38 }
39} 39}
40 40
41void Exception::setWhat( const char *lpFormat, va_list &vargs ) 41void ExceptionBase::setWhat( const char *lpFormat, va_list &vargs )
42{ 42{
43 if( sWhat ) delete[] sWhat; 43 if( sWhat ) delete[] sWhat;
44 int nSize; 44 int nSize;
@@ -48,12 +48,12 @@ void Exception::setWhat( const char *lpFormat, va_list &vargs )
48 vsnprintf( sWhat, nSize+1, lpFormat, vargs ); 48 vsnprintf( sWhat, nSize+1, lpFormat, vargs );
49} 49}
50 50
51const char *Exception::what() const throw() 51const char *ExceptionBase::what() const throw()
52{ 52{
53 return sWhat; 53 return sWhat;
54} 54}
55 55
56int Exception::getErrorCode() 56int ExceptionBase::getErrorCode()
57{ 57{
58 return nErrorCode; 58 return nErrorCode;
59} 59}