Debian Codegraph @

Source/Control/Interface/CommandLine/CCLIRealizationComandLinePreparationTranslator.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 "CCLIRealizationComandLinePreparationTranslator.h"
22
23
24 namespace Konclude {
25
26 namespace Control {
27
28 namespace Interface {
29
30 namespace CommandLine {
31
32 CCLIRealizationComandLinePreparationTranslator::CCLIRealizationComandLinePreparationTranslator(CLoaderFactory *loaderFactory) : CCLIComandLinePreparationTranslator(loaderFactory) {
33 mOperationTypeString = QString("Realization");
34 mMinNecessaryArguments = true;
35 mFirstArgumentTranslation = false;
36 mLoaderTypeString = QString("-CLIRealizationBatchProcessingLoader");
37 }
38
39
40 CCLIRealizationComandLinePreparationTranslator::~CCLIRealizationComandLinePreparationTranslator() {
41 }
42
43 bool CCLIRealizationComandLinePreparationTranslator::hasNeccessaryParameters() {
44 bool minNecessaryArguments = true;
45 if (!mFirstArgumentTranslation) {
46 minNecessaryArguments = false;
47 }
48 if (!mRequestFileTranslated) {
49 LOG(ERROR,getLogDomain(),logTr("%1 request file not specified.").arg(mOperationTypeString),this);
50 minNecessaryArguments = false;
51 }
52 return minNecessaryArguments;
53 }
54
55 bool CCLIRealizationComandLinePreparationTranslator::translate(const QString& argumentText, QStringList& remainingArgList) {
56
57 bool argumentTranslated = false;
58
59
60 QString modArgText = argumentText.trimmed();
61 if (!mSkipTranslation) {
62 if (CCommandLinePreparationTranslator::translate(argumentText,remainingArgList)) {
63 argumentTranslated = true;
64 } else {
65 if (modArgText.indexOf("-") == 0) {
66 } else if (modArgText == "realisation" || modArgText == "realise" || modArgText == "realization" || modArgText == "realize") {
67 argumentTranslated = true;
68 mFirstArgumentTranslation = true;
69 }
70 }
71 }
72 return argumentTranslated;
73 }
74
75 bool CCLIRealizationComandLinePreparationTranslator::canTranslate(const QString& string) {
76 if (QString::compare(string,"realization",Qt::CaseInsensitive) == 0 || QString::compare(string,"realize",Qt::CaseInsensitive) == 0) {
77 return true;
78 }
79 if (QString::compare(string,"realisation",Qt::CaseInsensitive) == 0 || QString::compare(string,"realise",Qt::CaseInsensitive) == 0) {
80 return true;
81 }
82 return false;
83 }
84
85
86 }; // end namespace CommandLine
87
88 }; // end namespace Interface
89
90 }; // end namespace Control
91
92 }; // end namespace Konclude