File indexing completed on 2024-03-24 15:18:04

0001 /*
0002     SPDX-FileCopyrightText: 2021 Valentin Boettcher <hiro at protagon.space; @hiro98:tchncs.de>
0003 
0004     SPDX-License-Identifier: GPL-2.0-or-later
0005 */
0006 
0007 /**
0008  * Some glue code to import `_Internet_Resolved` and
0009  * `_Manual_Additions` into the new DSO database.
0010  */
0011 
0012 #pragma once
0013 
0014 #include <utility>
0015 #include <QString>
0016 #include <QSqlDatabase>
0017 #include <QStandardPaths>
0018 #include <QFileInfo>
0019 #include "kspaths.h"
0020 #include "catalogsdb.h"
0021 
0022 namespace SkyComponentsImport
0023 {
0024 /**
0025  * Get the skycomponent database from the specified path.
0026  *
0027  * \returns wether the database could be found and read and the
0028  * database itself.
0029  */
0030 std::pair<bool, QSqlDatabase> get_skycomp_db(const QString &path);
0031 
0032 /**
0033  * Get the skycomponent database from the standard path.
0034  *
0035  * \returns wether the database could be found and read and the
0036  * database itself.
0037  */
0038 std::pair<bool, QSqlDatabase> get_skycomp_db();
0039 
0040 /**
0041  * \returns wether the operation succeeded, an error message and if it
0042  * was successful the objects from the catalogs with \p ids.
0043  */
0044 std::tuple<bool, QString, CatalogsDB::CatalogObjectVector>
0045 get_objects(QSqlDatabase db, const std::list<int> &ids = { 1, 2 });
0046 
0047 } // namespace SkyComponentsImport