KConfig 5.109.0
ksharedconfig.h
1/*
2 This file is part of the KDE libraries
3 SPDX-FileCopyrightText: 1999 Preston Brown <pbrown@kde.org>
4 SPDX-FileCopyrightText: 1997-1999 Matthias Kalle Dalheimer <kalle@kde.org>
5
6 SPDX-License-Identifier: LGPL-2.0-or-later
7*/
8
9#ifndef KSHAREDCONFIG_H
10#define KSHAREDCONFIG_H
11
12#include <QExplicitlySharedDataPointer>
13#include <kconfig.h>
14
31class KCONFIGCORE_EXPORT KSharedConfig : public KConfig, public QSharedData // krazy:exclude=dpointer (only for refcounting)
32{
33public:
34 typedef QExplicitlySharedDataPointer<KSharedConfig> Ptr;
35
36public:
61 static KSharedConfig::Ptr
62 openConfig(const QString &fileName = QString(), OpenFlags mode = FullConfig, QStandardPaths::StandardLocation type = QStandardPaths::GenericConfigLocation);
63
84 static KSharedConfig::Ptr openStateConfig(const QString &fileName = QString());
85
86 ~KSharedConfig() override;
87
88private:
89 Q_DISABLE_COPY(KSharedConfig)
90 KConfigGroup groupImpl(const QByteArray &aGroup) override;
91 const KConfigGroup groupImpl(const QByteArray &aGroup) const override;
92
93 KCONFIGCORE_NO_EXPORT KSharedConfig(const QString &file, OpenFlags mode, QStandardPaths::StandardLocation resourceType);
94};
95
96typedef KSharedConfig::Ptr KSharedConfigPtr;
97
98#endif // multiple inclusion guard
A class for one specific group in a KConfig object.
Definition kconfiggroup.h:39
The central class of the KDE configuration data system.
Definition kconfig.h:57
QFlags< OpenFlag > OpenFlags
Stores a combination of #OpenFlag values.
Definition kconfig.h:94
KConfig variant using shared memory.
Definition ksharedconfig.h:32
static KSharedConfig::Ptr openStateConfig(const QString &fileName=QString())
Creates a KSharedConfig object to manipulate a configuration file suitable for storing state informat...
static KSharedConfig::Ptr openConfig(const QString &fileName=QString(), OpenFlags mode=FullConfig, QStandardPaths::StandardLocation type=QStandardPaths::GenericConfigLocation)
Creates a KSharedConfig object to manipulate a configuration file.