// SPDX-License-Identifier: GPL-2.0-or-later #ifndef FQTERM_CFG_H #define FQTERM_CFG_H #include #include #include namespace FQTerm { typedef QMap Section; typedef QMap StrSecMap; class FQTermConfig { private: StrSecMap data; bool loadFromStream(QTextStream &); bool saveToStream(QTextStream &); bool addSection(const QString §ionName); public: FQTermConfig(const QString &fileName); ~FQTermConfig(); bool load(const QString &filename); bool save(const QString &fileName); bool setItemValue(const QString §ionName, const QString &itemName, const QString &itemValue); QString getItemValue(const QString §ionName, const QString &itemName) const; bool deleteItem(const QString §ionName, const QString &itemName); bool deleteSection(const QString §ionName); bool renameSection(const QString §ionName, const QString &newName); bool hasSection(const QString §ionName) const; }; } // namespace FQTerm #endif // FQTERM_CFG_H