Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
qhstspolicy.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
4#ifndef QHSTSPOLICY_H
5#define QHSTSPOLICY_H
6
7#include <QtNetwork/qtnetworkglobal.h>
8
9#include <QtCore/qshareddata.h>
10#include <QtCore/qflags.h>
11#include <QtCore/qurl.h>
12
14
16class QDateTime;
17class QString;
18class Q_NETWORK_EXPORT QHstsPolicy
19{
20public:
22 {
23 IncludeSubDomains = 1
24 };
25 Q_DECLARE_FLAGS(PolicyFlags, PolicyFlag)
26
28 QHstsPolicy(const QDateTime &expiry, PolicyFlags flags, const QString &host,
30 QHstsPolicy(const QHstsPolicy &rhs);
31 QHstsPolicy &operator=(const QHstsPolicy &rhs);
32 QHstsPolicy &operator=(QHstsPolicy &&other) noexcept { swap(other); return *this; }
34
35 void swap(QHstsPolicy &other) noexcept { d.swap(other.d); }
36
38 QString host(QUrl::ComponentFormattingOptions options = QUrl::FullyDecoded) const;
39 void setExpiry(const QDateTime &expiry);
40 QDateTime expiry() const;
41 void setIncludesSubDomains(bool include);
42 bool includesSubDomains() const;
43
44 bool isExpired() const;
45
46private:
47 QSharedDataPointer<QHstsPolicyPrivate> d;
48
49 bool isEqual(const QHstsPolicy &other) const;
50 friend bool operator==(const QHstsPolicy &lhs, const QHstsPolicy &rhs)
51 { return lhs.isEqual(rhs); }
52 friend bool operator!=(const QHstsPolicy &lhs, const QHstsPolicy &rhs)
53 { return !lhs.isEqual(rhs); }
54};
55
56Q_DECLARE_SHARED(QHstsPolicy)
57Q_DECLARE_OPERATORS_FOR_FLAGS(QHstsPolicy::PolicyFlags)
58
59
60
62
63#endif // QHSTSPOLICY_H
static bool isEqual(const aiUVTransform &a, const aiUVTransform &b)
\inmodule QtCore\reentrant
Definition qdatetime.h:283
The QHstsPolicy class specifies that a host supports HTTP Strict Transport Security policy (HSTS).
Definition qhstspolicy.h:19
PolicyFlag
\value IncludeSubDomains Indicates whether a policy must include subdomains
Definition qhstspolicy.h:22
QHstsPolicy & operator=(QHstsPolicy &&other) noexcept
Definition qhstspolicy.h:32
friend bool operator!=(const QHstsPolicy &lhs, const QHstsPolicy &rhs)
Returns true if the two policies lhs and rhs do not have the same host or expiration date,...
Definition qhstspolicy.h:52
friend bool operator==(const QHstsPolicy &lhs, const QHstsPolicy &rhs)
Returns true if the two policies lhs and rhs have the same host and expiration date while agreeing on...
Definition qhstspolicy.h:50
void swap(QHstsPolicy &other) noexcept
Swaps this policy with the other policy.
Definition qhstspolicy.h:35
\macro QT_RESTRICTED_CAST_FROM_ASCII
Definition qstring.h:129
ParsingMode
The parsing mode controls the way QUrl parses strings.
Definition qurl.h:96
@ DecodedMode
Definition qurl.h:99
@ FullyDecoded
Definition qurl.h:130
void setHost()
Combined button and popup list for selecting options.
#define Q_DECLARE_FLAGS(Flags, Enum)
Definition qflags.h:174
#define Q_DECLARE_OPERATORS_FOR_FLAGS(Flags)
Definition qflags.h:194
GLenum mode
GLbitfield flags
QSharedPointer< T > other(t)
[5]
this swap(other)