Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Toggle main menu visibility
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
// Qt-Security score:significant reason:default
4
5
#
ifndef
QHSTSPOLICY_H
6
#
define
QHSTSPOLICY_H
7
8
#
include
<
QtNetwork
/
qtnetworkglobal
.
h
>
9
10
#
include
<
QtCore
/
qshareddata
.
h
>
11
#
include
<
QtCore
/
qflags
.
h
>
12
#
include
<
QtCore
/
qurl
.
h
>
13
14
QT_BEGIN_NAMESPACE
15
16
class
QHstsPolicyPrivate;
17
class
QDateTime;
18
class
QString;
19
class
Q_NETWORK_EXPORT
QHstsPolicy
20
{
21
public
:
22
enum
PolicyFlag
23
{
24
IncludeSubDomains = 1
25
};
26
Q_DECLARE_FLAGS(PolicyFlags, PolicyFlag)
27
28
QHstsPolicy();
29
QHstsPolicy(
const
QDateTime &expiry, PolicyFlags flags,
const
QString &host,
30
QUrl::ParsingMode mode = QUrl::DecodedMode);
31
QHstsPolicy(
const
QHstsPolicy &rhs);
32
QHstsPolicy &operator=(
const
QHstsPolicy &rhs);
33
QHstsPolicy &operator=(QHstsPolicy &&other)
noexcept
{ swap(other);
return
*
this
; }
34
~QHstsPolicy();
35
36
void
swap(QHstsPolicy &other)
noexcept
{ d.swap(other.d); }
37
38
void
setHost(
const
QString &host, QUrl::ParsingMode mode = QUrl::DecodedMode);
39
QString host(QUrl::ComponentFormattingOptions options = QUrl::FullyDecoded)
const
;
40
void
setExpiry(
const
QDateTime &expiry);
41
QDateTime expiry()
const
;
42
void
setIncludesSubDomains(
bool
include);
43
bool
includesSubDomains()
const
;
44
45
bool
isExpired()
const
;
46
47
private
:
48
QSharedDataPointer<QHstsPolicyPrivate> d;
49
50
bool
isEqual(
const
QHstsPolicy &other)
const
;
51
friend
bool
operator==(
const
QHstsPolicy &lhs,
const
QHstsPolicy &rhs)
52
{
return
lhs.isEqual(rhs); }
53
friend
bool
operator!=(
const
QHstsPolicy &lhs,
const
QHstsPolicy &rhs)
54
{
return
!lhs.isEqual(rhs); }
55
};
56
57
Q_DECLARE_SHARED
(
QHstsPolicy
)
58
Q_DECLARE_OPERATORS_FOR_FLAGS(QHstsPolicy::PolicyFlags)
59
60
61
62
QT_END_NAMESPACE
63
64
#
endif
// QHSTSPOLICY_H
QHstsPolicy
The QHstsPolicy class specifies that a host supports HTTP Strict Transport Security policy (HSTS).
Definition
qhstspolicy.h:20
qtbase
src
network
access
qhstspolicy.h
Generated on
for Qt by
1.18.0