File indexing completed on 2024-11-24 04:16:54

0001 /*
0002   SPDX-FileCopyrightText: 2023-2024 Laurent Montel <montel.org>
0003 
0004   SPDX-License-Identifier: GPL-2.0-or-later
0005 */
0006 #pragma once
0007 #include "libbergamot_export.h"
0008 #include <QDir>
0009 #include <QString>
0010 
0011 namespace BergamotEngineUtils
0012 {
0013 [[nodiscard]] LIBBERGAMOT_EXPORT QString defaultBergamotRepository();
0014 [[nodiscard]] LIBBERGAMOT_EXPORT QString groupName();
0015 [[nodiscard]] LIBBERGAMOT_EXPORT QString coreNumberKey();
0016 [[nodiscard]] LIBBERGAMOT_EXPORT QString memoryByThreadKey();
0017 [[nodiscard]] LIBBERGAMOT_EXPORT QString storageLanguagePath();
0018 [[nodiscard]] LIBBERGAMOT_EXPORT QString useLocalCacheKey();
0019 
0020 struct LIBBERGAMOT_EXPORT LanguageInstalled {
0021     QString from;
0022     QString to;
0023     QString shortName;
0024     QString absoluteLanguageModelPath;
0025     int version = -1;
0026     [[nodiscard]] bool operator==(const LanguageInstalled &other) const;
0027 };
0028 
0029 [[nodiscard]] LIBBERGAMOT_EXPORT QVector<LanguageInstalled> languageLocallyStored(const QString &path = {});
0030 struct LIBBERGAMOT_EXPORT SettingsInfo {
0031     void loadSettingsInfo();
0032     void saveSettingsInfo();
0033 
0034     int numberOfThread = 0;
0035     int memoryByThread = 64;
0036     bool useLocalCache = false;
0037 };
0038 };
0039 
0040 LIBBERGAMOT_EXPORT QDebug operator<<(QDebug d, const BergamotEngineUtils::LanguageInstalled &t);
0041 Q_DECLARE_TYPEINFO(BergamotEngineUtils::LanguageInstalled, Q_MOVABLE_TYPE);