Application entry point macro.
More...
#include "Exception.h"
#include "System/Log.h"
#include "System/Environment.h"
#include "Text/Format.h"
#include "Globalization/Lang.h"
Go to the source code of this file.
Detailed Description
Application entry point macro.
- Author:
- Ondrej Danek ondre.nosp@m.j.da.nosp@m.nek@g.nosp@m.mail.nosp@m..com
- Date:
- 2010
Define Documentation
Value:int main (int argc, char **argv, char **envp)\
{\
try\
{\
Saf::System::Environment::Init(argc, argv, envp);\
APPCLASS::Main();\
}\
catch (const Saf::Exception &e)\
{\
Saf::System::Log::Error(Saf::Text::Format(Globalization::Lang::Translate("Exception: {0}")) << e);\
Saf::System::Environment::Exit(1);\
}\
catch (const std::exception &e)\
{\
Saf::System::Log::Error(Saf::Text::Format(Globalization::Lang::Translate("Exception: {0}")) << Saf::Text::String(e.what()));\
Saf::System::Environment::Exit(1);\
}\
catch (...)\
{\
Saf::System::Log::Error(Saf::Globalization::Lang::Translate("Unknown exception caught - terminating application"));\
Saf::System::Environment::Exit(1);\
}\
\
return 0;\
}
- Todo:
- Neudelat tady nejaky safe logovani? Co kdyz dojde k vyjimce v logovacim targetu a ja ho pak zavolam znovu? Neobalit to jeste jednim velkym try a z neho volat uz jen nejaky bezpecny printf nebo neco podobnyho?