| 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_TEST_EVALUATION_CREASONEREVALUATIONPATHCONVERTER_H |
| 22 |
#define KONCLUDE_TEST_EVALUATION_CREASONEREVALUATIONPATHCONVERTER_H |
| 23 |
|
| 24 |
// Libraries includes |
| 25 |
#include <QDir> |
| 26 |
#include <QMap> |
| 27 |
|
| 28 |
// Namespace includes |
| 29 |
#include "EvaluationSettings.h" |
| 30 |
|
| 31 |
|
| 32 |
// Other includes |
| 33 |
#include "Utilities/UtilitiesSettings.h" |
| 34 |
|
| 35 |
|
| 36 |
// Logger includes |
| 37 |
#include "Logger/CLogger.h" |
| 38 |
|
| 39 |
|
| 40 |
|
| 41 |
namespace Konclude { |
| 42 |
|
| 43 |
using namespace Utilities; |
| 44 |
|
| 45 |
namespace Test { |
| 46 |
|
| 47 |
namespace Evaluation { |
| 48 |
|
| 49 |
class CVersionNumbersItem { |
| 50 |
public: |
| 51 |
bool operator<(const CVersionNumbersItem& item) const { |
| 52 |
// sort version with highest numbers first in the map |
| 53 |
QList<cint64> tmpList1(mNumberList); |
| 54 |
QList<cint64> tmpList2(item.mNumberList); |
| 55 |
while (!tmpList1.isEmpty() && !tmpList2.isEmpty()) { |
| 56 |
cint64 number1 = tmpList1.takeFirst(); |
| 57 |
cint64 number2 = tmpList2.takeFirst(); |
| 58 |
if (number1 > number2) { |
| 59 |
return true; |
| 60 |
} else if (number2 > number1) { |
| 61 |
return false; |
| 62 |
} |
| 63 |
} |
| 64 |
if (tmpList2.isEmpty()) { |
| 65 |
return true; |
| 66 |
} else { |
| 67 |
return false; |
| 68 |
} |
| 69 |
} |
| 70 |
|
| 71 |
CVersionNumbersItem* addNumber(cint64 number) { |
| 72 |
mNumberList.append(number); |
| 73 |
return this; |
| 74 |
} |
| 75 |
QList<cint64> mNumberList; |
| 76 |
}; |
| 77 |
|
| 78 |
/*! |
| 79 |
* |
| 80 |
* \class CReasonerEvaluationPathConverter |
| 81 |
* \author Andreas Steigmiller |
| 82 |
* \version 0.1 |
| 83 |
* \brief TODO |
| 84 |
* |
| 85 |
*/ |
| 86 |
class CReasonerEvaluationPathConverter { |
| 87 |
// public variables |
| 88 |
public: |
| 89 |
|
| 90 |
|
| 91 |
// public methods |
| 92 |
public: |
| 93 |
//! Constructor |
| 94 |
CReasonerEvaluationPathConverter(); |
| 95 |
|
| 96 |
static QString getCorrectedPathString(const QString& pathString); |
| 97 |
|
| 98 |
// protected methods |
| 99 |
protected: |
| 100 |
|
| 101 |
// protected variables |
| 102 |
protected: |
| 103 |
|
| 104 |
// private methods |
| 105 |
private: |
| 106 |
|
| 107 |
// private variables |
| 108 |
private: |
| 109 |
|
| 110 |
}; |
| 111 |
|
| 112 |
}; // end namespace Evaluation |
| 113 |
|
| 114 |
}; // end namespace Test |
| 115 |
|
| 116 |
}; // end namespace Konclude |
| 117 |
|
| 118 |
#endif // KONCLUDE_TEST_EVALUATION_CREASONEREVALUATIONPATHCONVERTER_H |