aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/exceptionbase.cpp10
-rw-r--r--src/exceptionbase.h6
2 files changed, 16 insertions, 0 deletions
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 )
48 vsnprintf( sWhat, nSize+1, lpFormat, vargs ); 48 vsnprintf( sWhat, nSize+1, lpFormat, vargs );
49} 49}
50 50
51void ExceptionBase::setWhat( const char *lpText )
52{
53 if( sWhat ) delete[] sWhat;
54 int nSize;
55
56 nSize = strlen( lpText );
57 sWhat = new char[nSize+1];
58 strcpy( sWhat, lpText );
59}
60
51const char *ExceptionBase::what() const throw() 61const char *ExceptionBase::what() const throw()
52{ 62{
53 return sWhat; 63 return sWhat;
diff --git a/src/exceptionbase.h b/src/exceptionbase.h
index 7c3cbd9..6f1eca7 100644
--- a/src/exceptionbase.h
+++ b/src/exceptionbase.h
@@ -60,6 +60,12 @@ public:
60 */ 60 */
61 void setWhat( const char *lpFormat, va_list &vargs ); 61 void setWhat( const char *lpFormat, va_list &vargs );
62 62
63 /**
64 *
65 * @param lpText
66 */
67 void setWhat( const char *lpText );
68
63private: 69private:
64 int nErrorCode; /**< The code for the error that occured. */ 70 int nErrorCode; /**< The code for the error that occured. */
65 char *sWhat; /**< The text string telling people what went wrong. */ 71 char *sWhat; /**< The text string telling people what went wrong. */