#pragma once

#include <Windows.h>
#include <QObject>
#include <QScopedPointer>

class RegistryPrivate;
class Registry: public QObject
{
    Q_OBJECT
public:
    Registry(QObject *parent = Q_NULLPTR);
    Registry(HKEY key,
             const QString &regKey,
             bool autoArch = true,
             bool isWOW64 = true,
             QObject *parent = Q_NULLPTR);
    ~Registry();

    void open(HKEY key, const QString &keyPath, bool autoArch = true, bool isWOW64 = true);
    QStringList childGroups() const;
    QStringList keys()const;
    QVariant value(const QString &key) const;

    Registry *subKey(const QString &key);

private:
    QScopedPointer<RegistryPrivate> dd_ptr;
    Q_DECLARE_PRIVATE_D(qGetPtrHelper(dd_ptr), Registry)

};

