Skip to content
Snippets Groups Projects
config.h 741 B
Newer Older
akiraohgaki's avatar
akiraohgaki committed
/**
 * A library for Qt app
 *
 * LICENSE: The GNU Lesser General Public License, version 3.0
 *
 * @author      Akira Ohgaki <akiraohgaki@gmail.com>
 * @copyright   Akira Ohgaki
 * @license     https://opensource.org/licenses/LGPL-3.0  The GNU Lesser General Public License, version 3.0
 * @link        https://github.com/akiraohgaki/qt-libs
 */

#pragma once
akiraohgaki's avatar
akiraohgaki committed

#include <QObject>
#include <QJsonObject>

akiraohgaki's avatar
akiraohgaki committed
namespace utils {
akiraohgaki's avatar
akiraohgaki committed

class Config : public QObject
{
    Q_OBJECT

public:
    explicit Config(const QString &configsDir, QObject *parent = 0);

    QJsonObject get(const QString &name);
    bool set(const QString &name, const QJsonObject &jsonObj);
akiraohgaki's avatar
akiraohgaki committed

private:
    QString configsDir_;
    QJsonObject cacheData_;
akiraohgaki's avatar
akiraohgaki committed
} // namespace utils