Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037 #include "Poco/Bugcheck.h"
00038 #include "Poco/Debugger.h"
00039 #include "Poco/Exception.h"
00040 #include <sstream>
00041
00042
00043 namespace Poco {
00044
00045
00046 void Bugcheck::assertion(const char* cond, const char* file, int line)
00047 {
00048 Debugger::enter(std::string("Assertion violation: ") + cond, file, line);
00049 throw AssertionViolationException(what(cond, file, line));
00050 }
00051
00052
00053 void Bugcheck::nullPointer(const char* ptr, const char* file, int line)
00054 {
00055 Debugger::enter(std::string("NULL pointer: ") + ptr, file, line);
00056 throw NullPointerException(what(ptr, file, line));
00057 }
00058
00059
00060 void Bugcheck::bugcheck(const char* file, int line)
00061 {
00062 Debugger::enter("Bugcheck", file, line);
00063 throw BugcheckException(what(0, file, line));
00064 }
00065
00066
00067 void Bugcheck::bugcheck(const char* msg, const char* file, int line)
00068 {
00069 std::string m("Bugcheck");
00070 if (msg)
00071 {
00072 m.append(": ");
00073 m.append(msg);
00074 }
00075 Debugger::enter(m, file, line);
00076 throw BugcheckException(what(msg, file, line));
00077 }
00078
00079
00080 void Bugcheck::debugger(const char* file, int line)
00081 {
00082 Debugger::enter(file, line);
00083 }
00084
00085
00086 void Bugcheck::debugger(const char* msg, const char* file, int line)
00087 {
00088 Debugger::enter(msg, file, line);
00089 }
00090
00091
00092 std::string Bugcheck::what(const char* msg, const char* file, int line)
00093 {
00094 std::ostringstream str;
00095 if (msg) str << msg << " ";
00096 str << "in file \"" << file << "\", line " << line;
00097 return str.str();
00098 }
00099
00100
00101
00102
00103 }