| 1 |
/* |
| 2 |
* Copyright (C) 2013-2015, 2019 by the Konclude Developer Team. |
| 3 |
* |
| 4 |
* This file is part of the reasoning system Konclude. |
| 5 |
* For details and support, see <http://konclude.com/>. |
| 6 |
* |
| 7 |
* Konclude is free software: you can redistribute it and/or modify |
| 8 |
* it under the terms of version 3 of the GNU Lesser General Public |
| 9 |
* License (LGPLv3) as published by the Free Software Foundation. |
| 10 |
* |
| 11 |
* Konclude is distributed in the hope that it will be useful, |
| 12 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 13 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 14 |
* GNU (Lesser) General Public License for more details. |
| 15 |
* |
| 16 |
* You should have received a copy of the GNU (Lesser) General Public |
| 17 |
* License along with Konclude. If not, see <http://www.gnu.org/licenses/>. |
| 18 |
* |
| 19 |
*/ |
| 20 |
|
| 21 |
#ifndef KONCLUDE_COMPILE_JNI_INTERFACE |
| 22 |
|
| 23 |
|
| 24 |
|
| 25 |
#include <QCoreApplication> |
| 26 |
|
| 27 |
#include "CKoncludeInfo.h" |
| 28 |
|
| 29 |
#include "Utilities/UtilitiesSettings.h" |
| 30 |
|
| 31 |
#include "Logger/CLogger.h" |
| 32 |
#include "Logger/CConsolePrintLogObserver.h" |
| 33 |
#include "Logger/CQtDebugPrintLogObserver.h" |
| 34 |
|
| 35 |
|
| 36 |
#include "Control/Loader/CCommandLineLoader.h" |
| 37 |
#include "Control/Loader/CDefaultLoaderFactory.h" |
| 38 |
|
| 39 |
#include "Control/Interface/CommandLine/CCommandLinePreparationTranslatorSelector.h" |
| 40 |
|
| 41 |
|
| 42 |
using namespace Konclude; |
| 43 |
using namespace Konclude::Logger; |
| 44 |
using namespace Konclude::Utilities; |
| 45 |
using namespace Konclude::Control::Loader; |
| 46 |
using namespace Konclude::Control::Interface::CommandLine; |
| 47 |
|
| 48 |
|
| 49 |
|
| 50 |
|
| 51 |
int main(int argc, char *argv[]) |
| 52 |
{ |
| 53 |
|
| 54 |
QCoreApplication a(argc, argv); |
| 55 |
|
| 56 |
CLogger *logger = CLogger::getInstance(); |
| 57 |
|
| 58 |
try { |
| 59 |
|
| 60 |
QString koncludeString(QString("%1 - %2").arg(CKoncludeInfo::getKoncludeName()).arg(CKoncludeInfo::getKoncludeNameExtension())); |
| 61 |
|
| 62 |
LOG(INFO,"::Konclude::Main","Starting Konclude ... ",0); |
| 63 |
LOG(INFO,"::Konclude::Main",koncludeString,0); |
| 64 |
LOG(INFO,"::Konclude::Main",QString("%1, %2, Version %3 (%4)\r\n").arg(CKoncludeInfo::getKoncludeDescription()).arg(CKoncludeInfo::getKoncludeBitPlatformString()).arg(CKoncludeInfo::getKoncludeVersionString()).arg(CKoncludeInfo::getKoncludeCompilationDateString()),0); |
| 65 |
|
| 66 |
CLoaderFactory *loaderFactory = new CDefaultLoaderFactory(); |
| 67 |
|
| 68 |
QStringList arguments = CCommandLineLoader::getEncodedArguments(argc,argv); |
| 69 |
|
| 70 |
CCommandLinePreparationTranslatorSelector transSelector(loaderFactory); |
| 71 |
arguments = transSelector.translateArguments(arguments); |
| 72 |
|
| 73 |
CCommandLineLoader *cmdLineLoader = new CCommandLineLoader(arguments,false); |
| 74 |
cmdLineLoader->init(loaderFactory); |
| 75 |
|
| 76 |
cmdLineLoader->load(); |
| 77 |
a.exec(); |
| 78 |
cmdLineLoader->exit(); |
| 79 |
delete cmdLineLoader; |
| 80 |
delete loaderFactory; |
| 81 |
|
| 82 |
|
| 83 |
|
| 84 |
LOG(INFO,"::Konclude::Main",logTr("Stopping Konclude ... ."),0); |
| 85 |
|
| 86 |
} catch (...) { |
| 87 |
LOG(CATASTROPHIC,"::Konclude::Main",logTr("Stop because of an unknown catastrophic error."),0); |
| 88 |
} |
| 89 |
|
| 90 |
logger->shutdownLogger(); |
| 91 |
|
| 92 |
return 0; |
| 93 |
} |
| 94 |
|
| 95 |
|
| 96 |
#endif // KONCLUDE_COMPILE_JNI_INTERFACE |