X-Git-Url: http://git.tdb.fi/?p=libs%2Fcore.git;a=blobdiff_plain;f=source%2Fcore%2Fexcept.cpp;h=41fe3e8c597ecf5157af5f1fda2169ebce3b6545;hp=7ac634d9a30c9ef9c8f8dec01633b5c950c96ef8;hb=e14321c38b34ec1cc5641b267f031693a8f7bc27;hpb=20e1beb546c26eae3b1a61ab2051108a7dca221f diff --git a/source/core/except.cpp b/source/core/except.cpp index 7ac634d..41fe3e8 100644 --- a/source/core/except.cpp +++ b/source/core/except.cpp @@ -1,46 +1,55 @@ -/* $Id$ - -This file is part of libmspcore -Copyright © 2006-2007 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) { } -KeyError::KeyError(const string &w_, const string &k): - Exception(w_+" ("+k+")"), - key(k) -{ } - string SystemError::build_what(const string &w, int e) { ostringstream buf; buf<