X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fcore%2Fexcept.cpp;h=bdcdd7df3da312b5f613630da9a67ec11ab8d0c5;hb=a1d6fa071280123f282c1bac3b68008672401024;hp=245bc0502c0481b36a218531bb14bff93c2fbc13;hpb=c13c5d2e330e4cee177c1fd8e0b6153c7e2503e4;p=libs%2Fcore.git diff --git a/source/core/except.cpp b/source/core/except.cpp index 245bc05..bdcdd7d 100644 --- a/source/core/except.cpp +++ b/source/core/except.cpp @@ -1,24 +1,37 @@ /* $Id$ This file is part of libmspcore -Copyright © 2006-2007 Mikko Rasa, Mikkosoft Productions +Copyright © 2006-2008 Mikko Rasa, Mikkosoft Productions Distributed under the LGPL */ + #include +#include +#ifdef WIN32 +#include +#endif #include "except.h" using namespace std; namespace Msp { -Exception::Exception(const string &w_): - w(w_) +Exception::Exception(const string &w): + wot(w) { #ifdef WITH_EXCEPTION_BACKTRACE - bt=Debug::Backtrace::create(); + bt = Debug::Backtrace::create(); #endif } +Exception &Exception::at(const std::string &w) throw() +{ + wer = w; + wot = wer+": "+wot; + return *this; +} + + SystemError::SystemError(const string &w_, int e): Exception(build_what(w_, e)), err(e) @@ -29,11 +42,21 @@ string SystemError::build_what(const string &w, int e) ostringstream buf; buf<