File indexing completed on 2025-01-19 03:53:33
0001 /* ============================================================ 0002 * 0003 * This file is a part of digiKam project 0004 * https://www.digikam.org 0005 * 0006 * Date : 2009-06-27 0007 * Description : Database Engine element configuration loader 0008 * 0009 * SPDX-FileCopyrightText: 2009-2010 by Holger Foerster <hamsi2k at freenet dot de> 0010 * SPDX-FileCopyrightText: 2010-2024 by Gilles Caulier <caulier dot gilles at gmail dot com> 0011 * 0012 * SPDX-License-Identifier: GPL-2.0-or-later 0013 * 0014 * ============================================================ */ 0015 0016 #ifndef DIGIKAM_DB_ENGINE_CONFIG_LOADER_H 0017 #define DIGIKAM_DB_ENGINE_CONFIG_LOADER_H 0018 0019 #include "dbengineconfigsettings.h" 0020 0021 // Qt includes 0022 0023 #include <QString> 0024 #include <QMap> 0025 #include <QDomElement> 0026 0027 // Local includes 0028 0029 #include "digikam_export.h" 0030 0031 namespace Digikam 0032 { 0033 0034 class DIGIKAM_EXPORT DbEngineConfigSettingsLoader 0035 { 0036 public: 0037 0038 explicit DbEngineConfigSettingsLoader(const QString& filepath, int xmlVersion); 0039 0040 bool readConfig(const QString& filepath, int xmlVersion); 0041 DbEngineConfigSettings readDatabase(QDomElement& databaseElement); 0042 0043 void readDBActions(const QDomElement& sqlStatementElements, DbEngineConfigSettings& configElement); 0044 0045 public: 0046 0047 bool isValid; 0048 QString errorMessage; 0049 QMap<QString, DbEngineConfigSettings> databaseConfigs; 0050 }; 0051 0052 } // namespace Digikam 0053 0054 #endif // DIGIKAM_DB_ENGINE_CONFIG_LOADER_H