X-Git-Url: http://git.tdb.fi/?p=libs%2Fcore.git;a=blobdiff_plain;f=source%2Fcore%2Fapplication.cpp;h=43bb023143679e7fdf5e64d893208f859222d973;hp=00ff9bea89e8af8bba5fd07fd8b2d426dccc12ed;hb=f042fd992170ee8a50a7f596f1c9cdd9600b8583;hpb=967785734be5c3fc6f75da122c2d93ebbb338271 diff --git a/source/core/application.cpp b/source/core/application.cpp index 00ff9be..43bb023 100644 --- a/source/core/application.cpp +++ b/source/core/application.cpp @@ -1,10 +1,8 @@ -#ifdef WIN32 -#include -#endif -#include -#include #include -#include "../debug/demangle.h" +#include +#include +#include +#include #include "application.h" #include "getopt.h" @@ -20,27 +18,19 @@ Application::Application(): exit_code(0) { } -/** -Constructs an instance of the registered application class and runs it. If the -application throws a usage_error, a help message is printed. The GetOpt class -will throw such exceptions automatically in error conditions. - -This function can only be called once. The global main() function provided by -the library normally does it automatically at program startup. -*/ int Application::run(int argc, char **argv, void *data) { static bool called = false; if(called) { - cerr<<"Trying to call Application::run_app twice!\n"; + IO::cerr.write("Trying to call Application::run_app twice!\n"); return 125; } called = true; if(!starter_) { - cerr<<"Trying to run with no RegisteredApplication class!\n"; + IO::cerr.write("Trying to run with no RegisteredApplication class!\n"); return 126; } @@ -54,8 +44,7 @@ int Application::run(int argc, char **argv, void *data) } catch(const usage_error &e) { - cerr<report_uncaught_exception(e); -#ifdef WIN32 - string msg = Debug::demangle(typeid(e).name())+":\n"+e.what(); - MessageBoxA(0, msg.c_str(), "Uncaught exception", MB_OK|MB_ICONERROR); -#else - cerr<<"An uncaught exception occurred.\n"; - cerr<<" type: "<sighandler(s);