From 603f45fbe9c3e0ac511425a13bbb19b87495bb4e Mon Sep 17 00:00:00 2001 From: Mike Buland Date: Sat, 27 Jan 2007 08:43:21 +0000 Subject: Added a function to make the Base Exception class a little friendlier. --- src/exceptionbase.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/exceptionbase.cpp') diff --git a/src/exceptionbase.cpp b/src/exceptionbase.cpp index a9b9820..f3d22da 100644 --- a/src/exceptionbase.cpp +++ b/src/exceptionbase.cpp @@ -48,6 +48,16 @@ void ExceptionBase::setWhat( const char *lpFormat, va_list &vargs ) vsnprintf( sWhat, nSize+1, lpFormat, vargs ); } +void ExceptionBase::setWhat( const char *lpText ) +{ + if( sWhat ) delete[] sWhat; + int nSize; + + nSize = strlen( lpText ); + sWhat = new char[nSize+1]; + strcpy( sWhat, lpText ); +} + const char *ExceptionBase::what() const throw() { return sWhat; -- cgit v1.2.3