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 #include <clocale>
00032 #include "application.hh"
00033
00034
00035
00036
00037
00038
00040 TApplication* ptApplication;
00041
00042
00044 int main (int argc, const char* argv[])
00045 {
00046
00047 using std::cerr;
00048 using std::endl;
00049
00050 int iExitCode;
00051
00052 std::setlocale (LC_ALL, "");
00053 try
00054 {
00055 ptApplication = new TApplication (PACKAGE, VERSION, argc, argv);
00056 ptApplication->initialize();
00057 iExitCode = ptApplication->start();
00058 delete ptApplication;
00059 }
00060 catch (const mpcl::util::prefs::TNotParameterAbleException& rktEXCEPTION)
00061 {
00062
00063
00064
00065 iExitCode = 4;
00066 cerr << rktEXCEPTION.generalDescription();
00067 if ( !rktEXCEPTION.specificDescription().empty() )
00068 {
00069 cerr << " (--" << rktEXCEPTION.specificDescription() << ")";
00070 }
00071 cerr << endl;
00072 delete ptApplication;
00073 }
00074 catch (const mpcl::TException& rktEXCEPTION)
00075 {
00076 iExitCode = 3;
00077 cerr << rktEXCEPTION;
00078 delete ptApplication;
00079 }
00080 catch (const std::bad_alloc& rktEXCEPTION)
00081 {
00082 iExitCode = 2;
00083 cerr << rktEXCEPTION.what() << endl;
00084 }
00085 catch (const std::exception& rktEXCEPTION)
00086 {
00087 iExitCode = 2;
00088 cerr << rktEXCEPTION.what() << endl;
00089 delete ptApplication;
00090 }
00091 catch (...)
00092 {
00093 iExitCode = 1;
00094 cerr << mpcl::TException ("unhandled exception", NULL, __FILE__, __LINE__);
00095 delete ptApplication;
00096 }
00097 return iExitCode;
00098
00099 }