Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
qhstsstore_p.h
Go to the documentation of this file.
1// Copyright (C) 2017 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3// Qt-Security score:significant reason:default
4
5#ifndef QHSTSSTORE_P_H
6#define QHSTSSTORE_P_H
7
8//
9// W A R N I N G
10// -------------
11//
12// This file is not part of the Qt API. It exists for the convenience
13// of the Network Access API. This header file may change from
14// version to version without notice, or even be removed.
15//
16// We mean it.
17//
18
19#include <QtNetwork/private/qtnetworkglobal_p.h>
20
22
23#include <QtCore/qlist.h>
24#include <QtCore/qsettings.h>
25
26QT_BEGIN_NAMESPACE
27
28class QHstsPolicy;
29class QByteArray;
30class QString;
31
32class Q_AUTOTEST_EXPORT QHstsStore
33{
34public:
35 explicit QHstsStore(const QString &dirName);
36 ~QHstsStore();
37
38 QList<QHstsPolicy> readPolicies();
39 void addToObserved(const QHstsPolicy &policy);
40 void synchronize();
41
42 bool isWritable() const;
43
44 static QString absoluteFilePath(const QString &dirName);
45private:
46 void beginHstsGroups();
47 bool serializePolicy(const QString &key, const QHstsPolicy &policy);
48 bool deserializePolicy(const QString &key, QHstsPolicy &policy);
49 void evictPolicy(const QString &key);
50 void endHstsGroups();
51
52 QList<QHstsPolicy> observedPolicies;
53 QSettings store;
54
55 Q_DISABLE_COPY_MOVE(QHstsStore)
56};
57
58QT_END_NAMESPACE
59
60#endif // QHSTSSTORE_P_H
static QString settings_key_to_host_name(const QString &key)
static QString host_name_to_settings_key(const QString &hostName)
QSettings settings("MyCompany", "MyApp")
[11]