| 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 "CConfigDebugDataReader.h" |
| 22 |
|
| 23 |
|
| 24 |
namespace Konclude { |
| 25 |
|
| 26 |
namespace Config { |
| 27 |
|
| 28 |
CConfigDebugDataReader::CConfigDebugDataReader() { |
| 29 |
} |
| 30 |
|
| 31 |
|
| 32 |
CConfigDebugDataReader::~CConfigDebugDataReader() { |
| 33 |
} |
| 34 |
|
| 35 |
|
| 36 |
|
| 37 |
|
| 38 |
bool CConfigDebugDataReader::readConfigDebugWritingEnabled(CConfiguration *config, const QString &configString, bool defaultValue, bool *errorFlag) { |
| 39 |
bool generalDebugWritingValue = CConfigDataReader::readConfigBoolean(config, "Konclude.Debugging.WriteDebuggingData", defaultValue, errorFlag); |
| 40 |
bool specificDebugWritingValue = generalDebugWritingValue; |
| 41 |
if (generalDebugWritingValue && configString != "Konclude.Debugging.WriteDebuggingData") { |
| 42 |
specificDebugWritingValue = CConfigDataReader::readConfigBoolean(config, configString, defaultValue, errorFlag); |
| 43 |
} |
| 44 |
return generalDebugWritingValue && specificDebugWritingValue; |
| 45 |
} |
| 46 |
|
| 47 |
|
| 48 |
bool CConfigDebugDataReader::readConfigDebugWritingEnabled(CConfigurationProvider *configProv, const QString &configString, bool defaultValue, bool *errorFlag) { |
| 49 |
CConfiguration *config = 0; |
| 50 |
if (configProv) { |
| 51 |
config = configProv->getCurrentConfiguration(); |
| 52 |
} |
| 53 |
return readConfigDebugWritingEnabled(config, configString, defaultValue, errorFlag); |
| 54 |
} |
| 55 |
|
| 56 |
|
| 57 |
|
| 58 |
bool CConfigDebugDataReader::readConfigDebugWritingPreprocessingEnabled(CConfiguration *config, const QString &configString, bool defaultValue, bool *errorFlag) { |
| 59 |
bool preprocessingDebugWritingValue = readConfigDebugWritingEnabled(config, "Konclude.Debugging.WritePreprocessingDebuggingData", defaultValue, errorFlag); |
| 60 |
bool specificDebugWritingValue = preprocessingDebugWritingValue; |
| 61 |
if (preprocessingDebugWritingValue && configString != "Konclude.Debugging.WriteDebuggingData" && configString != "Konclude.Debugging.WritePreprocessingDebuggingData") { |
| 62 |
specificDebugWritingValue = CConfigDataReader::readConfigBoolean(config, configString, defaultValue, errorFlag); |
| 63 |
} |
| 64 |
return preprocessingDebugWritingValue && specificDebugWritingValue; |
| 65 |
} |
| 66 |
|
| 67 |
|
| 68 |
bool CConfigDebugDataReader::readConfigDebugWritingPreprocessingEnabled(CConfigurationProvider *configProv, const QString &configString, bool defaultValue, bool *errorFlag) { |
| 69 |
CConfiguration *config = 0; |
| 70 |
if (configProv) { |
| 71 |
config = configProv->getCurrentConfiguration(); |
| 72 |
} |
| 73 |
return readConfigDebugWritingPreprocessingEnabled(config, configString, defaultValue, errorFlag); |
| 74 |
} |
| 75 |
|
| 76 |
|
| 77 |
|
| 78 |
|
| 79 |
|
| 80 |
QString CConfigDebugDataReader::readConfigDebuggingWritingFileString(CConfiguration *config, const QString &configString, const QString &basePathConfigString, const QString& defaultValue, bool *errorFlag) { |
| 81 |
QString baseFileString = CConfigDataReader::readConfigString(config, "Konclude.Debugging.BaseWritingPath"); |
| 82 |
if (basePathConfigString != "Konclude.Konclude.Debugging.BaseWritingPath") { |
| 83 |
QString extenstionFileString = CConfigDataReader::readConfigString(config, basePathConfigString); |
| 84 |
baseFileString += extenstionFileString; |
| 85 |
} |
| 86 |
QString fileString = CConfigDataReader::readConfigString(config,configString,defaultValue,errorFlag); |
| 87 |
if (!baseFileString.isEmpty()) { |
| 88 |
fileString = baseFileString + QDir::separator() + fileString; |
| 89 |
} |
| 90 |
return fileString; |
| 91 |
} |
| 92 |
|
| 93 |
|
| 94 |
QString CConfigDebugDataReader::readConfigDebuggingWritingFileString(CConfigurationProvider *configProv, const QString &configString, const QString &basePathConfigString, const QString& defaultValue, bool *errorFlag) { |
| 95 |
CConfiguration *config = 0; |
| 96 |
if (configProv) { |
| 97 |
config = configProv->getCurrentConfiguration(); |
| 98 |
} |
| 99 |
return readConfigDebuggingWritingFileString(config, configString, basePathConfigString, defaultValue, errorFlag); |
| 100 |
} |
| 101 |
|
| 102 |
}; // end namespace Config |
| 103 |
|
| 104 |
}; // end namespace Konclude |