Debian Codegraph @

Source/Control/Interface/CommandLine/CCLIComandLinePreparationTranslator.cpp

raw
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 #include "CCLIComandLinePreparationTranslator.h"
22
23
24 namespace Konclude {
25
26 namespace Control {
27
28 namespace Interface {
29
30 namespace CommandLine {
31
32 CCLIComandLinePreparationTranslator::CCLIComandLinePreparationTranslator(CLoaderFactory *loaderFactory) : CCommandLinePreparationTranslator(loaderFactory) {
33 mInterfaceTypeString = QString("CLI");
34 mMinNecessaryArguments = false;
35 mFirstArgumentTranslation = false;
36 }
37
38
39 CCLIComandLinePreparationTranslator::~CCLIComandLinePreparationTranslator() {
40 }
41
42 QStringList CCLIComandLinePreparationTranslator::combineTranslatedArguments() {
43 QStringList translatedArgList;
44
45 if (!hasNeccessaryParameters()) {
46 mMinNecessaryArguments = false;
47 }
48
49 if (!mMinNecessaryArguments) {
50 LOG(ERROR,getLogDomain(),logTr("Execution with inadequate command line arguments."),this);
51 mHelpRequested = true;
52 }
53
54 if (!mHelpRequested) {
55 if (mLogConfList.isEmpty()) {
56 mLogConfList.append(QString("-ConfigurableCoutLogObserverLoader -LoggerConfigurationLoader"));
57 }
58 translatedArgList += mLogConfList;
59 translatedArgList += mGeneralConfList;
60
61 translatedArgList += QString("-DefaultReasonerLoader ");
62 translatedArgList += mReasonerConfList;
63 translatedArgList += mGeneralConfList;
64
65 if (!mConfigConfList.isEmpty()) {
66 translatedArgList += QString("-OWLlinkBatchFileLoader +=Konclude.OWLlink.CloseAfterProcessedRequest=false +=Konclude.OWLlink.BlockUntilProcessedRequest=true");
67 translatedArgList += mConfigConfList;
68 }
69
70 translatedArgList += mLoaderTypeString;
71 if (mExtendendLogging) {
72 translatedArgList += QString("+=Konclude.OWLlink.LoggingExtendedProcessingTimes=true");
73 }
74 translatedArgList += mRequestConfList;
75
76 translatedArgList += mMiscellaneousList;
77 } else {
78 translatedArgList += QString("-ConfigurableCoutLogObserverLoader -CommandLineTranlatorHelpLoader");
79 }
80 return translatedArgList;
81 }
82
83 bool CCLIComandLinePreparationTranslator::translate(const QString& argumentText, QStringList& remainingArgList) {
84
85 bool argumentTranslated = false;
86
87
88 QString modArgText = argumentText.trimmed();
89 if (!mSkipTranslation) {
90 if (CCommandLinePreparationTranslator::translate(argumentText,remainingArgList)) {
91 argumentTranslated = true;
92 }
93 }
94 return argumentTranslated;
95 }
96
97 bool CCLIComandLinePreparationTranslator::canTranslate(const QString& string) {
98 return false;
99 }
100
101
102 }; // end namespace CommandLine
103
104 }; // end namespace Interface
105
106 }; // end namespace Control
107
108 }; // end namespace Konclude