| 1 | // SPDX-FileCopyrightText: 2023 UnionTech Software Technology Co., Ltd. |
| 2 | // |
| 3 | // SPDX-License-Identifier: GPL-3.0-or-later |
| 4 | |
| 5 | #ifndef BINARYTOOLSETTINGS_H |
| 6 | #define BINARYTOOLSETTINGS_H |
| 7 | |
| 8 | #include <QSettings> |
| 9 | |
| 10 | class BinaryToolsSetting |
| 11 | { |
| 12 | public: |
| 13 | BinaryToolsSetting(); |
| 14 | BinaryToolsSetting(const QString &fileName, QObject *parent = nullptr); |
| 15 | |
| 16 | void setValue(const QString &key, const QVariant &value); |
| 17 | QVariant getValue(const QString &key, const QVariant &defaultValue); |
| 18 | QVariant getValue(const QString &key); |
| 19 | void deleteKey(const QString &key); |
| 20 | void replaceKey(const QString &oldKey, const QString &newKey); |
| 21 | bool hasKey(const QString &key); |
| 22 | void allValues(); |
| 23 | |
| 24 | private: |
| 25 | QSettings *settings = nullptr; |
| 26 | }; |
| 27 | |
| 28 | #endif // BINARYTOOLSETTINGS_H |
| 29 | |