| 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 "CCreateKnowledgeBaseRevisionUpdateCommand.h" |
| 22 |
|
| 23 |
|
| 24 |
namespace Konclude { |
| 25 |
|
| 26 |
namespace Control { |
| 27 |
|
| 28 |
namespace Command { |
| 29 |
|
| 30 |
namespace Instructions { |
| 31 |
|
| 32 |
CCreateKnowledgeBaseRevisionUpdateCommand::CCreateKnowledgeBaseRevisionUpdateCommand(const QString &knowledgeBaseNameString, CCommand *parentSuperCommand) |
| 33 |
: CKnowledgeBaseCommand(parentSuperCommand) { |
| 34 |
kbString = knowledgeBaseNameString; |
| 35 |
onRev = nullptr; |
| 36 |
mCreateIfNotExist = false; |
| 37 |
mReportErrorIfNotExists = true; |
| 38 |
} |
| 39 |
|
| 40 |
CCreateKnowledgeBaseRevisionUpdateCommand::CCreateKnowledgeBaseRevisionUpdateCommand(const QString &knowledgeBaseNameString, bool createIfNotExist, CCommand *parentSuperCommand) : CKnowledgeBaseCommand(parentSuperCommand) { |
| 41 |
kbString = knowledgeBaseNameString; |
| 42 |
onRev = nullptr; |
| 43 |
mCreateIfNotExist = createIfNotExist; |
| 44 |
mReportErrorIfNotExists = true; |
| 45 |
} |
| 46 |
|
| 47 |
CCreateKnowledgeBaseRevisionUpdateCommand::CCreateKnowledgeBaseRevisionUpdateCommand(const QString &knowledgeBaseNameString, bool createIfNotExist, bool reportErrorIfNotExists, CCommand *parentSuperCommand) : CKnowledgeBaseCommand(parentSuperCommand) { |
| 48 |
kbString = knowledgeBaseNameString; |
| 49 |
onRev = nullptr; |
| 50 |
mCreateIfNotExist = createIfNotExist; |
| 51 |
mReportErrorIfNotExists = reportErrorIfNotExists; |
| 52 |
} |
| 53 |
|
| 54 |
CCreateKnowledgeBaseRevisionUpdateCommand::~CCreateKnowledgeBaseRevisionUpdateCommand() { |
| 55 |
} |
| 56 |
|
| 57 |
|
| 58 |
qint64 CCreateKnowledgeBaseRevisionUpdateCommand::getCommandTag() { |
| 59 |
return CREATEKNOWLEDGEBASEREVISIONCOMMAND; |
| 60 |
} |
| 61 |
|
| 62 |
QString CCreateKnowledgeBaseRevisionUpdateCommand::getKnowledgeBaseName() { |
| 63 |
return kbString; |
| 64 |
} |
| 65 |
|
| 66 |
|
| 67 |
QString CCreateKnowledgeBaseRevisionUpdateCommand::getBriefCommandDescription() { |
| 68 |
return QString("Create-'%1'-Knowledge-Base-Revision-Update Command").arg(kbString); |
| 69 |
} |
| 70 |
|
| 71 |
|
| 72 |
COntologyRevision *CCreateKnowledgeBaseRevisionUpdateCommand::getOntologyRevision() { |
| 73 |
return onRev; |
| 74 |
} |
| 75 |
|
| 76 |
CCreateKnowledgeBaseRevisionUpdateCommand *CCreateKnowledgeBaseRevisionUpdateCommand::setOntologyRevision(COntologyRevision *ontologyRevision) { |
| 77 |
onRev = ontologyRevision; |
| 78 |
return this; |
| 79 |
} |
| 80 |
|
| 81 |
CCommand *CCreateKnowledgeBaseRevisionUpdateCommand::getCommand() { |
| 82 |
return this; |
| 83 |
} |
| 84 |
|
| 85 |
|
| 86 |
bool CCreateKnowledgeBaseRevisionUpdateCommand::requireCreateIfNotExist() { |
| 87 |
return mCreateIfNotExist; |
| 88 |
} |
| 89 |
|
| 90 |
bool CCreateKnowledgeBaseRevisionUpdateCommand::reportErrorCreateIfNotExist() { |
| 91 |
return mReportErrorIfNotExists; |
| 92 |
} |
| 93 |
|
| 94 |
|
| 95 |
}; // end namespace Instructions |
| 96 |
|
| 97 |
}; // end namespace Command |
| 98 |
|
| 99 |
}; // end namespace Control |
| 100 |
|
| 101 |
}; // end namespace Konclude |