middle of porting; unstable, don't checkout; refs #1
This commit is contained in:
50
src/mrw/exception.cpp
Normal file
50
src/mrw/exception.cpp
Normal file
@@ -0,0 +1,50 @@
|
||||
/** @file
|
||||
|
||||
$Id$
|
||||
|
||||
$Date$
|
||||
$Author$
|
||||
|
||||
@copy © Marc Wäckerlin
|
||||
@license LGPL, see file <a href="license.html">COPYING</a>
|
||||
|
||||
$Log$
|
||||
Revision 1.2 2004/08/28 16:21:25 marc
|
||||
mrw-c++-0.92 (mrw)
|
||||
- new file: version.cpp
|
||||
- new file header for all sources
|
||||
- work around warning in mrw::auto<T>
|
||||
- possibility to compile without log4cxx
|
||||
- work around bugs in demangle.h and libiberty.h
|
||||
- corrections in documentation
|
||||
- added simple tracing mechanism
|
||||
- more warnings
|
||||
- small corrections in Auto<>::Free and a new test for it
|
||||
- possibility to compile without stack trace
|
||||
|
||||
*/
|
||||
#include <mrw/exception.hpp>
|
||||
|
||||
#ifdef HAVE_STACKTRACE
|
||||
# include <mrw/stacktrace.hpp>
|
||||
#else
|
||||
namespace mrw {
|
||||
class StackTrace {
|
||||
public:
|
||||
operator std::string() throw() {return "";}
|
||||
};
|
||||
}
|
||||
#endif
|
||||
|
||||
namespace mrw {
|
||||
exception::exception() throw(std::bad_exception):
|
||||
_stacktrace(new StackTrace) {
|
||||
}
|
||||
exception::~exception() throw() {
|
||||
delete _stacktrace;
|
||||
}
|
||||
const std::string& exception::stacktrace() const throw(std::bad_exception) {
|
||||
static const std::string st(*_stacktrace);
|
||||
return st;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user